From: Michal Privoznik Date: Mon, 25 May 2020 12:35:40 +0000 (+0200) Subject: qemuBuildMemoryBackendProps: Respect //memoryBacking/allocation/@mode=immediate X-Git-Tag: v6.9.0-rc1~454 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0217c5a6b4221f5488dad063d92db644d105e24d;p=thirdparty%2Flibvirt.git qemuBuildMemoryBackendProps: Respect //memoryBacking/allocation/@mode=immediate If user specifies immediate memory allocation in the domain XML, they want QEMU to fully allocate its memory. And if the memory was allocated using plain '-m' then we would honour it. But, if a memory backend is used, then we don't set the prealloc attribute of the backend. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko Reviewed-by: Daniel Henrique Barboza --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 519a393541..5c914b3999 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3028,6 +3028,9 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps, if (discard == VIR_TRISTATE_BOOL_ABSENT) discard = def->mem.discard; + if (def->mem.allocation == VIR_DOMAIN_MEMORY_ALLOCATION_IMMEDIATE) + prealloc = true; + if (virDomainNumatuneGetMode(def->numa, mem->targetNode, &mode) < 0 && virDomainNumatuneGetMode(def->numa, -1, &mode) < 0) mode = VIR_DOMAIN_NUMATUNE_MEM_STRICT;