[libvirt] [PATCH] esx: Ensure max-memory has 4 megabyte granularity

--- src/esx/esx_driver.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 61c2371..c66df0e 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 || -- 1.7.0.4

On 01/28/2011 02:16 PM, Matthias Bolte wrote:
--- src/esx/esx_driver.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 61c2371..c66df0e 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 */
ACK (but obviously depends on your other patch, which I'm still reviewing) -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

2011/1/28 Eric Blake <eblake@redhat.com>:
On 01/28/2011 02:16 PM, Matthias Bolte wrote:
--- src/esx/esx_driver.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 61c2371..c66df0e 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 */
ACK (but obviously depends on your other patch, which I'm still reviewing)
Thanks, pushed. Matthias
participants (2)
-
Eric Blake
-
Matthias Bolte