From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Npj6y-0006ik-CP for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:11:41 -0500 Received: from [199.232.76.173] (port=52401 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Npj6d-0006fR-Kx for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:11:19 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Npj6b-00045d-VC for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:11:19 -0500 Received: from mail-qy0-f190.google.com ([209.85.221.190]:62874) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Npj6b-00045A-0F for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:11:17 -0500 Received: by qyk28 with SMTP id 28so106235qyk.14 for ; Thu, 11 Mar 2010 06:11:13 -0800 (PST) Message-ID: <4B98F9FF.2040309@codemonkey.ws> Date: Thu, 11 Mar 2010 08:11:11 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 1/7] Add support for generic notifier lists References: <1268239869-16058-1-git-send-email-aliguori@us.ibm.com> <201003111257.59828.paul@codesourcery.com> <4B98EF51.7040905@redhat.com> In-Reply-To: <4B98EF51.7040905@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Gerd Hoffman , Paul Brook , Luiz Capitulino On 03/11/2010 07:25 AM, Paolo Bonzini wrote: > On 03/11/2010 01:57 PM, Paul Brook wrote: >> +struct QEMUNotifier >> > +{ >> > + void (*notify)(QEMUNotifier *notifier); >> > +}; >> >> I suggest combining this with QEMUBH. > > I didn't understand this suggestion exactly, but I think it's related > that I didn't understand the advantage of making QEMUNotifier a > struct. Instead of using container_of, reusing QEMUBHFunc (renamed to > QEMUCallbackFunc maybe?) in QEMUNotifierNode like this: I like treating a slot as a single object instead of as function pointer/opaque pair. It gives us better type safety and reduces the amount of parameters that need to be passed around. Regards, Anthony Liguori