From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIuam-0002wR-9A for qemu-devel@nongnu.org; Tue, 12 Jan 2016 03:46:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIuai-00033D-I0 for qemu-devel@nongnu.org; Tue, 12 Jan 2016 03:46:16 -0500 Sender: Paolo Bonzini References: <1452558972-20316-1-git-send-email-jsnow@redhat.com> <1452558972-20316-5-git-send-email-jsnow@redhat.com> From: Paolo Bonzini Message-ID: <5694BD4F.3000802@redhat.com> Date: Tue, 12 Jan 2016 09:46:07 +0100 MIME-Version: 1.0 In-Reply-To: <1452558972-20316-5-git-send-email-jsnow@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: John Snow , qemu-block@nongnu.org Cc: kwolf@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org 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