From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJ3HR-0006Uy-7O for qemu-devel@nongnu.org; Tue, 12 Jan 2016 13:02:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJ3HM-0007Bi-6y for qemu-devel@nongnu.org; Tue, 12 Jan 2016 13:02:53 -0500 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> From: John Snow Message-ID: <56953FC5.7090502@redhat.com> Date: Tue, 12 Jan 2016 13:02:45 -0500 MIME-Version: 1.0 In-Reply-To: <56953F74.2040800@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: Paolo Bonzini , qemu-block@nongnu.org Cc: kwolf@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org 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. > > > Paolo > I'll follow convention, I just didn't bump into an example to model. --js