]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuxml2xmltest: Add case for host-model vendor_id
authorJiri Denemark <jdenemar@redhat.com>
Wed, 19 Feb 2020 12:10:27 +0000 (13:10 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 19 Feb 2020 14:11:40 +0000 (15:11 +0100)
This patch shows a bug in our code: the

    <model vendor_id="Libvirt QEMU"/>

element present in the source XML is lost when the parsed CPU definition
is formatted back to XML.

https://bugzilla.redhat.com/show_bug.cgi?id=1804549

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuxml2xmloutdata/cpu-host-model-vendor.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c

diff --git a/tests/qemuxml2xmloutdata/cpu-host-model-vendor.xml b/tests/qemuxml2xmloutdata/cpu-host-model-vendor.xml
new file mode 100644 (file)
index 0000000..d2447cc
--- /dev/null
@@ -0,0 +1,28 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219100</memory>
+  <currentMemory unit='KiB'>219100</currentMemory>
+  <vcpu placement='static'>6</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+    <boot dev='network'/>
+  </os>
+  <cpu mode='host-model' check='partial'/>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='usb' index='0'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='virtio'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </memballoon>
+  </devices>
+</domain>
index 98d9ae424255e64f73a0ab87a0fd7be42b394b26..daf9b53ce8626239ee0b38a8964f3f1e90638027 100644 (file)
@@ -266,6 +266,7 @@ mymain(void)
     DO_TEST("cpu-host-kvmclock", NONE);
     DO_TEST("cpu-host-passthrough-features", NONE);
     DO_TEST("cpu-host-model-features", NONE);
+    DO_TEST("cpu-host-model-vendor", NONE);
     DO_TEST("clock-catchup", QEMU_CAPS_KVM_PIT_TICK_POLICY);
     DO_TEST("kvmclock", NONE);
     DO_TEST("clock-timer-hyperv-rtc", NONE);