On 01/10/2011 10:38 AM, Cole Robinson wrote:
The same code for queueing, flushing, and deregistering events
exists
in multiple drivers, which will soon use these common functions.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
src/conf/domain_event.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++-
src/conf/domain_event.h | 17 +++++++++++
2 files changed, 90 insertions(+), 1 deletions(-)
diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c
index 4f0e4da..84f4709 100644
--- a/src/conf/domain_event.c
+++ b/src/conf/domain_event.c
+void
+virDomainEventStateFlush(virDomainEventStatePtr state,
+ virDomainEventDispatchFunc dispatchFunc,
+ void *opaque)
+{
+ virDomainEventQueue tempQueue;
+
+ state->isDispatching = 1;
s/1/true/, if you changed the type of isDispatching per my comment on 3/8.
diff --git a/src/conf/domain_event.h b/src/conf/domain_event.h
index 98a2870..9893cf2 100644
--- a/src/conf/domain_event.h
+++ b/src/conf/domain_event.h
@@ -203,4 +203,21 @@ void virDomainEventQueueDispatch(virDomainEventQueuePtr queue,
virDomainEventDispatchFunc dispatch,
void *opaque);
+
+void
+virDomainEventStateQueue(virDomainEventStatePtr state,
+ virDomainEventPtr event);
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
+void
+virDomainEventStateFlush(virDomainEventStatePtr state,
+ virDomainEventDispatchFunc dispatchFunc,
+ void *opaque);
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
+int
+virDomainEventStateDeregister(virConnectPtr conn,
+ virDomainEventStatePtr state,
+ virConnectDomainEventCallback callback);
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
+int
+virDomainEventStateDeregisterAny(virConnectPtr conn,
+ virDomainEventStatePtr state,
+ int callbackID);
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org