Received: from eggs.gnu.org ([2001:4830:134:3::10]:57152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqwrR-0001hx-Mv for qemu-devel@nongnu.org; Wed, 11 Dec 2013 22:22:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqwrL-0005DY-ND for qemu-devel@nongnu.org; Wed, 11 Dec 2013 22:22:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqwrL-0005DS-Ez for qemu-devel@nongnu.org; Wed, 11 Dec 2013 22:22:43 -0500 Date: Wed, 11 Dec 2013 19:22:33 -0800 From: Ian Main Message-ID: <20131212032232.GA1353@gate.mains.priv> References: <1385627982-14675-1-git-send-email-famz@redhat.com> <52A7D219.1070703@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <52A7D219.1070703@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v6 00/10] Drop in_use from BlockDriverState and enable point-in-time snapshot exporting over NBD List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, pbonzini@redhat.com, =?iso-8859-1?Q?Beno=EEt?= Canet , qemu-devel@nongnu.org, stefanha@redhat.com On Wed, Dec 11, 2013 at 10:46:49AM +0800, Fam Zheng wrote: > On 2013=E5=B9=B411=E6=9C=8828=E6=97=A5 16:39, Fam Zheng wrote: > >This series adds for point-in-time snapshot NBD exporting based on > >blockdev-backup (variant of drive-backup with existing device as targe= t). > > > >We get a thin point-in-time snapshot by COW mechanism of drive-backup,= and > >export it through built in NBD server. The steps are as below: > > > > 1. (SHELL) qemu-img create -f qcow2 BACKUP.qcow2 > > > > (Alternatively we can use -o backing_file=3DRUNNING-VM.img to omi= t explicitly > > providing the size by ourselves, but it's risky because RUNNING-V= M.qcow2 is > > used r/w by guest. Whether or not setting backing file in the ima= ge file > > doesn't matter, as we are going to override the backing hd in the= next > > step) > > > > 2. (QMP) blockdev-add backing=3Dsource-drive file.driver=3Dfile file= .filename=3DBACKUP.qcow2 id=3Dtarget0 if=3Dnone driver=3Dqcow2 > > > > (where ide0-hd0 is the running BlockDriverState name for > > RUNNING-VM.img. This patch implements "backing=3D" option to over= ride > > backing_hd for added drive) > > > > 3. (QMP) blockdev-backup device=3Dsource-drive sync=3Dnone target=3D= target0 > > > > (this is the QMP command introduced by this series, which use a n= amed > > device as target of drive-backup) > > > > 4. (QMP) nbd-server-add device=3Dtarget0 > > > >When image fleecing done: > > > > 1. (QMP) block-job-complete device=3Dide0-hd0 > > > > 2. (HMP) drive_del target0 > > > > 3. (SHELL) rm BACKUP.qcow2 > > > >v6: Address Paolo's comments, (except for bitmask): > > - Add blocker for all backing_hd references, a relatively big cha= nge, some > > patches are reordered. > > - Introduce a few other necessary patches. > > - Move two snapshot checks into bdrv_snapshot_*. > > > > The interface is unchanged. > > >=20 > Hi, >=20 > Based on the size of change, this series needs some more review > before merging. And I'd like to know if there is any concern or > objection with op_blocker introduced here. I would like to base my > next series (incremental backup with dirty bitmap) on it. >=20 > Any more reviews/comments? I really like it. Just did some more testing and this seems to have solved the issues from before.. I suspect this will resolve some issues with other commands and will be a useful framework for the future. I love this: (qemu) drive_del target0 block device is in use by block job: backup (qemu) drive_del target1 block device is in use by block job: backup (qemu) drive_del ide0-hd0 device is used as backing hd of 'target0' $ python qmp --path=3D/home/imain/qmp-sock eject --device=3Dtarget0 Exception: block device is in use by block job: backup I've started working on a backup/snapshot API for libvirt already. Ian