Fixed typos
This commit is contained in:
parent
6d6d6ad7ff
commit
be3e888bbe
@ -168,7 +168,7 @@ class QubesVm(object):
|
|||||||
"func": lambda value:
|
"func": lambda value:
|
||||||
datetime.datetime.fromtimestamp(int(value)) if value
|
datetime.datetime.fromtimestamp(int(value)) if value
|
||||||
else None },
|
else None },
|
||||||
##### Internal attributes - will be overriden in __init__ regardless of args
|
##### Internal attributes - will be overridden in __init__ regardless of args
|
||||||
"config_file_template": {
|
"config_file_template": {
|
||||||
"func": lambda x: system_path["config_template_pv"] },
|
"func": lambda x: system_path["config_template_pv"] },
|
||||||
"icon_path": {
|
"icon_path": {
|
||||||
@ -316,7 +316,7 @@ class QubesVm(object):
|
|||||||
qubes_host = QubesHost()
|
qubes_host = QubesHost()
|
||||||
total_mem_mb = qubes_host.memory_total/1024
|
total_mem_mb = qubes_host.memory_total/1024
|
||||||
self.maxmem = total_mem_mb/2
|
self.maxmem = total_mem_mb/2
|
||||||
|
|
||||||
# Linux specific cap: max memory can't scale beyond 10.79*init_mem
|
# Linux specific cap: max memory can't scale beyond 10.79*init_mem
|
||||||
if self.maxmem > self.memory * 10:
|
if self.maxmem > self.memory * 10:
|
||||||
self.maxmem = self.memory * 10
|
self.maxmem = self.memory * 10
|
||||||
|
@ -181,7 +181,7 @@ guiagent_installed
|
|||||||
Accepted values: ``True``, ``False``
|
Accepted values: ``True``, ``False``
|
||||||
|
|
||||||
This HVM have gui agent installed. This option disables full screen GUI
|
This HVM have gui agent installed. This option disables full screen GUI
|
||||||
virtualization and enables per-window seemless GUI mode. This option will
|
virtualization and enables per-window seamless GUI mode. This option will
|
||||||
be automatically turned on during Qubes Windows Tools installation, but if
|
be automatically turned on during Qubes Windows Tools installation, but if
|
||||||
you install qubes gui agent in some other OS, you need to turn this option
|
you install qubes gui agent in some other OS, you need to turn this option
|
||||||
on manually. You can turn this option off to troubleshoot some early HVM OS
|
on manually. You can turn this option off to troubleshoot some early HVM OS
|
||||||
|
@ -17,7 +17,7 @@ Options
|
|||||||
|
|
||||||
.. option:: --force
|
.. option:: --force
|
||||||
|
|
||||||
Do not prompt for comfirmation
|
Do not prompt for confirmation
|
||||||
|
|
||||||
Authors
|
Authors
|
||||||
=======
|
=======
|
||||||
|
@ -36,7 +36,7 @@ Supported services
|
|||||||
==================
|
==================
|
||||||
|
|
||||||
This list can be incomplete as VM can implement any additional service without
|
This list can be incomplete as VM can implement any additional service without
|
||||||
knowlege of qubes-core code.
|
knowledge of qubes-core code.
|
||||||
|
|
||||||
meminfo-writer
|
meminfo-writer
|
||||||
Default: enabled everywhere excluding NetVM
|
Default: enabled everywhere excluding NetVM
|
||||||
@ -47,7 +47,7 @@ meminfo-writer
|
|||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
This service is enforced to be set by dom0 code. If you try to
|
This service is enforced to be set by dom0 code. If you try to
|
||||||
remove it (reset to defult state), will be recreated with the rule: enabled
|
remove it (reset to default state), will be recreated with the rule: enabled
|
||||||
if VM have no PCI devices assigned, otherwise disabled.
|
if VM have no PCI devices assigned, otherwise disabled.
|
||||||
|
|
||||||
qubes-dvm
|
qubes-dvm
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
import logging
|
import logging
|
||||||
import string
|
import string
|
||||||
|
|
||||||
# This are only defaults - can be overriden by QMemmanServer with values from
|
# This are only defaults - can be overridden by QMemmanServer with values from
|
||||||
# config file
|
# config file
|
||||||
CACHE_FACTOR = 1.3
|
CACHE_FACTOR = 1.3
|
||||||
MIN_PREFMEM = 200*1024*1024
|
MIN_PREFMEM = 200*1024*1024
|
||||||
@ -68,7 +68,7 @@ def is_meminfo_suspicious(domain, untrusted_meminfo):
|
|||||||
if not ret and untrusted_meminfo['MemTotal'] < untrusted_meminfo['MemFree'] + untrusted_meminfo['Cached'] + untrusted_meminfo['Buffers']:
|
if not ret and untrusted_meminfo['MemTotal'] < untrusted_meminfo['MemFree'] + untrusted_meminfo['Cached'] + untrusted_meminfo['Buffers']:
|
||||||
ret = True
|
ret = True
|
||||||
#we could also impose some limits on all the above values
|
#we could also impose some limits on all the above values
|
||||||
#but it has little purpose - all the domain can gain by passing e.g.
|
#but it has little purpose - all the domain can gain by passing e.g.
|
||||||
#very large SwapTotal is that it will be assigned all free Xen memory
|
#very large SwapTotal is that it will be assigned all free Xen memory
|
||||||
#it can be achieved with legal values, too, and it will not allow to
|
#it can be achieved with legal values, too, and it will not allow to
|
||||||
#starve existing domains, by design
|
#starve existing domains, by design
|
||||||
@ -93,7 +93,7 @@ def refresh_meminfo_for_domain(domain, untrusted_xenstore_key):
|
|||||||
#sanitized, can assign
|
#sanitized, can assign
|
||||||
domain.meminfo = untrusted_meminfo
|
domain.meminfo = untrusted_meminfo
|
||||||
domain.mem_used = domain.meminfo['MemTotal'] - domain.meminfo['MemFree'] - domain.meminfo['Cached'] - domain.meminfo['Buffers'] + domain.meminfo['SwapTotal'] - domain.meminfo['SwapFree']
|
domain.mem_used = domain.meminfo['MemTotal'] - domain.meminfo['MemFree'] - domain.meminfo['Cached'] - domain.meminfo['Buffers'] + domain.meminfo['SwapTotal'] - domain.meminfo['SwapFree']
|
||||||
|
|
||||||
def prefmem(domain):
|
def prefmem(domain):
|
||||||
#dom0 is special, as it must have large cache, for vbds. Thus, give it a special boost
|
#dom0 is special, as it must have large cache, for vbds. Thus, give it a special boost
|
||||||
if domain.id == '0':
|
if domain.id == '0':
|
||||||
@ -105,7 +105,7 @@ def memory_needed(domain):
|
|||||||
#in balance(), "distribute total_available_memory proportionally to mempref" relies on this exact formula
|
#in balance(), "distribute total_available_memory proportionally to mempref" relies on this exact formula
|
||||||
ret = prefmem(domain) - domain.memory_actual
|
ret = prefmem(domain) - domain.memory_actual
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
#prepare list of (domain, memory_target) pairs that need to be passed
|
#prepare list of (domain, memory_target) pairs that need to be passed
|
||||||
#to "xm memset" equivalent in order to obtain "memsize" of memory
|
#to "xm memset" equivalent in order to obtain "memsize" of memory
|
||||||
#return empty list when the request cannot be satisfied
|
#return empty list when the request cannot be satisfied
|
||||||
@ -208,7 +208,7 @@ def balance_when_enough_memory(domain_dictionary,
|
|||||||
return donors_rq + acceptors_rq
|
return donors_rq + acceptors_rq
|
||||||
|
|
||||||
|
|
||||||
#when not enough mem to make everyone be above prefmem, make donors be at prefmem, and
|
#when not enough mem to make everyone be above prefmem, make donors be at prefmem, and
|
||||||
#redistribute anything left between acceptors
|
#redistribute anything left between acceptors
|
||||||
def balance_when_low_on_memory(domain_dictionary,
|
def balance_when_low_on_memory(domain_dictionary,
|
||||||
xen_free_memory, total_mem_pref_acceptors, donors, acceptors):
|
xen_free_memory, total_mem_pref_acceptors, donors, acceptors):
|
||||||
@ -239,15 +239,15 @@ def balance_when_low_on_memory(domain_dictionary,
|
|||||||
|
|
||||||
|
|
||||||
#redistribute memory across domains
|
#redistribute memory across domains
|
||||||
#called when one of domains update its 'meminfo' xenstore key
|
#called when one of domains update its 'meminfo' xenstore key
|
||||||
#return the list of (domain, memory_target) pairs to be passed to
|
#return the list of (domain, memory_target) pairs to be passed to
|
||||||
#"xm memset" equivalent
|
#"xm memset" equivalent
|
||||||
def balance(xen_free_memory, domain_dictionary):
|
def balance(xen_free_memory, domain_dictionary):
|
||||||
log.debug('balance(xen_free_memory={!r}, domain_dictionary={!r})'.format(
|
log.debug('balance(xen_free_memory={!r}, domain_dictionary={!r})'.format(
|
||||||
xen_free_memory, domain_dictionary))
|
xen_free_memory, domain_dictionary))
|
||||||
|
|
||||||
#sum of all memory requirements - in other words, the difference between
|
#sum of all memory requirements - in other words, the difference between
|
||||||
#memory required to be added to domains (acceptors) to make them be at their
|
#memory required to be added to domains (acceptors) to make them be at their
|
||||||
#preferred memory, and memory that can be taken from domains (donors) that
|
#preferred memory, and memory that can be taken from domains (donors) that
|
||||||
#can provide memory. So, it can be negative when plenty of memory.
|
#can provide memory. So, it can be negative when plenty of memory.
|
||||||
total_memory_needed = 0
|
total_memory_needed = 0
|
||||||
@ -257,7 +257,7 @@ def balance(xen_free_memory, domain_dictionary):
|
|||||||
|
|
||||||
#sum of memory preferences of all domains that require more memory
|
#sum of memory preferences of all domains that require more memory
|
||||||
total_mem_pref_acceptors = 0
|
total_mem_pref_acceptors = 0
|
||||||
|
|
||||||
donors = list() # domains that can yield memory
|
donors = list() # domains that can yield memory
|
||||||
acceptors = list() # domains that require more memory
|
acceptors = list() # domains that require more memory
|
||||||
#pass 1: compute the above "total" values
|
#pass 1: compute the above "total" values
|
||||||
@ -276,7 +276,7 @@ def balance(xen_free_memory, domain_dictionary):
|
|||||||
total_memory_needed += need
|
total_memory_needed += need
|
||||||
total_mem_pref += prefmem(domain_dictionary[i])
|
total_mem_pref += prefmem(domain_dictionary[i])
|
||||||
|
|
||||||
total_available_memory = xen_free_memory - total_memory_needed
|
total_available_memory = xen_free_memory - total_memory_needed
|
||||||
if total_available_memory > 0:
|
if total_available_memory > 0:
|
||||||
return balance_when_enough_memory(domain_dictionary, xen_free_memory, total_mem_pref, total_available_memory)
|
return balance_when_enough_memory(domain_dictionary, xen_free_memory, total_mem_pref, total_available_memory)
|
||||||
else:
|
else:
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
'''Documentation helpers
|
'''Documentation helpers
|
||||||
|
|
||||||
This module contains classes and functions which help to mainain documentation,
|
This module contains classes and functions which help to maintain documentation,
|
||||||
particulary our custom Sphinx extension.
|
particularly our custom Sphinx extension.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ def ticket(name, rawtext, text, lineno, inliner, options={}, content=[]):
|
|||||||
:param str name: The role name used in the document
|
:param str name: The role name used in the document
|
||||||
:param str rawtext: The entire markup snippet, with role
|
:param str rawtext: The entire markup snippet, with role
|
||||||
:param str text: The text marked with the role
|
:param str text: The text marked with the role
|
||||||
:param int lineno: The line noumber where rawtext appearn in the input
|
:param int lineno: The line number where rawtext appears in the input
|
||||||
:param docutils.parsers.rst.states.Inliner inliner: The inliner instance that called this function
|
:param docutils.parsers.rst.states.Inliner inliner: The inliner instance that called this function
|
||||||
:param options: Directive options for customisation
|
:param options: Directive options for customisation
|
||||||
:param content: The directive content for customisation
|
:param content: The directive content for customisation
|
||||||
|
@ -142,7 +142,7 @@ class BaseVM(qubes.PropertyHolder):
|
|||||||
:param xml: xml node from which to deserialise
|
:param xml: xml node from which to deserialise
|
||||||
:type xml: :py:class:`lxml.etree._Element` or :py:obj:`None`
|
:type xml: :py:class:`lxml.etree._Element` or :py:obj:`None`
|
||||||
|
|
||||||
This class is responsible for serialising and deserialising machines and
|
This class is responsible for serializing and deserialising machines and
|
||||||
provides basic framework. It contains no management logic. For that, see
|
provides basic framework. It contains no management logic. For that, see
|
||||||
:py:class:`qubes.vm.qubesvm.QubesVM`.
|
:py:class:`qubes.vm.qubesvm.QubesVM`.
|
||||||
'''
|
'''
|
||||||
|
@ -34,7 +34,7 @@ def main():
|
|||||||
usage = "usage: %prog [options] <template-name>"
|
usage = "usage: %prog [options] <template-name>"
|
||||||
parser = OptionParser (usage)
|
parser = OptionParser (usage)
|
||||||
parser.add_option ("--force", action="store_true", dest="force", default=False,
|
parser.add_option ("--force", action="store_true", dest="force", default=False,
|
||||||
help="Do not prompt for comfirmation")
|
help="Do not prompt for confirmation")
|
||||||
|
|
||||||
(options, args) = parser.parse_args ()
|
(options, args) = parser.parse_args ()
|
||||||
if (len (args) != 1):
|
if (len (args) != 1):
|
||||||
@ -98,7 +98,7 @@ def main():
|
|||||||
prompt = raw_input ("Do you want to proceed? [y/N] ")
|
prompt = raw_input ("Do you want to proceed? [y/N] ")
|
||||||
if not (prompt == "y" or prompt == "Y"):
|
if not (prompt == "y" or prompt == "Y"):
|
||||||
exit (0)
|
exit (0)
|
||||||
|
|
||||||
p = subprocess.Popen(["/sbin/dmsetup", "table", old_dmdev], stdout=subprocess.PIPE)
|
p = subprocess.Popen(["/sbin/dmsetup", "table", old_dmdev], stdout=subprocess.PIPE)
|
||||||
result = p.communicate()
|
result = p.communicate()
|
||||||
dm_table = result[0]
|
dm_table = result[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user