diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-12-17 18:20:00 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-12-19 08:32:39 +0100 |
commit | 1de7afc984b49af164e2619e6850b9732b173b34 (patch) | |
tree | 60cd16f527440fcfcdb81d9bea1af5d9147604c4 /include/qemu/notify.h | |
parent | 14cccb618508a0aa70eb9ccf366703a019a45ff0 (diff) | |
download | hqemu-1de7afc984b49af164e2619e6850b9732b173b34.zip hqemu-1de7afc984b49af164e2619e6850b9732b173b34.tar.gz |
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qemu/notify.h')
-rw-r--r-- | include/qemu/notify.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/qemu/notify.h b/include/qemu/notify.h new file mode 100644 index 0000000..4e2e7f0 --- /dev/null +++ b/include/qemu/notify.h @@ -0,0 +1,43 @@ +/* + * Notifier lists + * + * Copyright IBM, Corp. 2010 + * + * Authors: + * Anthony Liguori <aliguori@us.ibm.com> + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_NOTIFY_H +#define QEMU_NOTIFY_H + +#include "qemu/queue.h" + +typedef struct Notifier Notifier; + +struct Notifier +{ + void (*notify)(Notifier *notifier, void *data); + QLIST_ENTRY(Notifier) node; +}; + +typedef struct NotifierList +{ + QLIST_HEAD(, Notifier) notifiers; +} NotifierList; + +#define NOTIFIER_LIST_INITIALIZER(head) \ + { QLIST_HEAD_INITIALIZER((head).notifiers) } + +void notifier_list_init(NotifierList *list); + +void notifier_list_add(NotifierList *list, Notifier *notifier); + +void notifier_remove(Notifier *notifier); + +void notifier_list_notify(NotifierList *list, void *data); + +#endif |