]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Add qemuxml2argv and qemuxml2xml test for <transient shareBacking='yes'>
authorPeter Krempa <pkrempa@redhat.com>
Fri, 21 May 2021 12:13:50 +0000 (14:13 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 24 May 2021 18:38:08 +0000 (20:38 +0200)
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
tests/qemuxml2argvdata/disk-transient.x86_64-4.1.0.err
tests/qemuxml2argvdata/disk-transient.x86_64-latest.args
tests/qemuxml2argvdata/disk-transient.xml
tests/qemuxml2xmloutdata/disk-transient.x86_64-latest.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c

index eb5af4762dcbba8e798a1c97741c0fee4e15bc12..493da051e33cd45ff9da6273bd58712d4291bd65 100644 (file)
@@ -1 +1 @@
-unsupported configuration: transient disk not supported by this QEMU binary (hda)
+unsupported configuration: transient disk not supported by this QEMU binary (vda)
index 41f6400891abaa915bc95bc264c7e0a727992ed0..18f16c34899a21ec8378131d99d54b1902370ad0 100644 (file)
@@ -29,8 +29,8 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
 -blockdev '{"driver":"file","filename":"/tmp/QEMUGuest1.img","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1,write-cache=on \
+-device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,write-cache=on \
 -audiodev id=audio1,driver=none \
--device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
index cffb3253364b5d5059eaa085b7df1215302ed678..49613a88b2d8def0292858438864967cf2147a42 100644 (file)
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-i386</emulator>
+    <disk type='file' device='disk'>
+      <driver name='qemu' type='qcow2' cache='none'/>
+      <source file='/tmp/QEMUGuest2.img'/>
+      <target dev='vda' bus='virtio'/>
+      <transient shareBacking='yes'/>
+    </disk>
     <disk type='file' device='disk'>
       <driver name='qemu' type='qcow2' cache='none'/>
       <source file='/tmp/QEMUGuest1.img'/>
diff --git a/tests/qemuxml2xmloutdata/disk-transient.x86_64-latest.xml b/tests/qemuxml2xmloutdata/disk-transient.x86_64-latest.xml
new file mode 100644 (file)
index 0000000..9887060
--- /dev/null
@@ -0,0 +1,48 @@
+<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'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
+  </cpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-i386</emulator>
+    <disk type='file' device='disk'>
+      <driver name='qemu' type='qcow2' cache='none'/>
+      <source file='/tmp/QEMUGuest2.img'/>
+      <target dev='vda' bus='virtio'/>
+      <transient shareBacking='yes'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+    </disk>
+    <disk type='file' device='disk'>
+      <driver name='qemu' type='qcow2' cache='none'/>
+      <source file='/tmp/QEMUGuest1.img'/>
+      <target dev='hda' bus='ide'/>
+      <transient/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='usb' index='0' model='piix3-uhci'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+    </controller>
+    <controller type='ide' index='0'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <audio id='1' type='none'/>
+    <memballoon model='virtio'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </memballoon>
+  </devices>
+</domain>
index 058f6c26163c2849af1c16bf9800b80f76b48769..dd039bd846bd278c64be19e275999919f843b99a 100644 (file)
@@ -307,6 +307,7 @@ mymain(void)
     DO_TEST("disk-boot-disk", NONE);
     DO_TEST("disk-boot-cdrom", NONE);
     DO_TEST("disk-error-policy", NONE);
+    DO_TEST_CAPS_LATEST("disk-transient");
     DO_TEST("disk-fmt-qcow", NONE);
     DO_TEST_CAPS_VER("disk-cache", "2.12.0");
     DO_TEST_CAPS_LATEST("disk-cache");