qemu: domain: Fix backing store terminator for non-backing local files

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 a693fdba01 which was not detected in the review.

This patch also reverts all the changes in the test files.
This commit is contained in:
Peter Krempa 2017-11-24 12:59:59 +01:00
parent 24e47ee2b9
commit adcc31bb89
11 changed files with 16 additions and 0 deletions

View 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;
}

View 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/>

View 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/>

View 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/>

View 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/>

View 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/>

View 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/>

View 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/>

View 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/>

View 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/>

View 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/>