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