From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlJKR-00010k-Ty for qemu-devel@nongnu.org; Thu, 23 Apr 2015 11:46:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlJKR-00079f-3y for qemu-devel@nongnu.org; Thu, 23 Apr 2015 11:46:15 -0400 Message-ID: <553913BA.1010801@redhat.com> Date: Thu, 23 Apr 2015 17:46:02 +0200 From: Max Reitz MIME-Version: 1.0 References: <1429747493-24397-1-git-send-email-jsnow@redhat.com> <1429747493-24397-10-git-send-email-jsnow@redhat.com> In-Reply-To: <1429747493-24397-10-git-send-email-jsnow@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 09/10] block: drive_backup transaction callback support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-block@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, vsementsov@parallels.com, stefanha@redhat.com On 23.04.2015 02:04, John Snow wrote: > This patch actually implements the transactional callback system > for the drive_backup action. > > (1) We manually pick up a reference to the bitmap if present to allow > its cleanup to be delayed until after all drive_backup jobs launched > by the transaction have fully completed. > > (2) We create a functional closure that envelops the original drive_backup > callback, to be able to intercept the completion status and return code > for the job. > > (3) We add the drive_backup_cb method for the drive_backup action, which > unpacks the completion information and invokes the final cleanup. > > (4) backup_transaction_complete will perform the final cleanup on the > backup job. > > (5) In the case of transaction cancellation, drive_backup_cb is still > responsible for cleaning up the mess we may have already made. > > Signed-off-by: John Snow > --- > block/backup.c | 9 ++++++++ > blockdev.c | 53 ++++++++++++++++++++++++++++++++++++++++++++--- > include/block/block_int.h | 8 +++++++ > 3 files changed, 67 insertions(+), 3 deletions(-) Reviewed-by: Max Reitz