Fixed typos
This commit is contained in:
parent
6d6d6ad7ff
commit
be3e888bbe
@ -168,7 +168,7 @@ class QubesVm(object):
|
||||
"func": lambda value:
|
||||
datetime.datetime.fromtimestamp(int(value)) if value
|
||||
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": {
|
||||
"func": lambda x: system_path["config_template_pv"] },
|
||||
"icon_path": {
|
||||
@ -316,7 +316,7 @@ class QubesVm(object):
|
||||
qubes_host = QubesHost()
|
||||
total_mem_mb = qubes_host.memory_total/1024
|
||||
self.maxmem = total_mem_mb/2
|
||||
|
||||
|
||||
# Linux specific cap: max memory can't scale beyond 10.79*init_mem
|
||||
if self.maxmem > self.memory * 10:
|
||||
self.maxmem = self.memory * 10
|
||||
|
@ -181,7 +181,7 @@ guiagent_installed
|
||||
Accepted values: ``True``, ``False``
|
||||
|
||||
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
|
||||
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
|
||||
|
@ -17,7 +17,7 @@ Options
|
||||
|
||||
.. option:: --force
|
||||
|
||||
Do not prompt for comfirmation
|
||||
Do not prompt for confirmation
|
||||
|
||||
Authors
|
||||
=======
|
||||
|
@ -36,7 +36,7 @@ Supported services
|
||||
==================
|
||||
|
||||
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
|
||||
Default: enabled everywhere excluding NetVM
|
||||
@ -47,7 +47,7 @@ meminfo-writer
|
||||
.. note::
|
||||
|
||||
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.
|
||||
|
||||
qubes-dvm
|
||||
|
@ -24,7 +24,7 @@
|
||||
import logging
|
||||
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
|
||||
CACHE_FACTOR = 1.3
|
||||
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']:
|
||||
ret = True
|
||||
#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
|
||||
#it can be achieved with legal values, too, and it will not allow to
|
||||
#starve existing domains, by design
|
||||
@ -93,7 +93,7 @@ def refresh_meminfo_for_domain(domain, untrusted_xenstore_key):
|
||||
#sanitized, can assign
|
||||
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']
|
||||
|
||||
|
||||
def prefmem(domain):
|
||||
#dom0 is special, as it must have large cache, for vbds. Thus, give it a special boost
|
||||
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
|
||||
ret = prefmem(domain) - domain.memory_actual
|
||||
return ret
|
||||
|
||||
|
||||
#prepare list of (domain, memory_target) pairs that need to be passed
|
||||
#to "xm memset" equivalent in order to obtain "memsize" of memory
|
||||
#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
|
||||
|
||||
|
||||
#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
|
||||
def balance_when_low_on_memory(domain_dictionary,
|
||||
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
|
||||
#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
|
||||
#"xm memset" equivalent
|
||||
#"xm memset" equivalent
|
||||
def balance(xen_free_memory, domain_dictionary):
|
||||
log.debug('balance(xen_free_memory={!r}, domain_dictionary={!r})'.format(
|
||||
xen_free_memory, domain_dictionary))
|
||||
|
||||
#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
|
||||
#can provide memory. So, it can be negative when plenty of memory.
|
||||
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
|
||||
total_mem_pref_acceptors = 0
|
||||
|
||||
|
||||
donors = list() # domains that can yield memory
|
||||
acceptors = list() # domains that require more memory
|
||||
#pass 1: compute the above "total" values
|
||||
@ -276,7 +276,7 @@ def balance(xen_free_memory, domain_dictionary):
|
||||
total_memory_needed += need
|
||||
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:
|
||||
return balance_when_enough_memory(domain_dictionary, xen_free_memory, total_mem_pref, total_available_memory)
|
||||
else:
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
'''Documentation helpers
|
||||
|
||||
This module contains classes and functions which help to mainain documentation,
|
||||
particulary our custom Sphinx extension.
|
||||
This module contains classes and functions which help to maintain documentation,
|
||||
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 rawtext: The entire markup snippet, with 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 options: Directive options 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
|
||||
: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
|
||||
:py:class:`qubes.vm.qubesvm.QubesVM`.
|
||||
'''
|
||||
|
@ -34,7 +34,7 @@ def main():
|
||||
usage = "usage: %prog [options] <template-name>"
|
||||
parser = OptionParser (usage)
|
||||
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 ()
|
||||
if (len (args) != 1):
|
||||
@ -98,7 +98,7 @@ def main():
|
||||
prompt = raw_input ("Do you want to proceed? [y/N] ")
|
||||
if not (prompt == "y" or prompt == "Y"):
|
||||
exit (0)
|
||||
|
||||
|
||||
p = subprocess.Popen(["/sbin/dmsetup", "table", old_dmdev], stdout=subprocess.PIPE)
|
||||
result = p.communicate()
|
||||
dm_table = result[0]
|
||||
|
Loading…
Reference in New Issue
Block a user