]> xenbits.xensource.com Git - libvirt.git/commit
qemu: capabilities: Preserve location of the default machine type when stripping...
authorPeter Krempa <pkrempa@redhat.com>
Fri, 1 Sep 2023 19:43:22 +0000 (21:43 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 6 Sep 2023 12:09:42 +0000 (14:09 +0200)
commit748dc3b1d3542de2b084844133f23b3e4e2bc408
treebea8e657ddc0daa4c13018c2c19ad7fbcac16f14
parentb816b41a65d9ea3cbe118bc6779f534cdb9e917b
qemu: capabilities: Preserve location of the default machine type when stripping aliases for tests

Internally the preferred machine which is 'pc' for x86_64 must be kept
in the first place in the array of machines. This was not the case when
stripping the machine aliases for use in tests (so that test output
stays stable) where we've created a new entry for the alias. This means
that the original name (e.g. pc-i440fx-8.1) stayed in the first place.

To fix this we now swap the names around and create a new entry at the
end for the specific type. Additionally the default flag is not
propagated to the copy.

This is also visible now in the output of 'qemuxml2xmltest' as the test
cases which use the default machine type return to 'pc' instead of the
more specific name.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_capabilities.c
tests/qemuxml2xmloutdata/default-kvm-host-arch.x86_64-latest.xml
tests/qemuxml2xmloutdata/default-qemu-host-arch.x86_64-latest.xml