Skip to contentSkip to conversation

Fix xm mem-max command

PATCH In review Masaki Kanno 2 participants 3 messages Feb 26, 2008 – Feb 27, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix xm mem-max command

Hi,

When I gave 2 TiB or more to xm mem-max command, I saw the following error message. But the maxmem value was changed.

# xm list --long vm1 | grep maxmem
    (maxmem 256)
# xm mem-max vm1 2097152
Error: long int too large to convert to int
Usage: xm mem-max <Domain> <Mem>

Set the maximum amount reservation for a domain.

# xm list --long vm1 | grep maxmem
    (maxmem 2097152)

This patch reverts the maxmem value to the previous maxmem value when the error occurs.

# xm list --long vm1 | grep maxmem
    (maxmem 256)
# xm mem-max vm1 2097152
Error: long int too large to convert to int
Usage: xm mem-max <Domain> <Mem>

Set the maximum amount reservation for a domain.

# xm list --long vm1 | grep maxmem
    (maxmem 256)

Best regards,
Kan

tools/python/xen/xend/XendDomainInfo.py +2 -0
diff -r d34e99141506 tools/python/xen/xend/XendDomainInfo.py
@@ -906,6 +906,7 @@ class XendDomainInfo:
         log.debug("Setting memory maximum of domain %s (%s) to %d MiB.",
                   self.info['name_label'], str(self.domid), limit)
 
+        maxmem_cur = self.get_memory_static_max()
         MiB = 1024 * 1024
         self._safe_set_memory('memory_static_max', limit * MiB)
 
@@ -914,6 +915,7 @@ class XendDomainInfo:
             try:
                 return xc.domain_setmaxmem(self.domid, maxmem)
             except Exception, ex:
+                self._safe_set_memory('memory_static_max', maxmem_cur)
                 raise XendError(str(ex))
         xen.xend.XendDomain.instance().managed_config_save(self)
 

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

#1 lore raw

Hi,

I got similar problems with these scripts on the range of int. Do you know how to solve them radically?

weiming

2008/2/26 Masaki Kanno <[email protected]>:

Quoted 31 lines

Hi,

When I gave 2 TiB or more to xm mem-max command, I saw the following error message. But the maxmem value was changed.

# xm list --long vm1 | grep maxmem
   (maxmem 256)
# xm mem-max vm1 2097152
Error: long int too large to convert to int
Usage: xm mem-max <Domain> <Mem>

Set the maximum amount reservation for a domain.

# xm list --long vm1 | grep maxmem
   (maxmem 2097152)

This patch reverts the maxmem value to the previous maxmem value when the error occurs.

# xm list --long vm1 | grep maxmem
   (maxmem 256)
# xm mem-max vm1 2097152
Error: long int too large to convert to int
Usage: xm mem-max <Domain> <Mem>

Set the maximum amount reservation for a domain.

# xm list --long vm1 | grep maxmem
   (maxmem 256)
Quoted 10 lines

Best regards,
Kan

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

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

#2 lore raw
Quoted 5 lines

Hi,

I got similar problems with these scripts on the range of int. Do you know how to solve them radically?

Hi,

No, I don't know for details.
AFAIK, an upper limit of maxmem value is under 2 TiB. I consulted a description of the following changeset.

http://xenbits.xensource.com/xen-unstable.hg?rev/9647be59212d

But, current maxmem value of Domain-0 is 4 TiB - 1 MiB as follows.

# xm list --long Domain-0 | grep maxmem
    (maxmem 4194303)

Best regards,
Kan

Quoted 36 lines

2008/2/26 Masaki Kanno <[email protected]>:

Quoted 34 lines

Hi,

When I gave 2 TiB or more to xm mem-max command, I saw the following error message. But the maxmem value was changed.

# xm list --long vm1 | grep maxmem
   (maxmem 256)
# xm mem-max vm1 2097152
Error: long int too large to convert to int
Usage: xm mem-max <Domain> <Mem>

Set the maximum amount reservation for a domain.

# xm list --long vm1 | grep maxmem
   (maxmem 2097152)

This patch reverts the maxmem value to the previous maxmem value when the error occurs.

# xm list --long vm1 | grep maxmem
   (maxmem 256)
# xm mem-max vm1 2097152
Error: long int too large to convert to int
Usage: xm mem-max <Domain> <Mem>

Set the maximum amount reservation for a domain.

# xm list --long vm1 | grep maxmem
   (maxmem 256)

Best regards,
Kan