On Fri, Nov 29, 2013 at 04:19:02PM +0100, Cédric Bosdonnat wrote:
---
src/Makefile.am | 6 +
src/conf/domain_event.c | 806 +---------------------------------------
src/conf/domain_event.h | 70 +---
src/conf/object_event.c | 786 +++++++++++++++++++++++++++++++++++++++
src/conf/object_event.h | 96 +++++
src/conf/object_event_private.h | 113 ++++++
src/libvirt_private.syms | 15 +-
7 files changed, 1023 insertions(+), 869 deletions(-)
create mode 100644 src/conf/object_event.c
create mode 100644 src/conf/object_event.h
create mode 100644 src/conf/object_event_private.h
diff --git a/src/conf/object_event_private.h
b/src/conf/object_event_private.h
new file mode 100644
index 0000000..c981a29
--- /dev/null
+++ b/src/conf/object_event_private.h
+
+#include "datatypes.h"
+
+#ifndef __OBJECT_EVENT_PRIVATE_H__
+# define __OBJECT_EVENT_PRIVATE_H__
+
+struct _virObjectMeta {
+ int id;
+ char *name;
+ unsigned char uuid[VIR_UUID_BUFLEN];
+};
+typedef struct _virObjectMeta virObjectMeta;
+typedef virObjectMeta *virObjectMetaPtr;
+
+struct _virObjectEventCallbackList {
+ unsigned int nextID;
+ unsigned int count;
+ virObjectEventCallbackPtr *callbacks;
+};
+
+struct _virObjectEventQueue {
+ unsigned int count;
+ virObjectEventPtr *events;
+};
+
+struct _virObjectEventState {
+ /* The list of domain event callbacks */
+ virObjectEventCallbackListPtr callbacks;
+ /* The queue of object events */
+ virObjectEventQueuePtr queue;
+ /* Timer for flushing events queue */
+ int timer;
+ /* Flag if we're in process of dispatching */
+ bool isDispatching;
+ virMutex lock;
+};
+
+struct _virObjectEventCallback {
+ int callbackID;
+ int eventID;
+ virConnectPtr conn;
+ virObjectMetaPtr meta;
+ virConnectObjectEventGenericCallback cb;
+ void *opaque;
+ virFreeCallback freecb;
+ int deleted;
+};
+
+struct _virObjectEvent {
+ virObject parent;
+ int eventID;
+ virObjectMeta meta;
+};
I wondering if all of these structs need to be exposed here. I'd go
for the minimum required to let domain_events.c compile, if this
can be made smaller.
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|