提交 389634e6 编写于 作者: P Peter Krempa

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.
上级 812a9e5e
......@@ -2308,6 +2308,16 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
/* Help clang 2.8 decipher the logic flow. */
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;
if (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.
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
(blocks of 1024 bytes) unless you provide a suffix (and the older option
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册