Skip to contentSkip to conversation

Fix the xm mem-max command

PATCH Applied Masaki Kanno 2 participants 2 messages Mar 26, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix the xm mem-max command

Hi,

I fixed the Xen bugzilla 933 and other bug.
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=933

BTW, I tested the xm mem-max command with attached patch. The "maxmem" and the "memory" were changed as follows by the xm mem-max command. Is the result specification? or bug? I thought that the result is bug, so I tried to remove the line of "self.info['memory_dynamic_max'] = limit * MiB" in setMemoryMaximum(). As the result, only the "maxmem" was changed by the xm mem-max command. Am I right?

# xm new /xen/vm1.conf 
Using config file "/xen/vm1.conf".
# xm list --long vm1 | grep mem
    (maxmem 384)
    (memory 256)
    (shadow_memory 0)
# xm mem-max vm1 512
# xm list --long vm1 | grep mem
    (maxmem 512)
    (memory 512)
    (shadow_memory 0)

Best regards,
Kan

tools/python/xen/xend/XendDomainInfo.py +6 -4
diff -r dccb274295ae tools/python/xen/xend/XendDomainInfo.py
@@ -592,13 +592,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:
@@ -606,7 +608,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)
 
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Applied
#1 lore raw

On Mon, Mar 26, 2007 at 03:16:55PM +0900, Masaki Kanno wrote:

Content-Description: Mail message body

Quoted 4 lines

Hi,

I fixed the Xen bugzilla 933 and other bug.
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=933

Applied, thank you.

Quoted 7 lines

BTW, I tested the xm mem-max command with attached patch. The "maxmem" and the "memory" were changed as follows by the xm mem-max command. Is the result specification? or bug? I thought that the result is bug, so I tried to remove the line of "self.info['memory_dynamic_max'] = limit * MiB" in setMemoryMaximum(). As the result, only the "maxmem" was changed by the xm mem-max command. Am I right?

Yes, I think you are right -- only the static_max value should be set. I'll fix this -- thanks.

Ewan.