From 30ff420b520630a25a0b9c8e015d496821e7231c Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Thu, 5 Jul 2012 01:17:45 +0200 Subject: [PATCH] dom0/qmemman: minor fix in mem_set() Set target/maxmem in more logical order (balloon driver can fail to balloon the first time, but will retry anyway). Force sizes to be integers. --- dom0/qmemman/qmemman.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dom0/qmemman/qmemman.py b/dom0/qmemman/qmemman.py index 86d5b939..c982ecf0 100755 --- a/dom0/qmemman/qmemman.py +++ b/dom0/qmemman/qmemman.py @@ -58,15 +58,15 @@ class SystemState: def mem_set(self, id, val): print 'mem-set domain', id, 'to', val self.domdict[id].last_target = val - self.xs.write('', '/local/domain/' + id + '/memory/target', str(val/1024)) #can happen in the middle of domain shutdown #apparently xc.lowlevel throws exceptions too try: - self.xc.domain_setmaxmem(int(id), val/1024 + 1024) # LIBXL_MAXMEM_CONSTANT=1024 - self.xc.domain_set_target_mem(int(id), val/1024) + self.xc.domain_setmaxmem(int(id), int(val/1024) + 1024) # LIBXL_MAXMEM_CONSTANT=1024 + self.xc.domain_set_target_mem(int(id), int(val/1024)) except: pass - + self.xs.write('', '/local/domain/' + id + '/memory/target', str(int(val/1024))) + def mem_set_obsolete(self, id, val): uuid = self.domdict[id].uuid if val >= 2**31: