]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_command: Generate -mem-prealloc in one corner case more
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Sep 2021 13:59:59 +0000 (15:59 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 22 Nov 2021 11:27:29 +0000 (12:27 +0100)
commit3010a69226fa9ef23c3ca45aa52eeb755fa4a2be
tree0e8ae2fc99068af0750aa106abd647b111cbd667
parent3f390db2e2ed33cda8e5b18485a2efa3363155ec
qemu_command: Generate -mem-prealloc in one corner case more

When guest has NUMA nodes and QEMU is new enough to report
default RAM ID then ideally we would use -numa memdev= combined
with memory-backend-* combo becasue -mem-path/-mem-prealloc/-numa
mem are deprecated. Well, there is one problem - the .memdev=
attribute is machine type dependent (just look at arguments of
virQEMUCapsGetMachineNumaMemSupported()) and to ensure backwards
compatibility we prefer -numa mem= over -numa memdev=.

But there was one corner case when -mem-prealloc was requested
but not generated on the cmd line. It all starts with
qemuBuildMemCommandLine() which generates just '-m XXX' and
because it sees defaultRAMid and guest NUMA nodes greater than
zero it does nothing more.

Then, qemuBuildNumaCommandLine() sees that -numa mem= is still
supported for given machine type and nothing else set
@needBackend thus qemuBuildMemPathStr() is called which output
-mem-prealloc only in a few cases assuming it was outputted
earlier.

Reported-by: Jing Qi <jinqi@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/fd-memory-numa-topology.args
tests/qemuxml2argvdata/fd-memory-numa-topology2.args
tests/qemuxml2argvdata/fd-memory-numa-topology3.args
tests/qemuxml2argvdata/fd-memory-numa-topology4.x86_64-latest.args