mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
esx: Ensure max-memory has 4 megabyte granularity
This commit is contained in:
parent
d9ad8ac392
commit
8f4999b477
@ -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 ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user