From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Npj8P-0007GK-Jr for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:13:09 -0500 Received: from [199.232.76.173] (port=58047 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Npj8P-0007G8-7h for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:13:09 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Npj8N-0004CA-Uy for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:13:09 -0500 Received: from qw-out-1920.google.com ([74.125.92.149]:19372) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Npj8L-0004Ba-FQ for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:13:07 -0500 Received: by qw-out-1920.google.com with SMTP id 5so15614qwf.4 for ; Thu, 11 Mar 2010 06:12:59 -0800 (PST) Message-ID: <4B98FA68.7000901@codemonkey.ws> Date: Thu, 11 Mar 2010 08:12:56 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/7] Add support for generic notifier lists References: <1268239869-16058-1-git-send-email-aliguori@us.ibm.com> <4B98F1F0.7040105@redhat.com> In-Reply-To: <4B98F1F0.7040105@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Gerd Hoffman , qemu-devel@nongnu.org, Luiz Capitulino On 03/11/2010 07:36 AM, Avi Kivity wrote: > On 03/10/2010 06:51 PM, Anthony Liguori wrote: >> + >> +#ifndef QEMU_NOTIFY_H >> +#define QEMU_NOTIFY_H >> + >> +#include "qemu-queue.h" >> + >> +typedef struct QEMUNotifier QEMUNotifier; >> +typedef struct QEMUNotifierNode QEMUNotifierNode; >> + >> +struct QEMUNotifier >> +{ >> + void (*notify)(QEMUNotifier *notifier); >> +}; >> + >> +struct QEMUNotifierNode >> +{ >> + QEMUNotifier *notifier; >> + QTAILQ_ENTRY(QEMUNotifierNode) node; >> +}; >> + >> +typedef struct QEMUNotifierList >> +{ >> + QTAILQ_HEAD(, QEMUNotifierNode) notifiers; >> +} QEMUNotifierList; >> + >> +#define QEMU_NOTIFIER_LIST_INITIALIZER(head) \ >> + { QTAILQ_HEAD_INITIALIZER((head).notifiers) } >> + >> +void qemu_notifier_list_init(QEMUNotifierList *list); >> + >> +void qemu_notifier_list_add(QEMUNotifierList *list, QEMUNotifier >> *notifier); >> + >> +void qemu_notifier_list_remove(QEMUNotifierList *list, QEMUNotifier >> *notifier); >> + >> +void qemu_notifier_list_notify(QEMUNotifierList *list); >> + > > > Why the qemu_ prefixes everywhere? They make sense when wrapping > library calls, but in native qemu code they're just noise. I don't disagree, but we do this a lot in code today. I think if folks generally agreed that qemu prefixes were just noise, we should make a concerted effort in the future to prevent people from introducing more of them and make a note in CODING_STYLE. Regards, Anthony Liguori