From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbiTr-000773-6U for qemu-devel@nongnu.org; Tue, 15 Sep 2015 01:08:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbiTl-00071x-1L for qemu-devel@nongnu.org; Tue, 15 Sep 2015 01:08:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbiTk-00071r-S0 for qemu-devel@nongnu.org; Tue, 15 Sep 2015 01:08:28 -0400 Date: Tue, 15 Sep 2015 13:08:24 +0800 From: Fam Zheng Message-ID: <20150915050824.GI14016@ad.nay.redhat.com> References: <1441611277-24596-1-git-send-email-famz@redhat.com> <1441611277-24596-12-git-send-email-famz@redhat.com> <55F34708.5000304@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55F34708.5000304@redhat.com> Subject: Re: [Qemu-devel] [PATCH v5 11/14] block/backup: support block job transactions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Kevin Wolf , Jeff Cody , qemu-devel@nongnu.org, Max Reitz , vsementsov@parallels.com, stefanha@redhat.com, John Snow On Fri, 09/11 15:26, Eric Blake wrote: > On 09/07/2015 01:34 AM, Fam Zheng wrote: > > From: Stefan Hajnoczi > > > > Join the transaction when the 'transactional-cancel' QMP argument is > > true. > > > > This ensures that the sync bitmap is not thrown away if another block > > job in the transaction is cancelled or fails. This is critical so > > incremental backup with multiple disks can be retried in case of > > cancellation/failure. > > > > Signed-off-by: Stefan Hajnoczi > > Signed-off-by: Fam Zheng > > --- > > Interface review: > > > +void qmp_blockdev_backup(const char *device, const char *target, > > + enum MirrorSyncMode sync, > > + bool has_speed, int64_t speed, > > + bool has_on_source_error, > > + BlockdevOnError on_source_error, > > + bool has_on_target_error, > > + BlockdevOnError on_target_error, > > + bool has_transactional_cancel, > > + bool transactional_cancel, > > + Error **errp) > > +{ > > + if (has_transactional_cancel && transactional_cancel) { > > + error_setg(errp, "Transactional cancel can only be used in the " > > + "'transaction' command"); > > + return; > > + } > > Hmm. It might be nicer if we had two separate qapi structs: > > # used in 'blockdev-backup' > { 'struct':'BlockdevBackup', 'data': { device ... on-target-error } } > > # used in 'transaction' > { 'struct':'BlockdevBackupTxn', 'base':'BlockdevBackup', > 'data': { 'transactional-cancel':'bool' } } > > so that the user can't abuse the boolean from the wrong context. Very good point, will do that in v6. Fam