From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NpiOV-0001aT-Rs for qemu-devel@nongnu.org; Thu, 11 Mar 2010 08:25:43 -0500 Received: from [199.232.76.173] (port=50468 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NpiOV-0001Zp-84 for qemu-devel@nongnu.org; Thu, 11 Mar 2010 08:25:43 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NpiOU-0000Jp-GC for qemu-devel@nongnu.org; Thu, 11 Mar 2010 08:25:43 -0500 Received: from mail-ew0-f213.google.com ([209.85.219.213]:50334) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NpiOT-0000I5-Q0 for qemu-devel@nongnu.org; Thu, 11 Mar 2010 08:25:42 -0500 Received: by mail-ew0-f213.google.com with SMTP id 5so7314ewy.10 for ; Thu, 11 Mar 2010 05:25:40 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4B98EF51.7040905@redhat.com> Date: Thu, 11 Mar 2010 14:25:37 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1268239869-16058-1-git-send-email-aliguori@us.ibm.com> <201003111257.59828.paul@codesourcery.com> In-Reply-To: <201003111257.59828.paul@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 1/7] Add support for generic notifier lists List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: Anthony Liguori , Luiz Capitulino , qemu-devel@nongnu.org, Gerd Hoffman 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: struct QEMUNotifierNode { QEMUCallbackFunc notify; void *opaque; QTAILQ_ENTRY(QEMUNotifierNode) node; }; void qemu_notifier_list_init(QEMUNotifierList *list); struct QEMUNotifierNode * qemu_notifier_list_add(QEMUNotifierList *list, QEMUCallbackFunc notify, void *opaque); void qemu_notifier_list_remove(QEMUNotifierList *list, QEMUNotifierNode *notifier); void qemu_notifier_list_notify(QEMUNotifierList *list); seems cleaner. You would place the QEMUNotifierNode in VncState in order to do the removal later. Besides this, the patchset is very nice indeed. Paolo