ia64/xen-unstable

changeset 17129:450be98ef36b

Fix xm mem-max command to restore previous setting if xc.domain_setmaxmem fails.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Feb 26 15:02:26 2008 +0000 (2008-02-26)
parents 6ef22eefc360
children e6c3006fd9be
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Feb 26 15:00:08 2008 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Feb 26 15:02:26 2008 +0000
     1.3 @@ -906,6 +906,7 @@ class XendDomainInfo:
     1.4          log.debug("Setting memory maximum of domain %s (%s) to %d MiB.",
     1.5                    self.info['name_label'], str(self.domid), limit)
     1.6  
     1.7 +        maxmem_cur = self.get_memory_static_max()
     1.8          MiB = 1024 * 1024
     1.9          self._safe_set_memory('memory_static_max', limit * MiB)
    1.10  
    1.11 @@ -914,6 +915,7 @@ class XendDomainInfo:
    1.12              try:
    1.13                  return xc.domain_setmaxmem(self.domid, maxmem)
    1.14              except Exception, ex:
    1.15 +                self._safe_set_memory('memory_static_max', maxmem_cur)
    1.16                  raise XendError(str(ex))
    1.17          xen.xend.XendDomain.instance().managed_config_save(self)
    1.18