From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4VbG-0004Y3-2p for qemu-devel@nongnu.org; Wed, 09 Nov 2016 11:19:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4VbF-0005Az-7i for qemu-devel@nongnu.org; Wed, 09 Nov 2016 11:19:46 -0500 Date: Wed, 9 Nov 2016 11:19:37 -0500 From: Jeff Cody Message-ID: <20161109161937.GC6315@localhost.localdomain> References: <1478587839-9834-1-git-send-email-jsnow@redhat.com> <1478587839-9834-6-git-send-email-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1478587839-9834-6-git-send-email-jsnow@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 5/6] blockjob: refactor backup_start as backup_job_create List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: qemu-block@nongnu.org, kwolf@redhat.com, vsementsov@virtuozzo.com, stefanha@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org On Tue, Nov 08, 2016 at 01:50:38AM -0500, John Snow wrote: > Refactor backup_start as backup_job_create, which only creates the job, > but does not automatically start it. The old interface, 'backup_start', > is not kept in favor of limiting the number of nearly-identical interfaces > that would have to be edited to keep up with QAPI changes in the future. > > Callers that wish to synchronously start the backup_block_job can > instead just call block_job_start immediately after calling > backup_job_create. > > Transactions are updated to use the new interface, calling block_job_start > only during the .commit phase, which helps prevent race conditions where > jobs may finish before we even finish building the transaction. This may > happen, for instance, during empty block backup jobs. > > Reported-by: Vladimir Sementsov-Ogievskiy > Signed-off-by: John Snow > --- > block/backup.c | 26 ++++++++------- > block/replication.c | 12 ++++--- > blockdev.c | 81 ++++++++++++++++++++++++++++++----------------- > include/block/block_int.h | 23 +++++++------- > 4 files changed, 85 insertions(+), 57 deletions(-) Reviewed-by: Jeff Cody