mirror of https://gitee.com/openkylin/libvirt.git
qemu: Forbid setting maximum memory size with the API with NUMA enabled
NUMA enabled guest configuration explicitly specifies memory sizes for individual nodes. Allowing the virDomainSetMemoryFlags API (and friends) to change the total doesn't make sense as the individual node configs are not updated in that case. Forbid use of the API in case NUMA is specified.
This commit is contained in:
parent
812a9e5e66
commit
389634e667
|
@ -2308,6 +2308,16 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
||||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||||
/* Help clang 2.8 decipher the logic flow. */
|
/* Help clang 2.8 decipher the logic flow. */
|
||||||
sa_assert(persistentDef);
|
sa_assert(persistentDef);
|
||||||
|
|
||||||
|
/* resizing memory with NUMA nodes specified doesn't work as there
|
||||||
|
* is no way to change the individual node sizes with this API */
|
||||||
|
if (virDomainNumaGetNodeCount(persistentDef->numa) > 0) {
|
||||||
|
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||||
|
_("maximum memory size of a domain with NUMA "
|
||||||
|
"nodes cannot be modified with this API"));
|
||||||
|
goto endjob;
|
||||||
|
}
|
||||||
|
|
||||||
persistentDef->mem.max_balloon = newmem;
|
persistentDef->mem.max_balloon = newmem;
|
||||||
if (persistentDef->mem.cur_balloon > newmem)
|
if (persistentDef->mem.cur_balloon > newmem)
|
||||||
persistentDef->mem.cur_balloon = newmem;
|
persistentDef->mem.cur_balloon = newmem;
|
||||||
|
|
|
@ -1938,7 +1938,10 @@ exclusive. If no flag is specified, behavior is different depending
|
||||||
on hypervisor.
|
on hypervisor.
|
||||||
|
|
||||||
Some hypervisors such as QEMU/KVM don't support live changes (especially
|
Some hypervisors such as QEMU/KVM don't support live changes (especially
|
||||||
increasing) of the maximum memory limit.
|
increasing) of the maximum memory limit. Even persistent configuration changes
|
||||||
|
might not be performed with some hypervisors/configuration (e.g. on NUMA enabled
|
||||||
|
domains on QEMU). For complex configuration changes use command B<edit>
|
||||||
|
instead).
|
||||||
|
|
||||||
I<size> is a scaled integer (see B<NOTES> above); it defaults to kibibytes
|
I<size> is a scaled integer (see B<NOTES> above); it defaults to kibibytes
|
||||||
(blocks of 1024 bytes) unless you provide a suffix (and the older option
|
(blocks of 1024 bytes) unless you provide a suffix (and the older option
|
||||||
|
|
Loading…
Reference in New Issue