----- Original Message ----- > From: "Stefan Hajnoczi" <stefa...@gmail.com> > To: "Federico Simoncelli" <fsimo...@redhat.com> > Cc: qemu-devel@nongnu.org, kw...@redhat.com, mtosa...@redhat.com > Sent: Tuesday, February 28, 2012 4:47:48 PM > Subject: Re: [Qemu-devel] Live Block Migration using Mirroring > > On Wed, Feb 22, 2012 at 5:13 PM, Federico Simoncelli > <fsimo...@redhat.com> wrote: > > Step 3 - Mirrored Live Snapshot > > =============================== > > A mirrored live snapshot is issued using src/hd0snap1 and > > dst/hd0snap1 as > > image files. (Where "<-" stands for "has backing file") > > > > [src/hd0base] <- [src/hd0snap1] <= VM1(read-write) > > ... <- [dst/hd0snap1] <= VM1(write-only) > > > > $ qemu-img create -f qcow2 \ > > -b /tmp/src/hd0base.qcow2 /tmp/src/hd0snap1.qcow2 20G > > Formatting '/tmp/src/hd0snap1.qcow2', fmt=qcow2 size=21474836480 > > backing_file='/tmp/src/hd0base.qcow2' encryption=off > > cluster_size=65536 > > > > $ qemu-img create -f qcow2 \ > > -b /tmp/dst/hd0base.qcow2 /tmp/dst/hd0snap1.qcow2 20G > > Formatting '/tmp/dst/hd0snap1.qcow2', fmt=qcow2 size=21474836480 > > backing_file='/tmp/src/hd0base.qcow2' encryption=off > > cluster_size=65536 > > > > (qemu) snapshot_blkdev -n ide0-hd0 \ > > blkmirror:/tmp/src/hd0snap1.qcow2:/tmp/dst/hd0snap1.qcow2 > > blkmirror > > > > Step 4 - Backing File Copy > > ========================== > > An external manager copies src/hd0base to the destination > > dst/hd0base. > > > > [src/hd0base] <- [src/hd0snap1] <= VM1(read-write) > > [dst/hd0base] <- [dst/hd0snap1] <= VM1(write-only) > > At this stage we have dst/hd0snap1 opened with BDRV_O_NO_BACKING. If > it has no backing file and the guest issues a write request that is > smaller than a cluster in the image file, the untouched areas of that > cluster will be populated with zeroes. > > Once dst/hd0snap1 is reopened with dst/hd0base in place there will be > zeros in clusters where the guest wrote only a few sectors. We will > not "see" the backing file data in those clusters. > > Have you hit this problem or did I miss something?
Thank you for getting this. Being able to have a bogus backing file was a bonus but it's not really required for the mirrored live block migration. We can add the support for switching the backing file in the drive-reopen part. I'll remove the BDRV_O_NO_BACKING flag from the blkmirror patch. -- Federico