Skip to contentSkip to conversation

xl: make mem-set and mem-max to use MB for memory unit by default.

PATCH New Zhigang Wang 1 participant 1 message Jun 4, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xl: make mem-set and mem-max to use MB for memory unit by default.

Hi all,

As the memory size is huge today and for backward compatibility with xm, I recommend to use MB by default.

if use KB, a xl mem-set 0 1024 will invoke oom-killer and make dom0 hang.

Thanks,

Zhigang

xl: make mem-set and mem-max to use MB for memory unit by default.

tools/libxl/xl_cmdimpl.c +1 -3
diff -r 4ab68bf4c37e tools/libxl/xl_cmdimpl.c
@@ -1232,9 +1232,9 @@
         kbytes <<= 10;
     case 'g':
         kbytes <<= 10;
+    case '\0':
     case 'm':
         kbytes <<= 10;
-    case '\0':
     case 'k':
         break;
     case 'b':
@@ -1295,7 +1295,6 @@
         exit(1);
     }
 
-    printf("setting domid %d static max memory to : %s\n", domid, mem);
     exit(0);
 }
 
@@ -1311,7 +1310,6 @@
         exit(3);
     }
 
-    printf("setting domid %d memory to : %lld\n", domid, memorykb);
     libxl_set_memory_target(&ctx, domid, memorykb, /* enforce */ 1);
 }
 
tools/libxl/xl_cmdtable.c +2 -2
diff -r 4ab68bf4c37e tools/libxl/xl_cmdtable.c
@@ -121,12 +121,12 @@
     { "mem-max",
       &main_memmax,
       "Set the maximum amount reservation for a domain",
-      "<Domain> <MemKB['b'[bytes]|'k'[KB]|'m'[MB]|'g'[GB]|'t'[TB]]>",
+      "<Domain> <MemMB['b'[bytes]|'k'[KB]|'m'[MB]|'g'[GB]|'t'[TB]]>",
     },
     { "mem-set",
       &main_memset,
       "Set the current memory usage for a domain",
-      "<Domain> <MemKB['b'[bytes]|'k'[KB]|'m'[MB]|'g'[GB]|'t'[TB]]>",
+      "<Domain> <MemMB['b'[bytes]|'k'[KB]|'m'[MB]|'g'[GB]|'t'[TB]]>",
     },
     { "button-press",
       &main_button_press,

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