main-loop: For tools, initialize timers as part of qemu_init_main_loop()
[qemu/kevin.git] / notify.c
blobc104495537fb457a3f33408e14676a3fa698be33
1 /*
2 * Notifier lists
4 * Copyright IBM, Corp. 2010
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
12 * Contributions after 2012-01-13 are licensed under the terms of the
13 * GNU GPL, version 2 or (at your option) any later version.
16 #include "qemu-common.h"
17 #include "notify.h"
19 void notifier_list_init(NotifierList *list)
21 QTAILQ_INIT(&list->notifiers);
24 void notifier_list_add(NotifierList *list, Notifier *notifier)
26 QTAILQ_INSERT_HEAD(&list->notifiers, notifier, node);
29 void notifier_list_remove(NotifierList *list, Notifier *notifier)
31 QTAILQ_REMOVE(&list->notifiers, notifier, node);
34 void notifier_list_notify(NotifierList *list, void *data)
36 Notifier *notifier, *next;
38 QTAILQ_FOREACH_SAFE(notifier, &list->notifiers, node, next) {
39 notifier->notify(notifier, data);