]> xenbits.xensource.com Git - libvirt.git/commit
qemu_command: Generate memory only after controllers
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 27 Jan 2022 10:13:53 +0000 (11:13 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 2 Feb 2022 13:22:47 +0000 (14:22 +0100)
commitaf23241cfed712f69450e82135d7c7b4899736de
tree931c3874caddfb11e64b9d72cef928b3345b8cc1
parent4b43da0bff9b78dcf1189388d4c89e524238b41d
qemu_command: Generate memory only after controllers

Currently, memory device (def->mems) part of cmd line is
generated before any controller. In majority of cases it doesn't
matter because neither of memory devices live on a bus that's
created by an exposed controller (e.g. there's no DIMM
controller, at least not exposed). Except for virtio-mem and
virtio-pmem, which do have a PCI address. And if it so happens
that the device goes onto non-default bus (pci.0) starting such
guest fails, because the controller that creates the desired bus
wasn't processed yet. QEMU processes arguments in order.

For instance, if virtio-mem has address with bus='0x01' QEMU
refuses to start with the following message:

  Bus 'pci.1' not found

Similarly for virtio-pmem. I've successfully tested migration and
changing the order does not affect migration stream.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2047271
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
26 files changed:
src/qemu/qemu_command.c
tests/qemuxml2argvdata/hugepages-memaccess.args
tests/qemuxml2argvdata/hugepages-memaccess2.args
tests/qemuxml2argvdata/hugepages-numa-default-dimm.args
tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args
tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
tests/qemuxml2argvdata/memory-hotplug-dimm-addr.args
tests/qemuxml2argvdata/memory-hotplug-dimm.args
tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args
tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-5.2.0.args
tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args
tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-5.2.0.args
tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args
tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-5.2.0.args
tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64-abi-update.args
tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.args
tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-5.2.0.args
tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args
tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args
tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma-abi-update.args
tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma.args
tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-5.2.0.args
tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-latest.args
tests/qemuxml2argvdata/pages-dimm-discard.args