aboutsummaryrefslogtreecommitdiff
path: root/notify.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-01-13 17:34:01 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-02-17 08:33:32 -0600
commit31552529a7eba5011dac74bab18a852860c45c9d (patch)
treedda9b8146324b71445dd563530670e6b4da8c5e4 /notify.c
parentc77de088b1067fc0e0df322e5bac60a3a26a0613 (diff)
notifier: switch to QLIST
Notifiers do not need to access both ends of the list, and using a QLIST also simplifies the API. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'notify.c')
-rw-r--r--notify.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/notify.c b/notify.c
index c104495537..12282a6745 100644
--- a/notify.c
+++ b/notify.c
@@ -18,24 +18,24 @@
void notifier_list_init(NotifierList *list)
{
- QTAILQ_INIT(&list->notifiers);
+ QLIST_INIT(&list->notifiers);
}
void notifier_list_add(NotifierList *list, Notifier *notifier)
{
- QTAILQ_INSERT_HEAD(&list->notifiers, notifier, node);
+ QLIST_INSERT_HEAD(&list->notifiers, notifier, node);
}
-void notifier_list_remove(NotifierList *list, Notifier *notifier)
+void notifier_remove(Notifier *notifier)
{
- QTAILQ_REMOVE(&list->notifiers, notifier, node);
+ QLIST_REMOVE(notifier, node);
}
void notifier_list_notify(NotifierList *list, void *data)
{
Notifier *notifier, *next;
- QTAILQ_FOREACH_SAFE(notifier, &list->notifiers, node, next) {
+ QLIST_FOREACH_SAFE(notifier, &list->notifiers, node, next) {
notifier->notify(notifier, data);
}
}