From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLAnu-0007KN-6F for qemu-devel@nongnu.org; Mon, 18 Jan 2016 09:29:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLAnt-0006on-B1 for qemu-devel@nongnu.org; Mon, 18 Jan 2016 09:29:10 -0500 Date: Mon, 18 Jan 2016 15:29:00 +0100 From: Kevin Wolf Message-ID: <20160118142900.GC4558@noname.redhat.com> References: <1452558972-20316-1-git-send-email-jsnow@redhat.com> <1452558972-20316-5-git-send-email-jsnow@redhat.com> <5694BD4F.3000802@redhat.com> <56953E70.1080406@redhat.com> <56953F74.2040800@redhat.com> <56953FC5.7090502@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56953FC5.7090502@redhat.com> Subject: Re: [Qemu-devel] [PATCH 4/5] block/backup: Add subclassed notifier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: Paolo Bonzini , armbru@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org Am 12.01.2016 um 19:02 hat John Snow geschrieben: > > > 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 > >>> > >>> 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. > > I'll follow convention, I just didn't bump into an example to model. This means that I should wait for a v2? (Hm, or is this Markus' area, actually? Or Jeff's?) Otherwise, this series is: Reviewed-by: Kevin Wolf