]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: domain: Insert auto-added controllers in same order as in XML parser
authorPeter Krempa <pkrempa@redhat.com>
Mon, 18 Dec 2023 17:32:57 +0000 (18:32 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 17 Jan 2024 16:31:12 +0000 (17:31 +0100)
commit4bc82cd7ebb4e983f8819cdf0ecfbe4d5c1d4c3d
tree0b22a310a06aec587190276f4f0ba2fc2e7f8f17
parent5fb20c990286d7b5b0401c121f0b9f125808a93b
conf: domain: Insert auto-added controllers in same order as in XML parser

'virDomainDefAddController' which is used in code-paths which auto-add
controllers to the definition such as 'virDomainDefMaybeAddController',
'virDomainDefAddUSBController', 'qemuDomainDefAddDefaultDevices' was
adding the controller at the end of the list. However that is not how
the XML parser would order the controller in the list as it uses
virDomainControllerInsert grouping them by type and additional
properties.

This would cause that auto-added controllers would re-order:
 - between first and any subsequent run of the VM (even on commandline)
 - after a libvirtd/virtqemud restart
 - after any update of the definition based on the 'define' operation
   (e.g. virsh edit)

To ensure that the ordering of controllers is identical always use
virDomainControllerInsert.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
65 files changed:
src/conf/domain_conf.c
tests/qemuxml2argvdata/channel-virtio-default.x86_64-latest.args
tests/qemuxml2argvdata/channel-virtio-unix.x86_64-latest.args
tests/qemuxml2argvdata/chardev-reconnect.x86_64-latest.args
tests/qemuxml2argvdata/pci-autoadd-idx.x86_64-latest.args
tests/qemuxml2argvdata/pseries-many-buses-2.ppc64-latest.args
tests/qemuxml2xmloutdata/aarch64-virt-graphics.aarch64-latest.xml
tests/qemuxml2xmloutdata/aarch64-virt-headless.aarch64-latest.xml
tests/qemuxml2xmloutdata/aarch64-virt-virtio.aarch64-4.2.0.xml
tests/qemuxml2xmloutdata/aarch64-virt-virtio.aarch64-latest.xml
tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-4.2.0.xml
tests/qemuxml2xmloutdata/aarch64-virtio-pci-default.aarch64-latest.xml
tests/qemuxml2xmloutdata/aarch64-virtio-pci-manual-addresses.aarch64-latest.xml
tests/qemuxml2xmloutdata/arm-virt-virtio.aarch64-latest.xml
tests/qemuxml2xmloutdata/channel-virtio-auto.x86_64-latest.xml
tests/qemuxml2xmloutdata/channel-virtio-autoadd.x86_64-latest.xml
tests/qemuxml2xmloutdata/channel-virtio-default.x86_64-latest.xml
tests/qemuxml2xmloutdata/channel-virtio-unix.x86_64-latest.xml
tests/qemuxml2xmloutdata/chardev-reconnect.x86_64-latest.xml
tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-4.2.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.0.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.1.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-5.2.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.0.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.1.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-6.2.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.0.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.1.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-7.2.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-8.0.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-8.1.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-kvm.x86_64-latest.xml
tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-4.2.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.0.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.1.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-5.2.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.0.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.1.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-6.2.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.0.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.1.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-7.2.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-8.0.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-8.1.0.xml
tests/qemuxml2xmloutdata/cpu-host-model-tcg.x86_64-latest.xml
tests/qemuxml2xmloutdata/disk-floppy-q35.x86_64-latest.xml
tests/qemuxml2xmloutdata/hostdev-scsi-autogen-address.x86_64-latest.xml
tests/qemuxml2xmloutdata/hvf-aarch64-virt-headless.aarch64-latest.xml
tests/qemuxml2xmloutdata/hvf-x86_64-q35-headless.x86_64-latest.xml
tests/qemuxml2xmloutdata/mach-virt-console-virtio.aarch64-latest.xml
tests/qemuxml2xmloutdata/net-isolated-port.x86_64-latest.xml
tests/qemuxml2xmloutdata/pci-autoadd-idx.x86_64-latest.xml
tests/qemuxml2xmloutdata/pcie-expander-bus.x86_64-latest.xml
tests/qemuxml2xmloutdata/pcie-root.x86_64-latest.xml
tests/qemuxml2xmloutdata/pcie-switch-upstream-port.x86_64-latest.xml
tests/qemuxml2xmloutdata/pcihole64-q35.x86_64-latest.xml
tests/qemuxml2xmloutdata/pseries-many-buses-2.ppc64-latest.xml
tests/qemuxml2xmloutdata/pseries-phb-default-missing.ppc64-latest.xml
tests/qemuxml2xmloutdata/q35.x86_64-latest.xml
tests/qemuxml2xmloutdata/riscv64-virt-graphics.riscv64-latest.xml
tests/qemuxml2xmloutdata/riscv64-virt-headless.riscv64-latest.xml
tests/qemuxml2xmloutdata/user-aliases2.x86_64-latest.xml
tests/qemuxml2xmloutdata/watchdog-q35-multiple.x86_64-latest.xml
tests/qemuxml2xmloutdata/x86_64-q35-graphics.x86_64-latest.xml
tests/qemuxml2xmloutdata/x86_64-q35-headless.x86_64-latest.xml