
On 07/03/2014 03:12 AM, Kashyap Chamarthy wrote:
Versions --------
(Libvirt locally built from a recent git commit -ec7b922):
$ rpm -q libvirt-daemon-kvm qemu-system-x86 libvirt-daemon-kvm-1.2.6-1.fc20.x86_64 qemu-system-x86-2.0.0-1.fc21.x86_64
Test ----
[All images are qcow2 files.]
We have this simple chain:
base <- snap1
Let's quickly examine the contents of 'base' and 'snap1' images:
'base' has just a single file: foo
$ guestfish --ro -a base.qcow2 [. . .] ><fs> ls / ><fs> run ><fs> mount /dev/sda1 / ><fs> ls / foo lost+found ><fs> quit
'snap1' has files: bar, baz, jazz
$ guestfish --ro -a snap1.qcow2 [. . .] ><fs> run ><fs> mount /dev/sda1 / ><fs> ls / bar baz jazz lost+found ><fs>
Now, let's do a live blockcopy (with a '--finish' to graecully finish the mirroring):
$ virsh blockcopy --domain testvm2 vda \ /export/dst/copy.qcow2 \ --wait --verbose --finish
Examine the contents of the above 'copy':
$ guestfish --ro -a copy.qcow2 [. . .] ><fs> run ><fs> mount /dev/sda1 / ><fs> ls / bar baz jazz lost+found ><fs> quit
If I'm reading the man page of 'blockcopy' correctly, shouldn't it 'flatten' the entire chain, by also copying the contents of base into copy.qcow2? i.e. the 'copy' should have files (including the file foo from 'base':
foo, bar, baz, jazz I do test on my fedora20 with libvirt build from libvirt.git
# cd libvirt && git describe v1.2.6-9-g5098f67 # rpm -q qemu-kvm qemu-kvm-2.0.0-7.fc20.x86_64 It work well for me. I can see the file 'foo'(from base.qcow2) in copy file "copy.qcow2" I also boot guest with image copy.qcow2, login guest and found file "foo" is existing.
True or false?
PS: I've tested the cases of --pivot, --shallow and --reuse-external, will post my notes about them on a wiki.
-- Regards shyu