From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2QeY-0006TF-KI for qemu-devel@nongnu.org; Tue, 28 Feb 2012 12:16:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2QeS-0003Xs-1n for qemu-devel@nongnu.org; Tue, 28 Feb 2012 12:15:54 -0500 Received: from mx3-phx2.redhat.com ([209.132.183.24]:55683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2QeR-0003XT-PX for qemu-devel@nongnu.org; Tue, 28 Feb 2012 12:15:47 -0500 Date: Tue, 28 Feb 2012 12:15:44 -0500 (EST) From: Federico Simoncelli Message-ID: <742706ce-ecdf-4e5c-81e1-cbae223812c5@zmail16.collab.prod.int.phx2.redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [Qemu-devel] Live Block Migration using Mirroring List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, Paolo Bonzini , mtosatti@redhat.com, qemu-devel@nongnu.org ----- Original Message ----- > From: "Stefan Hajnoczi" > To: "Federico Simoncelli" > Cc: qemu-devel@nongnu.org, kwolf@redhat.com, mtosatti@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 > wrote: > > Step 3 - Mirrored Live Snapshot > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D > > 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] <=3D VM1(read-write) > > =C2=A0 =C2=A0 ... =C2=A0 =C2=A0 =C2=A0<- [dst/hd0snap1] <=3D VM1(write-= only) > > > > $ qemu-img create -f qcow2 \ > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -b /tmp/src/hd0base.qcow2 /tmp/src/h= d0snap1.qcow2 20G > > Formatting '/tmp/src/hd0snap1.qcow2', fmt=3Dqcow2 size=3D21474836480 > > backing_file=3D'/tmp/src/hd0base.qcow2' encryption=3Doff > > cluster_size=3D65536 > > > > $ qemu-img create -f qcow2 \ > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -b /tmp/dst/hd0base.qcow2 /tmp/dst/h= d0snap1.qcow2 20G > > Formatting '/tmp/dst/hd0snap1.qcow2', fmt=3Dqcow2 size=3D21474836480 > > backing_file=3D'/tmp/src/hd0base.qcow2' encryption=3Doff > > cluster_size=3D65536 > > > > (qemu) snapshot_blkdev -n ide0-hd0 \ > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 blkmirror:/tmp/src/hd0snap1.qcow2:/tmp/dst/= hd0snap1.qcow2 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 blkmirror > > > > Step 4 - Backing File Copy > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > > An external manager copies src/hd0base to the destination > > dst/hd0base. > > > > [src/hd0base] <- [src/hd0snap1] <=3D VM1(read-write) > > [dst/hd0base] <- [dst/hd0snap1] <=3D 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