From: Matthias Bolte Date: Fri, 28 Jan 2011 20:19:59 +0000 (+0100) Subject: esx: Ensure max-memory has 4 megabyte granularity X-Git-Tag: v0.8.8~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f4999b477b9a390892eeaac7a54ee67ee9854c5;p=thirdparty%2Flibvirt.git esx: Ensure max-memory has 4 megabyte granularity --- diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 61c23719d3..c66df0e385 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -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 ||