
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