Skip to contentSkip to conversation

Fix xm mem-max command

PATCH In review Masaki Kanno 2 participants 2 messages Jun 8, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix xm mem-max command

Hi,

When I tested xm mem-max and xm list, I saw the following error message by xm list. Because xm mem-max always changes "memory_static_max", I think that the cause of the error message is it. This patch fixes it.

# xm list --long PVdomain.1 | grep mem
    (maxmem 1024)
    (memory 1024)
    (shadow_memory 0)
# xm mem-max PVdomain.1 512
Error: (22, 'Invalid argument')
Usage: xm mem-max <Domain> <Mem>

Set the maximum amount reservation for a domain.

# xm list --long PVdomain.1 | grep mem
Error: memory_dynamic_max must be less than or equal to memory_static_max

Best regards,
Kan

tools/python/xen/xend/XendDomainInfo.py +1 -1
diff -r bd3d6b4c52ec tools/python/xen/xend/XendDomainInfo.py
@@ -612,7 +612,7 @@ class XendDomainInfo:
             raise XendError('Invalid memory size')
 
         MiB = 1024 * 1024
-        self.info['memory_static_max'] = limit * MiB
+        self._safe_set_memory('memory_static_max', limit * MiB)
 
         if self.domid >= 0:
             maxmem = int(limit) * 1024

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

Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines

When I tested xm mem-max and xm list, I saw the following error message by xm list. Because xm mem-max always changes "memory_static_max", I think that the cause of the error message is it. This patch fixes it.

Nice catch, patch looks good.

Cheers,
Mark

Quoted 17 lines
# xm list --long PVdomain.1 | grep mem
    (maxmem 1024)
    (memory 1024)
    (shadow_memory 0)
# xm mem-max PVdomain.1 512
Error: (22, 'Invalid argument')
Usage: xm mem-max <Domain> <Mem>

Set the maximum amount reservation for a domain.

# xm list --long PVdomain.1 | grep mem
Error: memory_dynamic_max must be less than or equal to memory_static_max

Best regards,
Kan

Signature · 4 lines
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!