On Wed, Dec 11, 2013 at 11:37:58AM +0100, Cédric Bosdonnat wrote:
diff --git a/src/conf/network_event.c b/src/conf/network_event.c
new file mode 100644
index 0000000..74e9d3d
--- /dev/null
+++ b/src/conf/network_event.c
+int
+virNetworkEventStateRegisterID(virConnectPtr conn,
+ virObjectEventStatePtr state,
+ virNetworkPtr net,
+ int eventID,
+ virConnectObjectEventGenericCallback cb,
+ void *opaque,
+ virFreeCallback freecb,
+ int *callbackID)
Small indentation bug I'll fix when pushing.
+{
+ int nsEventID = (VIR_EVENT_NAMESPACE_NETWORK << 8) + eventID;
+ if (net)
+ return virObjectEventStateRegisterID(conn, state,
+ net->uuid, net->name, 0, nsEventID,
+ cb, opaque, freecb, callbackID);
+ else
+ return virObjectEventStateRegisterID(conn, state,
+ NULL, NULL, 0, nsEventID,
+ cb, opaque, freecb, callbackID);
+}
+
+void
+*virNetworkEventLifecycleNew(const char *name,
+ const unsigned char *uuid,
+ int type)
The return type should be virObjectEventPtr - will fix
+{
+ virNetworkEventLifecyclePtr event;
+ int eventId = (VIR_EVENT_NAMESPACE_NETWORK << 8) +
VIR_NETWORK_EVENT_ID_LIFECYCLE;
+
+ if (virNetworkEventsInitialize() < 0)
+ return NULL;
+
+ if (!(event = virObjectEventNew(virNetworkEventLifecycleClass,
+ eventId,
+ 0, name, uuid)))
+ return NULL;
+
+ event->type = type;
+
+ return event;
+}
+int
+virNetworkEventStateRegisterID(virConnectPtr conn,
+ virObjectEventStatePtr state,
+ virNetworkPtr net,
+ int eventID,
+ virConnectObjectEventGenericCallback cb,
+ void *opaque,
+ virFreeCallback freecb,
+ int *callbackID);
Same indent issue
+
+void
+*virNetworkEventLifecycleNew(const char *name,
+ const unsigned char *uuid,
+ int type);
+
+void
+virNetworkEventDispatchDefaultFunc(virConnectPtr conn,
+ virObjectEventPtr event,
+ virConnectNetworkEventGenericCallback cb,
+ void *cbopaque,
+ void *opaque);
+#endif
+
+typedef int
+(*virDrvConnectNetworkEventDeregisterAny)(virConnectPtr conn,
+ int callbackID);
Tiny indent issue.
diff --git a/src/libvirt.c b/src/libvirt.c
index b3543d0..97175b2 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
+int
+virConnectNetworkEventDeregisterAny(virConnectPtr conn,
+ int callbackID)
+{
+ VIR_DEBUG("conn=%p, callbackID=%d", conn, callbackID);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECT(conn)) {
+ virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
+ virDispatchError(NULL);
+ return -1;
+ }
+ virCheckNonNegativeArgGoto(callbackID, error);
+
+ if ((conn->networkDriver) &&
+ (conn->networkDriver->connectNetworkEventDeregisterAny)) {
Small indent issue
ACK will push with fixes
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 :|