[libvirt] [PATCH] qemu: blockCopy: Allow shallow block copy into a raw image

Eric Blake eblake at redhat.com
Wed Apr 29 02:40:23 UTC 2015


On 04/27/2015 10:08 PM, Shanzhi Yu wrote:
>>> Should libvirt post error when try a shallow blockcopy of file without
>>> backing file, just as shallow blockcommit?
>> I cannot reproduce the error above, could you please post steps to do
>> that? or perhaps debug log from libvirt?
> 
> It is easy to reproduce. Suppose live guest xml looks like:
> 
> # virsh dumpxml vm1|grep disk -A 8
>     <disk type='file' device='disk'>
>       <driver name='qemu' type='qcow2'/>
>       <source file='/var/lib/libvirt/images/raw.1430143276'/>
>       <backingStore type='file' index='1'>
>         <format type='raw'/>
>         <source file='/var/lib/libvirt/images/raw.img'/>
>         <backingStore/>
>       </backingStore>
>       <target dev='vda' bus='virtio'/>
>       <alias name='virtio-disk0'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
> function='0x0'/>
>     </disk>
> 
> Then try a shallow blockcommit of file has no backing file
> 

> But a shallow block copy of file which has backing file into a raw  file
> does not make any sense, right?

A shallow block copy of:

A <- B

into a pre-existing file C, where C starts life with contents identical
to A, makes sense.

A shallow block copy where _libvirt_ creates C does not make sense.  The
key is that the moment you use the REUSE_EXTERNAL flag, _you_ are now
responsible for providing a valid destination (and anything is
supported; libvirt should not get in your way).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150428/4f5ed34d/attachment-0001.sig>


More information about the libvir-list mailing list