From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJ3Bv-0003zq-Of for qemu-devel@nongnu.org; Tue, 12 Jan 2016 12:57:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJ3Bu-0005jC-Ur for qemu-devel@nongnu.org; Tue, 12 Jan 2016 12:57:11 -0500 References: <1452558972-20316-1-git-send-email-jsnow@redhat.com> <1452558972-20316-5-git-send-email-jsnow@redhat.com> <5694BD4F.3000802@redhat.com> From: John Snow Message-ID: <56953E70.1080406@redhat.com> Date: Tue, 12 Jan 2016 12:57:04 -0500 MIME-Version: 1.0 In-Reply-To: <5694BD4F.3000802@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 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? --js