]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: domain: Fix backing store terminator for non-backing local files
authorPeter Krempa <pkrempa@redhat.com>
Fri, 24 Nov 2017 11:59:59 +0000 (12:59 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 30 Nov 2017 21:40:23 +0000 (22:40 +0100)
Raw local files do not pass through the backing store detector and thus
the code did not allocate the required backing store terminator for
them. Previously the terminating element would be formatted into the XML
since the default values used for the metadata allowed that. This is a
regression since a693fdba0111ff which was not detected in the review.

This patch also reverts all the changes in the test files.

src/qemu/qemu_domain.c
tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml
tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml
tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml
tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml
tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml
tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi-wwn+disk-scsi-duplicate-wwn.xml
tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-scsi.xml
tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-usb.xml
tests/qemuhotplugtestdomains/qemuhotplug-base-live+disk-virtio.xml
tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-controller-live+disk-scsi-2.xml

index 2dd02a3f69d90da59b0e53593e41a09e9b29ea02..e8e03134f5cec3d08fe76b90506898db7b844e8b 100644 (file)
@@ -6385,6 +6385,11 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
             goto cleanup;
         }
 
+        /* terminate the chain for such images as the code below would do */
+        if (!src->backingStore &&
+            VIR_ALLOC(src->backingStore) < 0)
+            goto cleanup;
+
         ret = 0;
         goto cleanup;
     }
index 0fa8d036b9bae41f2194737518319cdd2f437f7f..cd03d0e09b5131490cbc1d5813ff06a8efaba293 100644 (file)
@@ -22,6 +22,7 @@
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/dev/null'/>
+      <backingStore/>
       <target dev='vde' bus='virtio'/>
       <readonly/>
       <shareable/>
index 135427fff51944c275a7630c1d506ba663ad232a..7be75f977b8ee394684b7c41efa300f28f89fbe9 100644 (file)
@@ -22,6 +22,7 @@
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/dev/null'/>
+      <backingStore/>
       <target dev='hda' bus='virtio'/>
       <readonly/>
       <shareable/>
@@ -31,6 +32,7 @@
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/dev/null'/>
+      <backingStore/>
       <target dev='hdb' bus='virtio'/>
       <readonly/>
       <shareable/>
index e17c4e43b2d6e6f52961fa2fdd4d028df3e17630..a83f1b5d73ee6a7cbc5918f588eaf34fc33bef99 100644 (file)
@@ -22,6 +22,7 @@
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/dev/null'/>
+      <backingStore/>
       <target dev='hda' bus='virtio'/>
       <readonly/>
       <shareable/>
index 326d312fa99c0bd7e016ebda2b96b4c003165b22..3e902075195fbd2b5e4294fc3512b2dc48140477 100644 (file)
@@ -22,6 +22,7 @@
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/dev/null'/>
+      <backingStore/>
       <target dev='hda' bus='virtio'/>
       <readonly/>
       <shareable/>
index 326d312fa99c0bd7e016ebda2b96b4c003165b22..3e902075195fbd2b5e4294fc3512b2dc48140477 100644 (file)
@@ -22,6 +22,7 @@
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/dev/null'/>
+      <backingStore/>
       <target dev='hda' bus='virtio'/>
       <readonly/>
       <shareable/>
index 16caeb354249a499ba885a0416a5c9239aaf1bca..4c3ea3202bb0a424eeca1b899ebdd1141c834750 100644 (file)
@@ -33,6 +33,7 @@
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/dev/null'/>
+      <backingStore/>
       <target dev='sdg' bus='scsi'/>
       <readonly/>
       <shareable/>
index a6dbf0b1bd7175cb1a7fe6c65eb366d7a0edf501..493a615fd36083120aac5e3d2026d651775811b5 100644 (file)
@@ -22,6 +22,7 @@
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/dev/null'/>
+      <backingStore/>
       <target dev='sdf' bus='scsi'/>
       <readonly/>
       <shareable/>
index 6ccb88f1405bc61ffa7981c7dde0e2d066b70a52..3609819ea3e7829775ab005cecbad38b21288561 100644 (file)
@@ -22,6 +22,7 @@
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/dev/null'/>
+      <backingStore/>
       <target dev='sdq' bus='usb'/>
       <readonly/>
       <shareable/>
index b97c0b41e2afe7317d900f24165086cc507777c1..b88b220e33d296e7b45d40981694654777bd9ed9 100644 (file)
@@ -22,6 +22,7 @@
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/dev/null'/>
+      <backingStore/>
       <target dev='vde' bus='virtio'/>
       <readonly/>
       <shareable/>
index 6422e1640d3567f155553c5e7c57117f651aae92..c12d18f7162e6784d00e61d168705a676f4741dd 100644 (file)
@@ -22,6 +22,7 @@
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw' cache='none'/>
       <source file='/dev/null'/>
+      <backingStore/>
       <target dev='sdf' bus='scsi'/>
       <readonly/>
       <shareable/>