From: John Snow <jsnow@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-block@nongnu.org
Cc: kwolf@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/5] block/backup: Add subclassed notifier
Date: Tue, 12 Jan 2016 13:02:45 -0500 [thread overview]
Message-ID: <56953FC5.7090502@redhat.com> (raw)
In-Reply-To: <56953F74.2040800@redhat.com>
On 01/12/2016 01:01 PM, Paolo Bonzini wrote:
>
>
> On 12/01/2016 18:57, John Snow wrote:
>>
>>
>> On 01/12/2016 03:46 AM, Paolo Bonzini wrote:
>>>
>>>
>>> On 12/01/2016 01:36, John Snow wrote:
>>>> Instead of relying on peeking at bs->job, we want to explicitly get
>>>> a reference to the job that was involved in this notifier callback.
>>>>
>>>> Extend the Notifier to include a job pointer, and include a reference
>>>> to the job registering the callback. This cuts out a few more cases
>>>> where we have to rely on bs->job.
>>>>
>>>> Signed-off-by: John Snow <jsnow@redhat.com>
>>>
>>> Why don't you just put the NotifierWithReturn inside the BackupBlockJob
>>> struct, and use container_of to get from NWR to BackupBlockJob?
>>>
>>> Paolo
>>>
>>
>> That's another way (including the notifier within the job vs. including
>> the job within the notifier.) This one simply occurred to me first. Any
>> strong benefit to that method, or just a matter of style?
>
> It's usually the one that is used with notifiers, no other reason.
>
>
> Paolo
>
I'll follow convention, I just didn't bump into an example to model.
--js
next prev parent reply other threads:[~2016-01-12 18:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 0:36 [Qemu-devel] [PATCH 0/5] block: reduce reliance on bs->job pointer John Snow
2016-01-12 0:36 ` [Qemu-devel] [PATCH 1/5] block: Allow mirror_start to return job references John Snow
2016-01-12 0:36 ` [Qemu-devel] [PATCH 2/5] block: Allow stream_start " John Snow
2016-01-12 0:36 ` [Qemu-devel] [PATCH 3/5] block: allow backup_start " John Snow
2016-01-12 0:36 ` [Qemu-devel] [PATCH 4/5] block/backup: Add subclassed notifier John Snow
2016-01-12 8:46 ` Paolo Bonzini
2016-01-12 17:57 ` John Snow
2016-01-12 18:01 ` Paolo Bonzini
2016-01-12 18:02 ` John Snow [this message]
2016-01-18 14:29 ` Kevin Wolf
2016-01-18 16:20 ` John Snow
2016-01-12 0:36 ` [Qemu-devel] [PATCH 5/5] blockjob: add Job parameter to BlockCompletionFunc John Snow
2016-01-18 14:25 ` Kevin Wolf
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=56953FC5.7090502@redhat.com \
--to=jsnow@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).