Fix the xm mem-max command. Closes bug #933.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
This commit is contained in:
Ewan Mellor committed 2007-03-26 13:50:33 +01:00
1 parent 09502ab38f
commit 10e9ec0d21
1 file changed
+6 -4
+6 -4
View File
@@ -593,13 +593,15 @@ class XendDomainInfo:
"""Set the maximum memory limit of this domain
@param limit: In MiB.
"""
log.debug("Setting memory maximum of domain %s (%d) to %d MiB.",
self.info['name_label'], self.domid, limit)
log.debug("Setting memory maximum of domain %s (%s) to %d MiB.",
self.info['name_label'], str(self.domid), limit)
if limit <= 0:
raise XendError('Invalid memory size')
self.info['memory_static_max'] = limit
MiB = 1024 * 1024
self.info['memory_static_max'] = limit * MiB
if self.domid >= 0:
maxmem = int(limit) * 1024
try:
@@ -607,7 +609,7 @@ class XendDomainInfo:
except Exception, ex:
raise XendError(str(ex))
else:
self.info['memory_dynamic_max'] = limit
self.info['memory_dynamic_max'] = limit * MiB
xen.xend.XendDomain.instance().managed_config_save(self)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.