From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ucslz-0002fR-9E for qemu-devel@nongnu.org; Thu, 16 May 2013 03:38:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ucslv-0007D6-KF for qemu-devel@nongnu.org; Thu, 16 May 2013 03:38:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4862) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ucslv-0007CY-AY for qemu-devel@nongnu.org; Thu, 16 May 2013 03:38:43 -0400 Date: Thu, 16 May 2013 09:36:50 +0200 From: Stefan Hajnoczi Message-ID: <20130516073650.GD1597@stefanha-thinkpad.redhat.com> References: <1368628476-19622-1-git-send-email-stefanha@redhat.com> <1368628476-19622-7-git-send-email-stefanha@redhat.com> <5193DE56.9050006@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5193DE56.9050006@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 6/8] blockdev: add DriveBackup transaction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Kevin Wolf , Fam Zheng , qemu-devel@nongnu.org, dietmar@proxmox.com, imain@redhat.com, Paolo Bonzini , xiawenc@linux.vnet.ibm.com On Wed, May 15, 2013 at 01:13:26PM -0600, Eric Blake wrote: > On 05/15/2013 08:34 AM, Stefan Hajnoczi wrote: > > This patch adds a transactional version of the drive-backup QMP command. > > It allows atomic snapshots of multiple drives along with automatic > > cleanup if there is a failure to start one of the backup jobs. > > > > Note that QMP events are emitted for block job completion/cancellation > > and the block job will be listed by query-block-jobs. > > > > > + > > +static void drive_backup_abort(BlkTransactionState *common) > > +{ > > + DriveBackupState *state = DO_UPCAST(DriveBackupState, common, common); > > + BlockDriverState *bs = state->bs; > > + > > + /* Only cancel if it's the job we started */ > > + if (bs && bs->job && bs->job == state->job) { > > + block_job_cancel_sync(bs->job); > > + } > > Question - if starting the job created the target file, should aborting > the job unlink() that file so that we aren't polluting the file system? blockdev-snapshot-sync action does not delete the file on abort. > > +++ b/qapi-schema.json > > @@ -1609,6 +1609,27 @@ > > '*mode': 'NewImageMode' } } > > > > ## > > +# @DriveBackup > > +# > > +# @device: the name of the device whose writes should be mirrored. > > +# > > +# @target: the target of the new image. If the file exists, or if it > > +# is a device, the existing file/device will be used as the new > > +# destination. If it does not exist, a new file will be created. > > +# > > +# @format: #optional the format of the new destination, default is to > > +# probe if @mode is 'existing', else the format of the source > > +# > > +# @mode: #optional whether and how QEMU should create a new image, default is > > +# 'absolute-paths'. > > +# > > +# @speed: #optional the maximum speed, in bytes per second > > +## > > Mention "Since: 1.6" Will add in v4.