From: Max Reitz <mreitz@redhat.com>
To: John Snow <jsnow@redhat.com>, qemu-block@nongnu.org
Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org,
vsementsov@parallels.com, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v6 05/10] block: add transactional callbacks feature
Date: Wed, 24 Jun 2015 17:54:57 +0200 [thread overview]
Message-ID: <558AD2D1.3020203@redhat.com> (raw)
In-Reply-To: <1433541188-13491-6-git-send-email-jsnow@redhat.com>
On 05.06.2015 23:53, John Snow wrote:
> The goal here is to add a new method to transactions that allows
> developers to specify a callback that will get invoked only once
> all jobs spawned by a transaction are completed, allowing developers
> the chance to perform actions conditionally pending complete success,
> partial failure, or complete failure.
>
> In order to register the new callback to be invoked, a user must request
> a callback pointer and closure by calling new_action_cb_wrapper, which
> creates a wrapper around an opaque pointer and callback that would have
> originally been passed to e.g. backup_start().
>
> The function will return a function pointer and a new opaque pointer to
> be passed instead. The transaction system will effectively intercept the
> original callbacks and perform book-keeping on the transaction after it
> has delivered the original enveloped callback.
>
> This means that Transaction Action callback methods will be called after
> all callbacks triggered by all Actions in the Transactional group have
> been received.
>
> This feature has no knowledge of any jobs spawned by Actions that do not
> inform the system via new_action_cb_wrapper().
>
> For an example of how to use the feature, please skip ahead to:
> 'block: drive_backup transaction callback support' which serves as an example
> for how to hook up a post-transaction callback to the Drive Backup action.
>
>
> Note 1: Defining a callback method alone is not sufficient to have the new
> method invoked. You must call new_action_cb_wrapper() AND ensure the
> callback it returns is the one used as the callback for the job
> launched by the action.
>
> Note 2: You can use this feature for any system that registers completions of
> an asynchronous task via a callback of the form
> (void *opaque, int ret), not just block job callbacks.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
> blockdev.c | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 177 insertions(+), 4 deletions(-)
Reviewed-by: Max Reitz <mreitz@redhat.com>
next prev parent reply other threads:[~2015-06-24 15:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-05 21:52 [Qemu-devel] [PATCH v6 00/10] block: incremental backup transactions John Snow
2015-06-05 21:52 ` [Qemu-devel] [PATCH v6 01/10] qapi: Add transaction support to block-dirty-bitmap operations John Snow
2015-06-05 21:53 ` [Qemu-devel] [PATCH v6 02/10] iotests: add transactional incremental backup test John Snow
2015-06-05 21:53 ` [Qemu-devel] [PATCH v6 03/10] block: rename BlkTransactionState and BdrvActionOps John Snow
2015-06-05 21:53 ` [Qemu-devel] [PATCH v6 04/10] block: re-add BlkTransactionState John Snow
2015-06-05 21:53 ` [Qemu-devel] [PATCH v6 05/10] block: add transactional callbacks feature John Snow
2015-06-24 15:54 ` Max Reitz [this message]
2015-06-05 21:53 ` [Qemu-devel] [PATCH v6 06/10] block: add delayed bitmap successor cleanup John Snow
2015-06-05 21:53 ` [Qemu-devel] [PATCH v6 07/10] qmp: Add an implementation wrapper for qmp_drive_backup John Snow
2015-06-05 21:53 ` [Qemu-devel] [PATCH v6 08/10] block: drive_backup transaction callback support John Snow
2015-06-05 21:53 ` [Qemu-devel] [PATCH v6 09/10] iotests: 124 - transactional failure test John Snow
2015-06-05 21:53 ` [Qemu-devel] [PATCH v6 10/10] qmp-commands.hx: Update the supported 'transaction' operations John Snow
2015-06-24 15:59 ` [Qemu-devel] [PATCH v6 00/10] block: incremental backup transactions John Snow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=558AD2D1.3020203@redhat.com \
--to=mreitz@redhat.com \
--cc=famz@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=vsementsov@parallels.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).