]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
esx: Ensure max-memory has 4 megabyte granularity
authorMatthias Bolte <matthias.bolte@googlemail.com>
Fri, 28 Jan 2011 20:19:59 +0000 (21:19 +0100)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Fri, 28 Jan 2011 23:59:39 +0000 (00:59 +0100)
src/esx/esx_driver.c

index 61c23719d3ffdae463acc06bb4c871571efb93c0..c66df0e385a6f0e5ae884f21d077964625aec5a8 100644 (file)
@@ -2059,8 +2059,9 @@ esxDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
         goto cleanup;
     }
 
+    /* max-memory must be a multiple of 4096 kilobyte */
     spec->memoryMB->value =
-      VIR_DIV_UP(memory, 1024); /* Scale from kilobytes to megabytes */
+      VIR_DIV_UP(memory, 4096) * 4; /* Scale from kilobytes to megabytes */
 
     if (esxVI_ReconfigVM_Task(priv->primary, virtualMachine->obj, spec,
                               &task) < 0 ||