mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
conf: Parse and format 'backingStore' for disk <mirror>
When the block copy operation is started with a reused external file in incremental mode libvirt will need to open and insert the backing chain for that file into qemu (in -blockdev mode). This means that we'll need to track the backing chain and metadata such as node names for the full chain of <mirror>. This patch invokes the full backing chain formatter and parser for <mirror> so that the chain can be kept with <mirror>. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
944d09fa3e
commit
4e797f1af9
@ -5676,6 +5676,7 @@
|
|||||||
</choice>
|
</choice>
|
||||||
</attribute>
|
</attribute>
|
||||||
</optional>
|
</optional>
|
||||||
|
<ref name="diskBackingChain"/>
|
||||||
</element>
|
</element>
|
||||||
</define>
|
</define>
|
||||||
<define name="diskAuth">
|
<define name="diskAuth">
|
||||||
|
@ -9349,6 +9349,8 @@ virDomainDiskDefMirrorParse(virDomainDiskDefPtr def,
|
|||||||
if (virDomainStorageSourceParse(mirrorNode, ctxt, def->mirror, flags,
|
if (virDomainStorageSourceParse(mirrorNode, ctxt, def->mirror, flags,
|
||||||
xmlopt) < 0)
|
xmlopt) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
if (virDomainDiskBackingStoreParse(ctxt, def->mirror, flags, xmlopt) < 0)
|
||||||
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
/* For back-compat reasons, we handle a file name encoded as
|
/* For back-compat reasons, we handle a file name encoded as
|
||||||
* attributes, even though we prefer modern output in the style of
|
* attributes, even though we prefer modern output in the style of
|
||||||
@ -24031,6 +24033,9 @@ virDomainDiskDefFormatMirror(virBufferPtr buf,
|
|||||||
if (virDomainDiskSourceFormat(&childBuf, disk->mirror, 0, false, flags, xmlopt) < 0)
|
if (virDomainDiskSourceFormat(&childBuf, disk->mirror, 0, false, flags, xmlopt) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (virDomainDiskBackingStoreFormat(&childBuf, disk->mirror, xmlopt, flags) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (virXMLFormatElement(buf, "mirror", &attrBuf, &childBuf) < 0)
|
if (virXMLFormatElement(buf, "mirror", &attrBuf, &childBuf) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@
|
|||||||
<mirror type='file' file='/tmp/copy.img' format='qcow2' job='copy'>
|
<mirror type='file' file='/tmp/copy.img' format='qcow2' job='copy'>
|
||||||
<format type='qcow2'/>
|
<format type='qcow2'/>
|
||||||
<source file='/tmp/copy.img'/>
|
<source file='/tmp/copy.img'/>
|
||||||
|
<backingStore/>
|
||||||
</mirror>
|
</mirror>
|
||||||
<target dev='vda' bus='virtio'/>
|
<target dev='vda' bus='virtio'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||||
@ -76,6 +77,18 @@
|
|||||||
<mirror type='file' file='/tmp/logcopy.img' format='qcow2' job='copy' ready='abort'>
|
<mirror type='file' file='/tmp/logcopy.img' format='qcow2' job='copy' ready='abort'>
|
||||||
<format type='qcow2'/>
|
<format type='qcow2'/>
|
||||||
<source file='/tmp/logcopy.img'/>
|
<source file='/tmp/logcopy.img'/>
|
||||||
|
<backingStore type='block' index='1'>
|
||||||
|
<format type='raw'/>
|
||||||
|
<source dev='/dev/HostVG/backing'>
|
||||||
|
<privateData>
|
||||||
|
<nodenames>
|
||||||
|
<nodename type='storage' name='test-backing-storage'/>
|
||||||
|
<nodename type='format' name='test-backing-format'/>
|
||||||
|
</nodenames>
|
||||||
|
</privateData>
|
||||||
|
</source>
|
||||||
|
<backingStore/>
|
||||||
|
</backingStore>
|
||||||
</mirror>
|
</mirror>
|
||||||
<target dev='vdb' bus='virtio'/>
|
<target dev='vdb' bus='virtio'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
<mirror type='file' file='/tmp/copy.img' format='qcow2' job='copy'>
|
<mirror type='file' file='/tmp/copy.img' format='qcow2' job='copy'>
|
||||||
<format type='qcow2'/>
|
<format type='qcow2'/>
|
||||||
<source file='/tmp/copy.img'/>
|
<source file='/tmp/copy.img'/>
|
||||||
|
<backingStore/>
|
||||||
</mirror>
|
</mirror>
|
||||||
<target dev='vda' bus='virtio'/>
|
<target dev='vda' bus='virtio'/>
|
||||||
</disk>
|
</disk>
|
||||||
@ -45,6 +46,11 @@
|
|||||||
<mirror type='file' file='/tmp/logcopy.img' format='qcow2' job='copy' ready='abort'>
|
<mirror type='file' file='/tmp/logcopy.img' format='qcow2' job='copy' ready='abort'>
|
||||||
<format type='qcow2'/>
|
<format type='qcow2'/>
|
||||||
<source file='/tmp/logcopy.img'/>
|
<source file='/tmp/logcopy.img'/>
|
||||||
|
<backingStore type='block' index='1'>
|
||||||
|
<format type='raw'/>
|
||||||
|
<source dev='/dev/HostVG/backing'/>
|
||||||
|
<backingStore/>
|
||||||
|
</backingStore>
|
||||||
</mirror>
|
</mirror>
|
||||||
<target dev='vdb' bus='virtio'/>
|
<target dev='vdb' bus='virtio'/>
|
||||||
</disk>
|
</disk>
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
<mirror type='file' file='/tmp/copy.img' format='qcow2' job='copy'>
|
<mirror type='file' file='/tmp/copy.img' format='qcow2' job='copy'>
|
||||||
<format type='qcow2'/>
|
<format type='qcow2'/>
|
||||||
<source file='/tmp/copy.img'/>
|
<source file='/tmp/copy.img'/>
|
||||||
|
<backingStore/>
|
||||||
</mirror>
|
</mirror>
|
||||||
<target dev='vda' bus='virtio'/>
|
<target dev='vda' bus='virtio'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||||
@ -51,6 +52,11 @@
|
|||||||
<mirror type='file' file='/tmp/logcopy.img' format='qcow2' job='copy' ready='abort'>
|
<mirror type='file' file='/tmp/logcopy.img' format='qcow2' job='copy' ready='abort'>
|
||||||
<format type='qcow2'/>
|
<format type='qcow2'/>
|
||||||
<source file='/tmp/logcopy.img'/>
|
<source file='/tmp/logcopy.img'/>
|
||||||
|
<backingStore type='block' index='1'>
|
||||||
|
<format type='raw'/>
|
||||||
|
<source dev='/dev/HostVG/backing'/>
|
||||||
|
<backingStore/>
|
||||||
|
</backingStore>
|
||||||
</mirror>
|
</mirror>
|
||||||
<target dev='vdb' bus='virtio'/>
|
<target dev='vdb' bus='virtio'/>
|
||||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
||||||
|
Loading…
Reference in New Issue
Block a user