dom0/qmemman: remove trainling spaces
This commit is contained in:
parent
4ea6a19d5b
commit
2b452c9970
@ -47,7 +47,7 @@ class SystemState:
|
|||||||
self.domdict[id].memory_maximum = self.xs.read('', '/local/domain/%s/memory/static-max' % str(id))
|
self.domdict[id].memory_maximum = self.xs.read('', '/local/domain/%s/memory/static-max' % str(id))
|
||||||
if not self.domdict[id].memory_maximum:
|
if not self.domdict[id].memory_maximum:
|
||||||
self.domdict[id].memory_maximum = self.ALL_PHYS_MEM
|
self.domdict[id].memory_maximum = self.ALL_PHYS_MEM
|
||||||
# the previous line used to be
|
# the previous line used to be
|
||||||
# self.domdict[id].memory_maximum = domain['maxmem_kb']*1024
|
# self.domdict[id].memory_maximum = domain['maxmem_kb']*1024
|
||||||
# but domain['maxmem_kb'] changes in self.mem_set as well, and this results in
|
# but domain['maxmem_kb'] changes in self.mem_set as well, and this results in
|
||||||
# the memory never increasing
|
# the memory never increasing
|
||||||
@ -86,7 +86,7 @@ class SystemState:
|
|||||||
for i in self.domdict.keys():
|
for i in self.domdict.keys():
|
||||||
dom = self.domdict[i]
|
dom = self.domdict[i]
|
||||||
if dom.memory_actual is not None and dom.memory_actual + 200*1024 < dom.last_target:
|
if dom.memory_actual is not None and dom.memory_actual + 200*1024 < dom.last_target:
|
||||||
print "Preventing balloon up to", dom.last_target
|
print "Preventing balloon up to", dom.last_target
|
||||||
self.mem_set(i, dom.memory_actual)
|
self.mem_set(i, dom.memory_actual)
|
||||||
|
|
||||||
#perform memory ballooning, across all domains, to add "memsize" to Xen free memory
|
#perform memory ballooning, across all domains, to add "memsize" to Xen free memory
|
||||||
@ -121,7 +121,7 @@ class SystemState:
|
|||||||
prev_memory_actual[dom] = self.domdict[dom].memory_actual
|
prev_memory_actual[dom] = self.domdict[dom].memory_actual
|
||||||
time.sleep(self.BALOON_DELAY)
|
time.sleep(self.BALOON_DELAY)
|
||||||
niter = niter + 1
|
niter = niter + 1
|
||||||
|
|
||||||
def refresh_meminfo(self, domid, untrusted_meminfo_key):
|
def refresh_meminfo(self, domid, untrusted_meminfo_key):
|
||||||
qmemman_algo.refresh_meminfo_for_domain(self.domdict[domid], untrusted_meminfo_key)
|
qmemman_algo.refresh_meminfo_for_domain(self.domdict[domid], untrusted_meminfo_key)
|
||||||
self.do_balance()
|
self.do_balance()
|
||||||
@ -151,7 +151,7 @@ class SystemState:
|
|||||||
if self.domdict[i].meminfo is not None:
|
if self.domdict[i].meminfo is not None:
|
||||||
print 'dom' , i, 'act/pref', self.domdict[i].memory_actual, qmemman_algo.prefmem(self.domdict[i])
|
print 'dom' , i, 'act/pref', self.domdict[i].memory_actual, qmemman_algo.prefmem(self.domdict[i])
|
||||||
print 'xenfree=', xenfree, 'balance req:', memset_reqs
|
print 'xenfree=', xenfree, 'balance req:', memset_reqs
|
||||||
|
|
||||||
def do_balance(self):
|
def do_balance(self):
|
||||||
if os.path.isfile('/var/run/qubes/do-not-membalance'):
|
if os.path.isfile('/var/run/qubes/do-not-membalance'):
|
||||||
return
|
return
|
||||||
@ -160,7 +160,7 @@ class SystemState:
|
|||||||
memset_reqs = qmemman_algo.balance(xenfree - self.XEN_FREE_MEM_LEFT, self.domdict)
|
memset_reqs = qmemman_algo.balance(xenfree - self.XEN_FREE_MEM_LEFT, self.domdict)
|
||||||
if not self.is_balance_req_significant(memset_reqs, xenfree):
|
if not self.is_balance_req_significant(memset_reqs, xenfree):
|
||||||
return
|
return
|
||||||
|
|
||||||
self.print_stats(xenfree, memset_reqs)
|
self.print_stats(xenfree, memset_reqs)
|
||||||
|
|
||||||
for rq in memset_reqs:
|
for rq in memset_reqs:
|
||||||
|
Loading…
Reference in New Issue
Block a user