diff --git a/src/conf/network_event.c b/src/conf/network_event.c index b885cedf4425b1b95ae10ce10c14bb8d2a344bfd..b1312b78f1d4ca4a5175a8d50f5615e45e336a9d 100644 --- a/src/conf/network_event.c +++ b/src/conf/network_event.c @@ -28,23 +28,40 @@ #include "datatypes.h" #include "virlog.h" -struct _virNetworkEventLifecycle { +struct _virNetworkEvent { virObjectEvent parent; + /* Unused attribute to get virNetworkEvent class being created */ + bool dummy; +}; +typedef struct _virNetworkEvent virNetworkEvent; +typedef virNetworkEvent *virNetworkEventPtr; + +struct _virNetworkEventLifecycle { + virNetworkEvent parent; + int type; int detail; }; typedef struct _virNetworkEventLifecycle virNetworkEventLifecycle; typedef virNetworkEventLifecycle *virNetworkEventLifecyclePtr; +static virClassPtr virNetworkEventClass; static virClassPtr virNetworkEventLifecycleClass; +static void virNetworkEventDispose(void *obj); static void virNetworkEventLifecycleDispose(void *obj); static int virNetworkEventsOnceInit(void) { - if (!(virNetworkEventLifecycleClass = + if (!(virNetworkEventClass = virClassNew(virClassForObjectEvent(), + "virNetworkEvent", + sizeof(virNetworkEvent), + virNetworkEventDispose))) + return -1; + if (!(virNetworkEventLifecycleClass = + virClassNew(virNetworkEventClass, "virNetworkEventLifecycle", sizeof(virNetworkEventLifecycle), virNetworkEventLifecycleDispose))) @@ -54,6 +71,14 @@ virNetworkEventsOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNetworkEvents) +void +virNetworkEventDispose(void *obj) +{ + virNetworkEventPtr event = obj; + VIR_DEBUG("obj=%p", event); +} + + void virNetworkEventLifecycleDispose(void *obj) {