The virDomainEvent class is kept as it indicates what meta informations are valid for the children classes. This may be useful in the future. --- src/conf/domain_event.c | 186 +++++++++++++++++++++++---------------------- src/conf/domain_event.h | 75 +++++++++--------- src/libxl/libxl_driver.c | 20 ++--- src/lxc/lxc_driver.c | 16 ++-- src/lxc/lxc_process.c | 6 +- src/qemu/qemu_domain.c | 4 +- src/qemu/qemu_domain.h | 2 +- src/qemu/qemu_driver.c | 42 +++++----- src/qemu/qemu_hotplug.c | 10 +-- src/qemu/qemu_migration.c | 12 +-- src/qemu/qemu_process.c | 48 ++++++------ src/remote/remote_driver.c | 36 ++++----- src/test/test_driver.c | 36 ++++----- src/uml/uml_driver.c | 18 ++--- src/vbox/vbox_tmpl.c | 4 +- src/xen/xen_driver.c | 2 +- src/xen/xen_driver.h | 2 +- src/xen/xen_inotify.c | 8 +- src/xen/xs_internal.c | 4 +- 19 files changed, 268 insertions(+), 263 deletions(-) diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c index 9108207..3c14cec 100644 --- a/src/conf/domain_event.c +++ b/src/conf/domain_event.c @@ -55,7 +55,7 @@ typedef virObjectEventCallbackList *virObjectEventCallbackListPtr; struct _virObjectEventQueue { unsigned int count; - virDomainEventPtr *events; + virObjectEventPtr *events; }; struct _virObjectEventState { @@ -112,13 +112,17 @@ static void virDomainEventDeviceRemovedDispose(void *obj); struct _virObjectEvent { virObject parent; int eventID; + virObjectMeta meta; }; struct _virDomainEvent { virObjectEvent parent; - virObjectMeta meta; + /* Unused attribute to get virDomainEvent class being created */ + bool dummy; }; +typedef struct _virDomainEvent virDomainEvent; +typedef virDomainEvent *virDomainEventPtr; struct _virDomainEventLifecycle { virDomainEvent parent; @@ -310,6 +314,8 @@ static void virObjectEventDispose(void *obj) virObjectEventPtr event = obj; VIR_DEBUG("obj=%p", event); + + VIR_FREE(event->meta.name); } static void virDomainEventDispose(void *obj) @@ -317,8 +323,6 @@ static void virDomainEventDispose(void *obj) virDomainEventPtr event = obj; VIR_DEBUG("obj=%p", event); - - VIR_FREE(event->meta.name); } static void virDomainEventLifecycleDispose(void *obj) @@ -890,7 +894,10 @@ error: } static void *virObjectEventNew(virClassPtr klass, - int eventID) + int eventID, + int id, + const char *name, + const unsigned char *uuid) { virObjectEventPtr event; @@ -909,6 +916,13 @@ static void *virObjectEventNew(virClassPtr klass, event->eventID = eventID; + if (VIR_STRDUP(event->meta.name, name) < 0) { + VIR_FREE(event); + return NULL; + } + event->meta.id = id; + memcpy(event->meta.uuid, uuid, VIR_UUID_BUFLEN); + VIR_DEBUG("obj=%p", event); return event; } @@ -931,22 +945,16 @@ static void *virDomainEventNew(virClassPtr klass, return NULL; } - if (!(event = virObjectEventNew(klass, eventID))) - return NULL; - - if (VIR_STRDUP(event->meta.name, name) < 0) { - VIR_FREE(event); + if (!(event = virObjectEventNew(klass, eventID, + id, name, uuid))) return NULL; - } - event->meta.id = id; - memcpy(event->meta.uuid, uuid, VIR_UUID_BUFLEN); - return event; + return (virObjectEventPtr)event; } -virDomainEventPtr virDomainEventLifecycleNew(int id, const char *name, - const unsigned char *uuid, - int type, int detail) +virObjectEventPtr virDomainEventLifecycleNew(int id, const char *name, + const unsigned char *uuid, + int type, int detail) { virDomainEventLifecyclePtr event; @@ -961,27 +969,27 @@ virDomainEventPtr virDomainEventLifecycleNew(int id, const char *name, event->type = type; event->detail = detail; - return (virDomainEventPtr)event; + return (virObjectEventPtr)event; } -virDomainEventPtr virDomainEventLifecycleNewFromDom(virDomainPtr dom, int type, int detail) +virObjectEventPtr virDomainEventLifecycleNewFromDom(virDomainPtr dom, int type, int detail) { return virDomainEventLifecycleNew(dom->id, dom->name, dom->uuid, type, detail); } -virDomainEventPtr virDomainEventLifecycleNewFromObj(virDomainObjPtr obj, int type, int detail) +virObjectEventPtr virDomainEventLifecycleNewFromObj(virDomainObjPtr obj, int type, int detail) { return virDomainEventLifecycleNewFromDef(obj->def, type, detail); } -virDomainEventPtr virDomainEventLifecycleNewFromDef(virDomainDefPtr def, int type, int detail) +virObjectEventPtr virDomainEventLifecycleNewFromDef(virDomainDefPtr def, int type, int detail) { return virDomainEventLifecycleNew(def->id, def->name, def->uuid, type, detail); } -virDomainEventPtr virDomainEventRebootNew(int id, const char *name, +virObjectEventPtr virDomainEventRebootNew(int id, const char *name, const unsigned char *uuid) { if (virObjectEventInitialize() < 0) @@ -992,7 +1000,7 @@ virDomainEventPtr virDomainEventRebootNew(int id, const char *name, id, name, uuid); } -virDomainEventPtr virDomainEventRebootNewFromDom(virDomainPtr dom) +virObjectEventPtr virDomainEventRebootNewFromDom(virDomainPtr dom) { if (virObjectEventInitialize() < 0) return NULL; @@ -1002,7 +1010,7 @@ virDomainEventPtr virDomainEventRebootNewFromDom(virDomainPtr dom) dom->id, dom->name, dom->uuid); } -virDomainEventPtr virDomainEventRebootNewFromObj(virDomainObjPtr obj) +virObjectEventPtr virDomainEventRebootNewFromObj(virDomainObjPtr obj) { if (virObjectEventInitialize() < 0) return NULL; @@ -1012,7 +1020,7 @@ virDomainEventPtr virDomainEventRebootNewFromObj(virDomainObjPtr obj) obj->def->id, obj->def->name, obj->def->uuid); } -virDomainEventPtr virDomainEventRTCChangeNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventRTCChangeNewFromDom(virDomainPtr dom, long long offset) { virDomainEventRTCChangePtr ev; @@ -1027,9 +1035,9 @@ virDomainEventPtr virDomainEventRTCChangeNewFromDom(virDomainPtr dom, ev->offset = offset; - return (virDomainEventPtr)ev; + return (virObjectEventPtr)ev; } -virDomainEventPtr virDomainEventRTCChangeNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventRTCChangeNewFromObj(virDomainObjPtr obj, long long offset) { virDomainEventRTCChangePtr ev; @@ -1045,10 +1053,10 @@ virDomainEventPtr virDomainEventRTCChangeNewFromObj(virDomainObjPtr obj, ev->offset = offset; - return (virDomainEventPtr)ev; + return (virObjectEventPtr)ev; } -virDomainEventPtr virDomainEventWatchdogNewFromDom(virDomainPtr dom, int action) +virObjectEventPtr virDomainEventWatchdogNewFromDom(virDomainPtr dom, int action) { virDomainEventWatchdogPtr ev; @@ -1062,9 +1070,9 @@ virDomainEventPtr virDomainEventWatchdogNewFromDom(virDomainPtr dom, int action) ev->action = action; - return (virDomainEventPtr)ev; + return (virObjectEventPtr)ev; } -virDomainEventPtr virDomainEventWatchdogNewFromObj(virDomainObjPtr obj, int action) +virObjectEventPtr virDomainEventWatchdogNewFromObj(virDomainObjPtr obj, int action) { virDomainEventWatchdogPtr ev; @@ -1079,10 +1087,10 @@ virDomainEventPtr virDomainEventWatchdogNewFromObj(virDomainObjPtr obj, int acti ev->action = action; - return (virDomainEventPtr)ev; + return (virObjectEventPtr)ev; } -static virDomainEventPtr virDomainEventIOErrorNewFromDomImpl(int event, +static virObjectEventPtr virDomainEventIOErrorNewFromDomImpl(int event, virDomainPtr dom, const char *srcPath, const char *devAlias, @@ -1106,10 +1114,10 @@ static virDomainEventPtr virDomainEventIOErrorNewFromDomImpl(int event, ev = NULL; } - return (virDomainEventPtr)ev; + return (virObjectEventPtr)ev; } -static virDomainEventPtr virDomainEventIOErrorNewFromObjImpl(int event, +static virObjectEventPtr virDomainEventIOErrorNewFromObjImpl(int event, virDomainObjPtr obj, const char *srcPath, const char *devAlias, @@ -1134,10 +1142,10 @@ static virDomainEventPtr virDomainEventIOErrorNewFromObjImpl(int event, ev = NULL; } - return (virDomainEventPtr)ev; + return (virObjectEventPtr)ev; } -virDomainEventPtr virDomainEventIOErrorNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventIOErrorNewFromDom(virDomainPtr dom, const char *srcPath, const char *devAlias, int action) @@ -1147,7 +1155,7 @@ virDomainEventPtr virDomainEventIOErrorNewFromDom(virDomainPtr dom, action, NULL); } -virDomainEventPtr virDomainEventIOErrorNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventIOErrorNewFromObj(virDomainObjPtr obj, const char *srcPath, const char *devAlias, int action) @@ -1157,7 +1165,7 @@ virDomainEventPtr virDomainEventIOErrorNewFromObj(virDomainObjPtr obj, action, NULL); } -virDomainEventPtr virDomainEventIOErrorReasonNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventIOErrorReasonNewFromDom(virDomainPtr dom, const char *srcPath, const char *devAlias, int action, @@ -1168,7 +1176,7 @@ virDomainEventPtr virDomainEventIOErrorReasonNewFromDom(virDomainPtr dom, action, reason); } -virDomainEventPtr virDomainEventIOErrorReasonNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventIOErrorReasonNewFromObj(virDomainObjPtr obj, const char *srcPath, const char *devAlias, int action, @@ -1180,7 +1188,7 @@ virDomainEventPtr virDomainEventIOErrorReasonNewFromObj(virDomainObjPtr obj, } -virDomainEventPtr virDomainEventGraphicsNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventGraphicsNewFromDom(virDomainPtr dom, int phase, virDomainEventGraphicsAddressPtr local, virDomainEventGraphicsAddressPtr remote, @@ -1206,10 +1214,10 @@ virDomainEventPtr virDomainEventGraphicsNewFromDom(virDomainPtr dom, ev->remote = remote; ev->subject = subject; - return (virDomainEventPtr)ev; + return (virObjectEventPtr)ev; } -virDomainEventPtr virDomainEventGraphicsNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventGraphicsNewFromObj(virDomainObjPtr obj, int phase, virDomainEventGraphicsAddressPtr local, virDomainEventGraphicsAddressPtr remote, @@ -1236,11 +1244,11 @@ virDomainEventPtr virDomainEventGraphicsNewFromObj(virDomainObjPtr obj, ev->remote = remote; ev->subject = subject; - return (virDomainEventPtr)ev; + return (virObjectEventPtr)ev; } static -virDomainEventPtr virDomainEventBlockJobNew(int id, +virObjectEventPtr virDomainEventBlockJobNew(int id, const char *name, unsigned char *uuid, const char *path, @@ -1264,10 +1272,10 @@ virDomainEventPtr virDomainEventBlockJobNew(int id, ev->type = type; ev->status = status; - return (virDomainEventPtr)ev; + return (virObjectEventPtr)ev; } -virDomainEventPtr virDomainEventBlockJobNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventBlockJobNewFromObj(virDomainObjPtr obj, const char *path, int type, int status) @@ -1276,7 +1284,7 @@ virDomainEventPtr virDomainEventBlockJobNewFromObj(virDomainObjPtr obj, obj->def->uuid, path, type, status); } -virDomainEventPtr virDomainEventBlockJobNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventBlockJobNewFromDom(virDomainPtr dom, const char *path, int type, int status) @@ -1285,9 +1293,9 @@ virDomainEventPtr virDomainEventBlockJobNewFromDom(virDomainPtr dom, path, type, status); } -virDomainEventPtr virDomainEventControlErrorNewFromDom(virDomainPtr dom) +virObjectEventPtr virDomainEventControlErrorNewFromDom(virDomainPtr dom) { - virDomainEventPtr ev; + virObjectEventPtr ev; if (virObjectEventInitialize() < 0) return NULL; @@ -1300,9 +1308,9 @@ virDomainEventPtr virDomainEventControlErrorNewFromDom(virDomainPtr dom) } -virDomainEventPtr virDomainEventControlErrorNewFromObj(virDomainObjPtr obj) +virObjectEventPtr virDomainEventControlErrorNewFromObj(virDomainObjPtr obj) { - virDomainEventPtr ev; + virObjectEventPtr ev; if (virObjectEventInitialize() < 0) return NULL; @@ -1316,7 +1324,7 @@ virDomainEventPtr virDomainEventControlErrorNewFromObj(virDomainObjPtr obj) } static -virDomainEventPtr virDomainEventDiskChangeNew(int id, const char *name, +virObjectEventPtr virDomainEventDiskChangeNew(int id, const char *name, unsigned char *uuid, const char *oldSrcPath, const char *newSrcPath, @@ -1343,14 +1351,14 @@ virDomainEventPtr virDomainEventDiskChangeNew(int id, const char *name, ev->reason = reason; - return (virDomainEventPtr)ev; + return (virObjectEventPtr)ev; error: virObjectUnref(ev); return NULL; } -virDomainEventPtr virDomainEventDiskChangeNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventDiskChangeNewFromObj(virDomainObjPtr obj, const char *oldSrcPath, const char *newSrcPath, const char *devAlias, @@ -1361,7 +1369,7 @@ virDomainEventPtr virDomainEventDiskChangeNewFromObj(virDomainObjPtr obj, newSrcPath, devAlias, reason); } -virDomainEventPtr virDomainEventDiskChangeNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventDiskChangeNewFromDom(virDomainPtr dom, const char *oldSrcPath, const char *newSrcPath, const char *devAlias, @@ -1372,7 +1380,7 @@ virDomainEventPtr virDomainEventDiskChangeNewFromDom(virDomainPtr dom, devAlias, reason); } -static virDomainEventPtr +static virObjectEventPtr virDomainEventTrayChangeNew(int id, const char *name, unsigned char *uuid, const char *devAlias, @@ -1393,14 +1401,14 @@ virDomainEventTrayChangeNew(int id, const char *name, ev->reason = reason; - return (virDomainEventPtr)ev; + return (virObjectEventPtr)ev; error: virObjectUnref(ev); return NULL; } -virDomainEventPtr virDomainEventTrayChangeNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventTrayChangeNewFromObj(virDomainObjPtr obj, const char *devAlias, int reason) { @@ -1411,7 +1419,7 @@ virDomainEventPtr virDomainEventTrayChangeNewFromObj(virDomainObjPtr obj, reason); } -virDomainEventPtr virDomainEventTrayChangeNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventTrayChangeNewFromDom(virDomainPtr dom, const char *devAlias, int reason) { @@ -1419,11 +1427,11 @@ virDomainEventPtr virDomainEventTrayChangeNewFromDom(virDomainPtr dom, devAlias, reason); } -static virDomainEventPtr +static virObjectEventPtr virDomainEventPMWakeupNew(int id, const char *name, unsigned char *uuid) { - virDomainEventPtr ev; + virObjectEventPtr ev; if (virObjectEventInitialize() < 0) return NULL; @@ -1436,7 +1444,7 @@ virDomainEventPMWakeupNew(int id, const char *name, return ev; } -virDomainEventPtr +virObjectEventPtr virDomainEventPMWakeupNewFromObj(virDomainObjPtr obj) { return virDomainEventPMWakeupNew(obj->def->id, @@ -1444,17 +1452,17 @@ virDomainEventPMWakeupNewFromObj(virDomainObjPtr obj) obj->def->uuid); } -virDomainEventPtr +virObjectEventPtr virDomainEventPMWakeupNewFromDom(virDomainPtr dom) { return virDomainEventPMWakeupNew(dom->id, dom->name, dom->uuid); } -static virDomainEventPtr +static virObjectEventPtr virDomainEventPMSuspendNew(int id, const char *name, unsigned char *uuid) { - virDomainEventPtr ev; + virObjectEventPtr ev; if (virObjectEventInitialize() < 0) return NULL; @@ -1467,7 +1475,7 @@ virDomainEventPMSuspendNew(int id, const char *name, return ev; } -virDomainEventPtr +virObjectEventPtr virDomainEventPMSuspendNewFromObj(virDomainObjPtr obj) { return virDomainEventPMSuspendNew(obj->def->id, @@ -1475,17 +1483,17 @@ virDomainEventPMSuspendNewFromObj(virDomainObjPtr obj) obj->def->uuid); } -virDomainEventPtr +virObjectEventPtr virDomainEventPMSuspendNewFromDom(virDomainPtr dom) { return virDomainEventPMSuspendNew(dom->id, dom->name, dom->uuid); } -static virDomainEventPtr +static virObjectEventPtr virDomainEventPMSuspendDiskNew(int id, const char *name, unsigned char *uuid) { - virDomainEventPtr ev; + virObjectEventPtr ev; if (virObjectEventInitialize() < 0) return NULL; @@ -1497,7 +1505,7 @@ virDomainEventPMSuspendDiskNew(int id, const char *name, return ev; } -virDomainEventPtr +virObjectEventPtr virDomainEventPMSuspendDiskNewFromObj(virDomainObjPtr obj) { return virDomainEventPMSuspendDiskNew(obj->def->id, @@ -1505,13 +1513,13 @@ virDomainEventPMSuspendDiskNewFromObj(virDomainObjPtr obj) obj->def->uuid); } -virDomainEventPtr +virObjectEventPtr virDomainEventPMSuspendDiskNewFromDom(virDomainPtr dom) { return virDomainEventPMSuspendDiskNew(dom->id, dom->name, dom->uuid); } -virDomainEventPtr virDomainEventBalloonChangeNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventBalloonChangeNewFromDom(virDomainPtr dom, unsigned long long actual) { virDomainEventBalloonChangePtr ev; @@ -1526,9 +1534,9 @@ virDomainEventPtr virDomainEventBalloonChangeNewFromDom(virDomainPtr dom, ev->actual = actual; - return (virDomainEventPtr)ev; + return (virObjectEventPtr)ev; } -virDomainEventPtr virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj, unsigned long long actual) { virDomainEventBalloonChangePtr ev; @@ -1543,10 +1551,10 @@ virDomainEventPtr virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj, ev->actual = actual; - return (virDomainEventPtr)ev; + return (virObjectEventPtr)ev; } -static virDomainEventPtr virDomainEventDeviceRemovedNew(int id, +static virObjectEventPtr virDomainEventDeviceRemovedNew(int id, const char *name, unsigned char *uuid, const char *devAlias) @@ -1564,21 +1572,21 @@ static virDomainEventPtr virDomainEventDeviceRemovedNew(int id, if (VIR_STRDUP(ev->devAlias, devAlias) < 0) goto error; - return (virDomainEventPtr)ev; + return (virObjectEventPtr)ev; error: virObjectUnref(ev); return NULL; } -virDomainEventPtr virDomainEventDeviceRemovedNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventDeviceRemovedNewFromObj(virDomainObjPtr obj, const char *devAlias) { return virDomainEventDeviceRemovedNew(obj->def->id, obj->def->name, obj->def->uuid, devAlias); } -virDomainEventPtr virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom, const char *devAlias) { return virDomainEventDeviceRemovedNew(dom->id, dom->name, dom->uuid, @@ -1596,7 +1604,7 @@ virDomainEventPtr virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom, */ static int virObjectEventQueuePush(virObjectEventQueuePtr evtQueue, - virDomainEventPtr event) + virObjectEventPtr event) { if (!evtQueue) { return -1; @@ -1614,7 +1622,7 @@ virObjectEventQueuePush(virObjectEventQueuePtr evtQueue, typedef void (*virObjectEventDispatchFunc)(virConnectPtr conn, - virDomainEventPtr event, + virObjectEventPtr event, virConnectObjectEventGenericCallback cb, void *cbopaque, void *opaque); @@ -1622,7 +1630,7 @@ typedef void (*virObjectEventDispatchFunc)(virConnectPtr conn, static void virDomainEventDispatchDefaultFunc(virConnectPtr conn, - virDomainEventPtr event, + virObjectEventPtr event, virConnectDomainEventGenericCallback cb, void *cbopaque, void *opaque ATTRIBUTE_UNUSED) @@ -1804,7 +1812,7 @@ cleanup: } -static int virDomainEventDispatchMatchCallback(virDomainEventPtr event, +static int virObjectEventDispatchMatchCallback(virObjectEventPtr event, virObjectEventCallbackPtr cb) { if (!cb) @@ -1832,7 +1840,7 @@ static int virDomainEventDispatchMatchCallback(virDomainEventPtr event, static void -virDomainEventDispatch(virDomainEventPtr event, +virObjectEventDispatch(virObjectEventPtr event, virObjectEventCallbackListPtr callbacks, virObjectEventDispatchFunc dispatch, void *opaque) @@ -1844,7 +1852,7 @@ virDomainEventDispatch(virDomainEventPtr event, int cbCount = callbacks->count; for (i = 0; i < cbCount; i++) { - if (!virDomainEventDispatchMatchCallback(event, callbacks->callbacks[i])) + if (!virObjectEventDispatchMatchCallback(event, callbacks->callbacks[i])) continue; (*dispatch)(callbacks->callbacks[i]->conn, @@ -1865,7 +1873,7 @@ virObjectEventQueueDispatch(virObjectEventQueuePtr queue, size_t i; for (i = 0; i < queue->count; i++) { - virDomainEventDispatch(queue->events[i], callbacks, dispatch, opaque); + virObjectEventDispatch(queue->events[i], callbacks, dispatch, opaque); virObjectUnref(queue->events[i]); } VIR_FREE(queue->events); @@ -1874,7 +1882,7 @@ virObjectEventQueueDispatch(virObjectEventQueuePtr queue, void virObjectEventStateQueue(virObjectEventStatePtr state, - virDomainEventPtr event) + virObjectEventPtr event) { if (state->timer < 0) { virObjectUnref(event); @@ -1896,7 +1904,7 @@ virObjectEventStateQueue(virObjectEventStatePtr state, static void virObjectEventStateDispatchFunc(virConnectPtr conn, - virDomainEventPtr event, + virObjectEventPtr event, virConnectObjectEventGenericCallback cb, void *cbopaque, void *opaque) diff --git a/src/conf/domain_event.h b/src/conf/domain_event.h index bf701f9..647b7e4 100644 --- a/src/conf/domain_event.h +++ b/src/conf/domain_event.h @@ -38,110 +38,107 @@ typedef virObjectEventCallback *virObjectEventCallbackPtr; typedef struct _virObjectEvent virObjectEvent; typedef virObjectEvent *virObjectEventPtr; -typedef struct _virDomainEvent virDomainEvent; -typedef virDomainEvent *virDomainEventPtr; - typedef struct _virObjectEventState virObjectEventState; typedef virObjectEventState *virObjectEventStatePtr; -virDomainEventPtr virDomainEventLifecycleNew(int id, +virObjectEventPtr virDomainEventLifecycleNew(int id, const char *name, const unsigned char *uuid, int type, int detail); -virDomainEventPtr virDomainEventLifecycleNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventLifecycleNewFromDom(virDomainPtr dom, int type, int detail); -virDomainEventPtr virDomainEventLifecycleNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventLifecycleNewFromObj(virDomainObjPtr obj, int type, int detail); -virDomainEventPtr virDomainEventLifecycleNewFromDef(virDomainDefPtr def, +virObjectEventPtr virDomainEventLifecycleNewFromDef(virDomainDefPtr def, int type, int detail); -virDomainEventPtr virDomainEventRebootNew(int id, const char *name, const unsigned char *uuid); -virDomainEventPtr virDomainEventRebootNewFromDom(virDomainPtr dom); -virDomainEventPtr virDomainEventRebootNewFromObj(virDomainObjPtr obj); +virObjectEventPtr virDomainEventRebootNew(int id, const char *name, const unsigned char *uuid); +virObjectEventPtr virDomainEventRebootNewFromDom(virDomainPtr dom); +virObjectEventPtr virDomainEventRebootNewFromObj(virDomainObjPtr obj); -virDomainEventPtr virDomainEventRTCChangeNewFromDom(virDomainPtr dom, long long offset); -virDomainEventPtr virDomainEventRTCChangeNewFromObj(virDomainObjPtr obj, long long offset); +virObjectEventPtr virDomainEventRTCChangeNewFromDom(virDomainPtr dom, long long offset); +virObjectEventPtr virDomainEventRTCChangeNewFromObj(virDomainObjPtr obj, long long offset); -virDomainEventPtr virDomainEventWatchdogNewFromDom(virDomainPtr dom, int action); -virDomainEventPtr virDomainEventWatchdogNewFromObj(virDomainObjPtr obj, int action); +virObjectEventPtr virDomainEventWatchdogNewFromDom(virDomainPtr dom, int action); +virObjectEventPtr virDomainEventWatchdogNewFromObj(virDomainObjPtr obj, int action); -virDomainEventPtr virDomainEventIOErrorNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventIOErrorNewFromDom(virDomainPtr dom, const char *srcPath, const char *devAlias, int action); -virDomainEventPtr virDomainEventIOErrorNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventIOErrorNewFromObj(virDomainObjPtr obj, const char *srcPath, const char *devAlias, int action); -virDomainEventPtr virDomainEventIOErrorReasonNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventIOErrorReasonNewFromDom(virDomainPtr dom, const char *srcPath, const char *devAlias, int action, const char *reason); -virDomainEventPtr virDomainEventIOErrorReasonNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventIOErrorReasonNewFromObj(virDomainObjPtr obj, const char *srcPath, const char *devAlias, int action, const char *reason); -virDomainEventPtr virDomainEventGraphicsNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventGraphicsNewFromDom(virDomainPtr dom, int phase, virDomainEventGraphicsAddressPtr local, virDomainEventGraphicsAddressPtr remote, const char *authScheme, virDomainEventGraphicsSubjectPtr subject); -virDomainEventPtr virDomainEventGraphicsNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventGraphicsNewFromObj(virDomainObjPtr obj, int phase, virDomainEventGraphicsAddressPtr local, virDomainEventGraphicsAddressPtr remote, const char *authScheme, virDomainEventGraphicsSubjectPtr subject); -virDomainEventPtr virDomainEventControlErrorNewFromDom(virDomainPtr dom); -virDomainEventPtr virDomainEventControlErrorNewFromObj(virDomainObjPtr obj); +virObjectEventPtr virDomainEventControlErrorNewFromDom(virDomainPtr dom); +virObjectEventPtr virDomainEventControlErrorNewFromObj(virDomainObjPtr obj); -virDomainEventPtr virDomainEventBlockJobNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventBlockJobNewFromObj(virDomainObjPtr obj, const char *path, int type, int status); -virDomainEventPtr virDomainEventBlockJobNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventBlockJobNewFromDom(virDomainPtr dom, const char *path, int type, int status); -virDomainEventPtr virDomainEventDiskChangeNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventDiskChangeNewFromObj(virDomainObjPtr obj, const char *oldSrcPath, const char *newSrcPath, const char *devAlias, int reason); -virDomainEventPtr virDomainEventDiskChangeNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventDiskChangeNewFromDom(virDomainPtr dom, const char *oldSrcPath, const char *newSrcPath, const char *devAlias, int reason); -virDomainEventPtr virDomainEventTrayChangeNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventTrayChangeNewFromObj(virDomainObjPtr obj, const char *devAlias, int reason); -virDomainEventPtr virDomainEventTrayChangeNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventTrayChangeNewFromDom(virDomainPtr dom, const char *devAlias, int reason); -virDomainEventPtr virDomainEventPMWakeupNewFromObj(virDomainObjPtr obj); -virDomainEventPtr virDomainEventPMWakeupNewFromDom(virDomainPtr dom); -virDomainEventPtr virDomainEventPMSuspendNewFromObj(virDomainObjPtr obj); -virDomainEventPtr virDomainEventPMSuspendNewFromDom(virDomainPtr dom); +virObjectEventPtr virDomainEventPMWakeupNewFromObj(virDomainObjPtr obj); +virObjectEventPtr virDomainEventPMWakeupNewFromDom(virDomainPtr dom); +virObjectEventPtr virDomainEventPMSuspendNewFromObj(virDomainObjPtr obj); +virObjectEventPtr virDomainEventPMSuspendNewFromDom(virDomainPtr dom); -virDomainEventPtr virDomainEventBalloonChangeNewFromDom(virDomainPtr dom, unsigned long long actual); -virDomainEventPtr virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj, unsigned long long actual); +virObjectEventPtr virDomainEventBalloonChangeNewFromDom(virDomainPtr dom, unsigned long long actual); +virObjectEventPtr virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj, unsigned long long actual); -virDomainEventPtr virDomainEventPMSuspendDiskNewFromObj(virDomainObjPtr obj); -virDomainEventPtr virDomainEventPMSuspendDiskNewFromDom(virDomainPtr dom); +virObjectEventPtr virDomainEventPMSuspendDiskNewFromObj(virDomainObjPtr obj); +virObjectEventPtr virDomainEventPMSuspendDiskNewFromDom(virDomainPtr dom); -virDomainEventPtr virDomainEventDeviceRemovedNewFromObj(virDomainObjPtr obj, +virObjectEventPtr virDomainEventDeviceRemovedNewFromObj(virDomainObjPtr obj, const char *devAlias); -virDomainEventPtr virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom, +virObjectEventPtr virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom, const char *devAlias); void virObjectEventStateFree(virObjectEventStatePtr state); @@ -163,7 +160,7 @@ typedef void (*virConnectObjectEventGenericCallback)(virConnectPtr conn, void virObjectEventStateQueue(virObjectEventStatePtr state, - virDomainEventPtr event) + virObjectEventPtr event) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int virDomainEventStateRegister(virConnectPtr conn, virObjectEventStatePtr state, diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 9a598a9..692c3b7 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -100,7 +100,7 @@ libxlDomObjFromDomain(virDomainPtr dom) } static void -libxlDomainEventQueue(libxlDriverPrivatePtr driver, virDomainEventPtr event) +libxlDomainEventQueue(libxlDriverPrivatePtr driver, virObjectEventPtr event) { virObjectEventStateQueue(driver->domainEventState, event); } @@ -359,7 +359,7 @@ libxlEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event) libxlDriverPrivatePtr driver = libxl_driver; libxlDomainObjPrivatePtr priv = ((virDomainObjPtr)data)->privateData; virDomainObjPtr vm = NULL; - virDomainEventPtr dom_event = NULL; + virObjectEventPtr dom_event = NULL; libxl_shutdown_reason xl_reason = event->u.domain_shutdown.shutdown_reason; if (event->type == LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN) { @@ -546,7 +546,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm, { libxl_domain_config d_config; virDomainDefPtr def = NULL; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; libxlSavefileHeader hdr; int ret; uint32_t domid = 0; @@ -1298,7 +1298,7 @@ libxlDomainSuspend(virDomainPtr dom) libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); virDomainObjPtr vm; libxlDomainObjPrivatePtr priv; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; if (!(vm = libxlDomObjFromDomain(dom))) @@ -1350,7 +1350,7 @@ libxlDomainResume(virDomainPtr dom) libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); virDomainObjPtr vm; libxlDomainObjPrivatePtr priv; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; if (!(vm = libxlDomObjFromDomain(dom))) @@ -1485,7 +1485,7 @@ libxlDomainDestroyFlags(virDomainPtr dom, libxlDriverPrivatePtr driver = dom->conn->privateData; virDomainObjPtr vm; int ret = -1; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virCheckFlags(0, -1); @@ -1773,7 +1773,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm, { libxlDomainObjPrivatePtr priv = vm->privateData; libxlSavefileHeader hdr; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; char *xml = NULL; uint32_t xml_len; int fd = -1; @@ -1963,7 +1963,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags) libxlDriverPrivatePtr driver = dom->conn->privateData; libxlDomainObjPrivatePtr priv; virDomainObjPtr vm; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; bool paused = false; int ret = -1; @@ -2665,7 +2665,7 @@ libxlDomainDefineXML(virConnectPtr conn, const char *xml) virDomainDefPtr def = NULL; virDomainObjPtr vm = NULL; virDomainPtr dom = NULL; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virDomainDefPtr oldDef = NULL; /* Lock the driver until the virDomainObj is created and locked */ @@ -2726,7 +2726,7 @@ libxlDomainUndefineFlags(virDomainPtr dom, libxlDriverPrivatePtr driver = dom->conn->privateData; libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); virDomainObjPtr vm; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; char *name = NULL; int ret = -1; diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 57d64b8..c499182 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -441,7 +441,7 @@ static virDomainPtr lxcDomainDefineXML(virConnectPtr conn, const char *xml) virDomainDefPtr def = NULL; virDomainObjPtr vm = NULL; virDomainPtr dom = NULL; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virDomainDefPtr oldDef = NULL; virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); virCapsPtr caps = NULL; @@ -507,7 +507,7 @@ static int lxcDomainUndefineFlags(virDomainPtr dom, { virLXCDriverPtr driver = dom->conn->privateData; virDomainObjPtr vm; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); @@ -902,7 +902,7 @@ static int lxcDomainCreateWithFiles(virDomainPtr dom, { virLXCDriverPtr driver = dom->conn->privateData; virDomainObjPtr vm; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); @@ -996,7 +996,7 @@ lxcDomainCreateXMLWithFiles(virConnectPtr conn, virDomainObjPtr vm = NULL; virDomainDefPtr def = NULL; virDomainPtr dom = NULL; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); virCapsPtr caps = NULL; @@ -1268,7 +1268,7 @@ lxcDomainDestroyFlags(virDomainPtr dom, { virLXCDriverPtr driver = dom->conn->privateData; virDomainObjPtr vm; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; virLXCDomainObjPrivatePtr priv; @@ -1481,7 +1481,7 @@ static void lxcNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque) virLXCDriverPtr driver = opaque; if (newVM) { - virDomainEventPtr event = + virObjectEventPtr event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_DEFINED, VIR_DOMAIN_EVENT_DEFINED_ADDED); @@ -2337,7 +2337,7 @@ static int lxcDomainSuspend(virDomainPtr dom) { virLXCDriverPtr driver = dom->conn->privateData; virDomainObjPtr vm; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); @@ -2383,7 +2383,7 @@ static int lxcDomainResume(virDomainPtr dom) { virLXCDriverPtr driver = dom->conn->privateData; virDomainObjPtr vm; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; virLXCDomainObjPrivatePtr priv; virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 9b5f3f2..131b5c1 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -62,7 +62,7 @@ lxcProcessAutoDestroy(virDomainObjPtr dom, void *opaque) { virLXCDriverPtr driver = opaque; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virLXCDomainObjPrivatePtr priv; VIR_DEBUG("driver=%p dom=%s conn=%p", driver, dom->def->name, conn); @@ -490,7 +490,7 @@ static void virLXCProcessMonitorEOFNotify(virLXCMonitorPtr mon, virDomainObjPtr vm) { virLXCDriverPtr driver = lxc_driver; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virLXCDomainObjPrivatePtr priv; VIR_DEBUG("mon=%p vm=%p", mon, vm); @@ -1394,7 +1394,7 @@ virLXCProcessAutostartDomain(virDomainObjPtr vm, vm->def->name, err ? err->message : ""); } else { - virDomainEventPtr event = + virObjectEventPtr event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED, VIR_DOMAIN_EVENT_STARTED_BOOTED); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a5fc8d6..e964c75 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -118,7 +118,7 @@ qemuDomainAsyncJobPhaseFromString(enum qemuDomainAsyncJob job, void qemuDomainEventQueue(virQEMUDriverPtr driver, - virDomainEventPtr event) + virObjectEventPtr event) { virObjectEventStateQueue(driver->domainEventState, event); } @@ -2117,7 +2117,7 @@ qemuDomainCheckRemoveOptionalDisk(virQEMUDriverPtr driver, virDomainDiskDefPtr disk) { char uuid[VIR_UUID_STRING_BUFLEN]; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virDomainDiskDefPtr del_disk = NULL; virUUIDFormat(vm->def->uuid, uuid); diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 77e0c20..6a92351 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -196,7 +196,7 @@ int qemuDomainAsyncJobPhaseFromString(enum qemuDomainAsyncJob job, void qemuDomainEventFlush(int timer, void *opaque); void qemuDomainEventQueue(virQEMUDriverPtr driver, - virDomainEventPtr event); + virObjectEventPtr event); int qemuDomainObjBeginJob(virQEMUDriverPtr driver, virDomainObjPtr obj, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b6be9a8..b1c4795 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -878,7 +878,7 @@ static void qemuNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque) virQEMUDriverPtr driver = opaque; if (newVM) { - virDomainEventPtr event = + virObjectEventPtr event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_DEFINED, VIR_DOMAIN_EVENT_DEFINED_ADDED); @@ -1566,8 +1566,8 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn, virDomainDefPtr def = NULL; virDomainObjPtr vm = NULL; virDomainPtr dom = NULL; - virDomainEventPtr event = NULL; - virDomainEventPtr event2 = NULL; + virObjectEventPtr event = NULL; + virObjectEventPtr event2 = NULL; unsigned int start_flags = VIR_QEMU_PROCESS_START_COLD; virQEMUCapsPtr qemuCaps = NULL; virCapsPtr caps = NULL; @@ -1668,7 +1668,7 @@ static int qemuDomainSuspend(virDomainPtr dom) { virQEMUDriverPtr driver = dom->conn->privateData; virDomainObjPtr vm; int ret = -1; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; qemuDomainObjPrivatePtr priv; virDomainPausedReason reason; int eventDetail; @@ -1749,7 +1749,7 @@ static int qemuDomainResume(virDomainPtr dom) { virQEMUDriverPtr driver = dom->conn->privateData; virDomainObjPtr vm; int ret = -1; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int state; virQEMUDriverConfigPtr cfg = NULL; virCapsPtr caps = NULL; @@ -2074,7 +2074,7 @@ qemuDomainDestroyFlags(virDomainPtr dom, virQEMUDriverPtr driver = dom->conn->privateData; virDomainObjPtr vm; int ret = -1; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; qemuDomainObjPrivatePtr priv; virCheckFlags(VIR_DOMAIN_DESTROY_GRACEFUL, -1); @@ -3037,7 +3037,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom, bool was_running = false; int ret = -1; int rc; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; qemuDomainObjPrivatePtr priv = vm->privateData; virCapsPtr caps; @@ -3517,7 +3517,7 @@ static int qemuDomainCoreDump(virDomainPtr dom, qemuDomainObjPrivatePtr priv; bool resume = false, paused = false; int ret = -1; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virCheckFlags(VIR_DUMP_LIVE | VIR_DUMP_CRASH | VIR_DUMP_BYPASS_CACHE | VIR_DUMP_RESET | @@ -3822,7 +3822,7 @@ processGuestPanicEvent(virQEMUDriverPtr driver, int action) { qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); if (!virDomainObjIsActive(vm)) { @@ -5336,7 +5336,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, bool start_paused) { int ret = -1; - virDomainEventPtr event; + virObjectEventPtr event; int intermediatefd = -1; virCommandPtr cmd = NULL; char *errbuf = NULL; @@ -6058,7 +6058,7 @@ qemuDomainObjStart(virConnectPtr conn, VIR_NETDEV_VPORT_PROFILE_OP_CREATE, start_flags); virDomainAuditStart(vm, "booted", ret >= 0); if (ret >= 0) { - virDomainEventPtr event = + virObjectEventPtr event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED, VIR_DOMAIN_EVENT_STARTED_BOOTED); @@ -6133,7 +6133,7 @@ static virDomainPtr qemuDomainDefineXML(virConnectPtr conn, const char *xml) { virDomainDefPtr oldDef = NULL; virDomainObjPtr vm = NULL; virDomainPtr dom = NULL; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virQEMUCapsPtr qemuCaps = NULL; virQEMUDriverConfigPtr cfg; virCapsPtr caps = NULL; @@ -6226,7 +6226,7 @@ qemuDomainUndefineFlags(virDomainPtr dom, { virQEMUDriverPtr driver = dom->conn->privateData; virDomainObjPtr vm; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; char *name = NULL; int ret = -1; int nsnapshots; @@ -11663,7 +11663,7 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn, { virDomainObjPtr vm = *vmptr; qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; bool resume = false; int ret = -1; @@ -12249,7 +12249,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, /* the snapshot is complete now */ if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT) { - virDomainEventPtr event; + virObjectEventPtr event; event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED, VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT); @@ -12267,7 +12267,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, /* qemu 1.3 is unable to save a domain in pm-suspended (S3) * state; so we must emit an event stating that it was * converted to paused. */ - virDomainEventPtr event; + virObjectEventPtr event; virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_FROM_SNAPSHOT); @@ -12284,7 +12284,7 @@ endjob: qemuProcessStartCPUs(driver, vm, conn, VIR_DOMAIN_RUNNING_UNPAUSED, QEMU_ASYNC_JOB_SNAPSHOT) < 0) { - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED, VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR); @@ -12944,8 +12944,8 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, virDomainObjPtr vm = NULL; int ret = -1; virDomainSnapshotObjPtr snap = NULL; - virDomainEventPtr event = NULL; - virDomainEventPtr event2 = NULL; + virObjectEventPtr event = NULL; + virObjectEventPtr event2 = NULL; int detail; qemuDomainObjPrivatePtr priv; int rc; @@ -13900,7 +13900,7 @@ cleanup: qemuProcessStartCPUs(driver, vm, conn, VIR_DOMAIN_RUNNING_UNPAUSED, QEMU_ASYNC_JOB_NONE) < 0) { - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED, VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR); @@ -13927,7 +13927,7 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm, char *device = NULL; int ret = -1; bool async = false; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int idx; virDomainDiskDefPtr disk; diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 649c884..a4c8ebf 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2427,7 +2427,7 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver, virDomainDiskDefPtr disk) { virDomainDeviceDef dev; - virDomainEventPtr event; + virObjectEventPtr event; size_t i; VIR_DEBUG("Removing disk %s from domain %p %s", @@ -2471,7 +2471,7 @@ qemuDomainRemoveControllerDevice(virQEMUDriverPtr driver, virDomainObjPtr vm, virDomainControllerDefPtr controller) { - virDomainEventPtr event; + virObjectEventPtr event; size_t i; VIR_DEBUG("Removing controller %s from domain %p %s", @@ -2559,7 +2559,7 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver, { virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virDomainNetDefPtr net = NULL; - virDomainEventPtr event; + virObjectEventPtr event; size_t i; VIR_DEBUG("Removing host device %s from domain %p %s", @@ -2630,7 +2630,7 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver, { virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virNetDevVPortProfilePtr vport; - virDomainEventPtr event; + virObjectEventPtr event; size_t i; if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_HOSTDEV) { @@ -2695,7 +2695,7 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver, virDomainObjPtr vm, virDomainChrDefPtr chr) { - virDomainEventPtr event; + virObjectEventPtr event; VIR_DEBUG("Removing character device %s from domain %p %s", chr->info.alias, vm, vm->def->name); diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 221beea..9342062 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1511,7 +1511,7 @@ qemuMigrationSetOffline(virQEMUDriverPtr driver, ret = qemuProcessStopCPUs(driver, vm, VIR_DOMAIN_PAUSED_MIGRATION, QEMU_ASYNC_JOB_MIGRATION_OUT); if (ret == 0) { - virDomainEventPtr event; + virObjectEventPtr event; event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED, @@ -2169,7 +2169,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver, unsigned long flags) { virDomainObjPtr vm = NULL; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; int dataFD[2] = { -1, -1 }; qemuDomainObjPrivatePtr priv = NULL; @@ -2702,7 +2702,7 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver, int retcode) { qemuMigrationCookiePtr mig; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int rv = -1; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); @@ -4055,7 +4055,7 @@ qemuMigrationPerformJob(virQEMUDriverPtr driver, unsigned long resource, bool v3proto) { - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; int resume = 0; virErrorPtr orig_err = NULL; @@ -4169,7 +4169,7 @@ qemuMigrationPerformPhase(virQEMUDriverPtr driver, unsigned long flags, unsigned long resource) { - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; bool resume; bool hasrefs; @@ -4365,7 +4365,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver, bool v3proto) { virDomainPtr dom = NULL; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; bool newVM = true; qemuMigrationCookiePtr mig = NULL; virErrorPtr orig_err = NULL; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 7904ee5..bbe9c68 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -286,7 +286,7 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; qemuDomainObjPrivatePtr priv; int eventReason = VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN; int stopReason = VIR_DOMAIN_SHUTOFF_SHUTDOWN; @@ -348,7 +348,7 @@ qemuProcessHandleMonitorError(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; VIR_DEBUG("Received error on %p '%s'", vm, vm->def->name); @@ -516,7 +516,7 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr event; + virObjectEventPtr event; qemuDomainObjPrivatePtr priv; virObjectLock(vm); @@ -549,7 +549,7 @@ qemuProcessFakeReboot(void *opaque) virQEMUDriverPtr driver = qemu_driver; virDomainObjPtr vm = opaque; qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virDomainRunningReason reason = VIR_DOMAIN_RUNNING_BOOTED; int ret = -1; @@ -648,7 +648,7 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED, { virQEMUDriverPtr driver = opaque; qemuDomainObjPrivatePtr priv; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); VIR_DEBUG("vm=%p", vm); @@ -702,7 +702,7 @@ qemuProcessHandleStop(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); @@ -749,7 +749,7 @@ qemuProcessHandleResume(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); @@ -803,7 +803,7 @@ qemuProcessHandleRTCChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); @@ -844,8 +844,8 @@ qemuProcessHandleWatchdog(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr watchdogEvent = NULL; - virDomainEventPtr lifecycleEvent = NULL; + virObjectEventPtr watchdogEvent = NULL; + virObjectEventPtr lifecycleEvent = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); @@ -911,9 +911,9 @@ qemuProcessHandleIOError(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr ioErrorEvent = NULL; - virDomainEventPtr ioErrorEvent2 = NULL; - virDomainEventPtr lifecycleEvent = NULL; + virObjectEventPtr ioErrorEvent = NULL; + virObjectEventPtr ioErrorEvent2 = NULL; + virObjectEventPtr lifecycleEvent = NULL; const char *srcPath; const char *devAlias; virDomainDiskDefPtr disk; @@ -972,7 +972,7 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; const char *path; virDomainDiskDefPtr disk; @@ -1025,7 +1025,7 @@ qemuProcessHandleGraphics(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr event; + virObjectEventPtr event; virDomainEventGraphicsAddressPtr localAddr = NULL; virDomainEventGraphicsAddressPtr remoteAddr = NULL; virDomainEventGraphicsSubjectPtr subject = NULL; @@ -1104,7 +1104,7 @@ qemuProcessHandleTrayChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virDomainDiskDefPtr disk; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); @@ -1140,8 +1140,8 @@ qemuProcessHandlePMWakeup(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr event = NULL; - virDomainEventPtr lifecycleEvent = NULL; + virObjectEventPtr event = NULL; + virObjectEventPtr lifecycleEvent = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); @@ -1181,8 +1181,8 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr event = NULL; - virDomainEventPtr lifecycleEvent = NULL; + virObjectEventPtr event = NULL; + virObjectEventPtr lifecycleEvent = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); @@ -1226,7 +1226,7 @@ qemuProcessHandleBalloonChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); @@ -1253,8 +1253,8 @@ qemuProcessHandlePMSuspendDisk(qemuMonitorPtr mon ATTRIBUTE_UNUSED, void *opaque) { virQEMUDriverPtr driver = opaque; - virDomainEventPtr event = NULL; - virDomainEventPtr lifecycleEvent = NULL; + virObjectEventPtr event = NULL; + virObjectEventPtr lifecycleEvent = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); @@ -4628,7 +4628,7 @@ qemuProcessAutoDestroy(virDomainObjPtr dom, { virQEMUDriverPtr driver = opaque; qemuDomainObjPrivatePtr priv = dom->privateData; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; VIR_DEBUG("vm=%s, conn=%p", dom->def->name, conn); diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 9d1a7c5..4a84a52 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -150,7 +150,7 @@ static void make_nonnull_storage_vol(remote_nonnull_storage_vol *vol_dst, virSto static void make_nonnull_secret(remote_nonnull_secret *secret_dst, virSecretPtr secret_src); static void make_nonnull_nwfilter(remote_nonnull_nwfilter *nwfilter_dst, virNWFilterPtr nwfilter_src); static void make_nonnull_domain_snapshot(remote_nonnull_domain_snapshot *snapshot_dst, virDomainSnapshotPtr snapshot_src); -static void remoteDomainEventQueue(struct private_data *priv, virDomainEventPtr event); +static void remoteDomainEventQueue(struct private_data *priv, virObjectEventPtr event); /*----------------------------------------------------------------------*/ /* Helper functions for remoteOpen. */ @@ -4380,7 +4380,7 @@ remoteDomainBuildEventLifecycle(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, struct private_data *priv = conn->privateData; remote_domain_event_lifecycle_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4402,7 +4402,7 @@ remoteDomainBuildEventReboot(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, struct private_data *priv = conn->privateData; remote_domain_event_reboot_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4424,7 +4424,7 @@ remoteDomainBuildEventRTCChange(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, struct private_data *priv = conn->privateData; remote_domain_event_rtc_change_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4446,7 +4446,7 @@ remoteDomainBuildEventWatchdog(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, struct private_data *priv = conn->privateData; remote_domain_event_watchdog_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4468,7 +4468,7 @@ remoteDomainBuildEventIOError(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, struct private_data *priv = conn->privateData; remote_domain_event_io_error_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4493,7 +4493,7 @@ remoteDomainBuildEventIOErrorReason(virNetClientProgramPtr prog ATTRIBUTE_UNUSED struct private_data *priv = conn->privateData; remote_domain_event_io_error_reason_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4519,7 +4519,7 @@ remoteDomainBuildEventBlockJob(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, struct private_data *priv = conn->privateData; remote_domain_event_block_job_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4542,7 +4542,7 @@ remoteDomainBuildEventGraphics(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, struct private_data *priv = conn->privateData; remote_domain_event_graphics_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virDomainEventGraphicsAddressPtr localAddr = NULL; virDomainEventGraphicsAddressPtr remoteAddr = NULL; virDomainEventGraphicsSubjectPtr subject = NULL; @@ -4622,7 +4622,7 @@ remoteDomainBuildEventControlError(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, struct private_data *priv = conn->privateData; remote_domain_event_control_error_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4645,7 +4645,7 @@ remoteDomainBuildEventDiskChange(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, struct private_data *priv = conn->privateData; remote_domain_event_disk_change_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4672,7 +4672,7 @@ remoteDomainBuildEventTrayChange(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, struct private_data *priv = conn->privateData; remote_domain_event_tray_change_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4696,7 +4696,7 @@ remoteDomainBuildEventPMWakeup(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, struct private_data *priv = conn->privateData; remote_domain_event_pmwakeup_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4718,7 +4718,7 @@ remoteDomainBuildEventPMSuspend(virNetClientProgramPtr prog ATTRIBUTE_UNUSED, struct private_data *priv = conn->privateData; remote_domain_event_pmsuspend_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4741,7 +4741,7 @@ remoteDomainBuildEventBalloonChange(virNetClientProgramPtr prog ATTRIBUTE_UNUSED struct private_data *priv = conn->privateData; remote_domain_event_balloon_change_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4763,7 +4763,7 @@ remoteDomainBuildEventPMSuspendDisk(virNetClientProgramPtr prog ATTRIBUTE_UNUSED struct private_data *priv = conn->privateData; remote_domain_event_pmsuspend_disk_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4786,7 +4786,7 @@ remoteDomainBuildEventDeviceRemoved(virNetClientProgramPtr prog ATTRIBUTE_UNUSED struct private_data *priv = conn->privateData; remote_domain_event_device_removed_msg *msg = evdata; virDomainPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -6690,7 +6690,7 @@ done: } static void -remoteDomainEventQueue(struct private_data *priv, virDomainEventPtr event) +remoteDomainEventQueue(struct private_data *priv, virObjectEventPtr event) { virObjectEventStateQueue(priv->domainEventState, event); } diff --git a/src/test/test_driver.c b/src/test/test_driver.c index fdd1d3e..6d2a0e2 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -122,7 +122,7 @@ static const virNodeInfo defaultNodeInfo = { static int testConnectClose(virConnectPtr conn); static void testDomainEventQueue(testConnPtr driver, - virDomainEventPtr event); + virObjectEventPtr event); static void testDriverLock(testConnPtr driver) @@ -1615,7 +1615,7 @@ testDomainCreateXML(virConnectPtr conn, const char *xml, virDomainPtr ret = NULL; virDomainDefPtr def; virDomainObjPtr dom = NULL; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virCheckFlags(0, NULL); @@ -1753,7 +1753,7 @@ static int testDomainDestroy(virDomainPtr domain) { testConnPtr privconn = domain->conn->privateData; virDomainObjPtr privdom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; testDriverLock(privconn); @@ -1790,7 +1790,7 @@ static int testDomainResume(virDomainPtr domain) { testConnPtr privconn = domain->conn->privateData; virDomainObjPtr privdom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; testDriverLock(privconn); @@ -1831,7 +1831,7 @@ static int testDomainSuspend(virDomainPtr domain) { testConnPtr privconn = domain->conn->privateData; virDomainObjPtr privdom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; int state; @@ -1875,7 +1875,7 @@ static int testDomainShutdownFlags(virDomainPtr domain, { testConnPtr privconn = domain->conn->privateData; virDomainObjPtr privdom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; virCheckFlags(0, -1); @@ -1927,7 +1927,7 @@ static int testDomainReboot(virDomainPtr domain, { testConnPtr privconn = domain->conn->privateData; virDomainObjPtr privdom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; testDriverLock(privconn); @@ -2071,7 +2071,7 @@ testDomainSaveFlags(virDomainPtr domain, const char *path, int fd = -1; int len; virDomainObjPtr privdom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; virCheckFlags(0, -1); @@ -2184,7 +2184,7 @@ testDomainRestoreFlags(virConnectPtr conn, int len; virDomainDefPtr def = NULL; virDomainObjPtr dom = NULL; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; virCheckFlags(0, -1); @@ -2284,7 +2284,7 @@ static int testDomainCoreDump(virDomainPtr domain, testConnPtr privconn = domain->conn->privateData; int fd = -1; virDomainObjPtr privdom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; virCheckFlags(VIR_DUMP_CRASH, -1); @@ -2783,7 +2783,7 @@ static virDomainPtr testDomainDefineXML(virConnectPtr conn, virDomainPtr ret = NULL; virDomainDefPtr def; virDomainObjPtr dom = NULL; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virDomainDefPtr oldDef = NULL; testDriverLock(privconn); @@ -2921,7 +2921,7 @@ cleanup: static int testDomainCreateWithFlags(virDomainPtr domain, unsigned int flags) { testConnPtr privconn = domain->conn->privateData; virDomainObjPtr privdom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; virCheckFlags(0, -1); @@ -2969,7 +2969,7 @@ static int testDomainUndefineFlags(virDomainPtr domain, { testConnPtr privconn = domain->conn->privateData; virDomainObjPtr privdom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int nsnapshots; int ret = -1; @@ -6029,7 +6029,7 @@ testConnectDomainEventDeregisterAny(virConnectPtr conn, /* driver must be locked before calling */ static void testDomainEventQueue(testConnPtr driver, - virDomainEventPtr event) + virObjectEventPtr event) { virObjectEventStateQueue(driver->domainEventState, event); } @@ -6151,7 +6151,7 @@ testDomainManagedSave(virDomainPtr dom, unsigned int flags) { testConnPtr privconn = dom->conn->privateData; virDomainObjPtr vm = NULL; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_SAVE_BYPASS_CACHE | @@ -6641,7 +6641,7 @@ testDomainSnapshotCreateXML(virDomainPtr domain, virDomainSnapshotDefPtr def = NULL; virDomainSnapshotObjPtr snap = NULL; virDomainSnapshotPtr snapshot = NULL; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; char *xml = NULL; bool update_current = true; bool redefine = flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE; @@ -6890,8 +6890,8 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, testConnPtr privconn = snapshot->domain->conn->privateData; virDomainObjPtr vm = NULL; virDomainSnapshotObjPtr snap = NULL; - virDomainEventPtr event = NULL; - virDomainEventPtr event2 = NULL; + virObjectEventPtr event = NULL; + virObjectEventPtr event2 = NULL; virDomainDefPtr config = NULL; int ret = -1; diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 4c5bac5..1784eb5 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -128,7 +128,7 @@ static int umlOpenMonitor(struct uml_driver *driver, static int umlReadPidFile(struct uml_driver *driver, virDomainObjPtr vm); static void umlDomainEventQueue(struct uml_driver *driver, - virDomainEventPtr event); + virObjectEventPtr event); static int umlStartVMDaemon(virConnectPtr conn, struct uml_driver *driver, @@ -194,7 +194,7 @@ umlAutostartDomain(virDomainObjPtr vm, VIR_ERROR(_("Failed to autostart VM '%s': %s"), vm->def->name, err ? err->message : _("unknown error")); } else { - virDomainEventPtr event = + virObjectEventPtr event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED, VIR_DOMAIN_EVENT_STARTED_BOOTED); @@ -301,7 +301,7 @@ umlInotifyEvent(int watch, char *tmp, *name; struct uml_driver *driver = data; virDomainObjPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; umlDriverLock(driver); if (watch != driver->inotifyWatch) @@ -604,7 +604,7 @@ static void umlNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque) struct uml_driver *driver = opaque; if (newVM) { - virDomainEventPtr event = + virObjectEventPtr event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_DEFINED, VIR_DOMAIN_EVENT_DEFINED_ADDED); @@ -716,7 +716,7 @@ static void umlProcessAutoDestroyDom(void *payload, const char *uuidstr = name; unsigned char uuid[VIR_UUID_BUFLEN]; virDomainObjPtr dom; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; VIR_DEBUG("conn=%p uuidstr=%s thisconn=%p", conn, uuidstr, data->conn); @@ -1571,7 +1571,7 @@ static virDomainPtr umlDomainCreateXML(virConnectPtr conn, const char *xml, virDomainDefPtr def; virDomainObjPtr vm = NULL; virDomainPtr dom = NULL; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; virCheckFlags(VIR_DOMAIN_START_AUTODESTROY, NULL); @@ -1667,7 +1667,7 @@ umlDomainDestroyFlags(virDomainPtr dom, { struct uml_driver *driver = dom->conn->privateData; virDomainObjPtr vm; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; virCheckFlags(0, -1); @@ -1993,7 +1993,7 @@ static int umlConnectNumOfDefinedDomains(virConnectPtr conn) { static int umlDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) { struct uml_driver *driver = dom->conn->privateData; virDomainObjPtr vm; - virDomainEventPtr event = NULL; + virObjectEventPtr event = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_START_AUTODESTROY, -1); @@ -2691,7 +2691,7 @@ umlConnectDomainEventDeregisterAny(virConnectPtr conn, /* driver must be locked before calling */ static void umlDomainEventQueue(struct uml_driver *driver, - virDomainEventPtr event) + virObjectEventPtr event) { virObjectEventStateQueue(driver->domainEventState, event); } diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 6e930ee..3cb65cf 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -6954,7 +6954,7 @@ vboxCallbackOnMachineStateChange(IVirtualBoxCallback *pThis ATTRIBUTE_UNUSED, dom = vboxDomainLookupByUUID(g_pVBoxGlobalData->conn, uuid); if (dom) { - virDomainEventPtr ev; + virObjectEventPtr ev; if (state == MachineState_Starting) { event = VIR_DOMAIN_EVENT_STARTED; @@ -7073,7 +7073,7 @@ vboxCallbackOnMachineRegistered(IVirtualBoxCallback *pThis ATTRIBUTE_UNUSED, dom = vboxDomainLookupByUUID(g_pVBoxGlobalData->conn, uuid); if (dom) { - virDomainEventPtr ev; + virObjectEventPtr ev; /* CURRENT LIMITATION: we never get the VIR_DOMAIN_EVENT_UNDEFINED * event because the when the machine is de-registered the call diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 82c1887..4103dc9 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -2946,7 +2946,7 @@ xenUnifiedRemoveDomainInfo(xenUnifiedDomainInfoListPtr list, * */ void xenUnifiedDomainEventDispatch(xenUnifiedPrivatePtr priv, - virDomainEventPtr event) + virObjectEventPtr event) { if (!priv) return; diff --git a/src/xen/xen_driver.h b/src/xen/xen_driver.h index a4b9149..b8c1c27 100644 --- a/src/xen/xen_driver.h +++ b/src/xen/xen_driver.h @@ -199,7 +199,7 @@ int xenUnifiedRemoveDomainInfo(xenUnifiedDomainInfoListPtr info, int id, char *name, unsigned char *uuid); void xenUnifiedDomainEventDispatch (xenUnifiedPrivatePtr priv, - virDomainEventPtr event); + virObjectEventPtr event); unsigned long xenUnifiedVersion(void); int xenUnifiedConnectGetMaxVcpus(virConnectPtr conn, const char *type); diff --git a/src/xen/xen_inotify.c b/src/xen/xen_inotify.c index defbe44..2e9787f 100644 --- a/src/xen/xen_inotify.c +++ b/src/xen/xen_inotify.c @@ -135,13 +135,13 @@ xenInotifyDomainLookup(virConnectPtr conn, return xenInotifyXendDomainsDirLookup(conn, filename, name, uuid); } -static virDomainEventPtr +static virObjectEventPtr xenInotifyDomainEventFromFile(virConnectPtr conn, const char *filename, int type, int detail) { - virDomainEventPtr event; + virObjectEventPtr event; char *name = NULL; unsigned char uuid[VIR_UUID_BUFLEN]; @@ -290,7 +290,7 @@ reread: priv->configDir, name); if (e->mask & (IN_DELETE | IN_MOVED_FROM)) { - virDomainEventPtr event = + virObjectEventPtr event = xenInotifyDomainEventFromFile(conn, fname, VIR_DOMAIN_EVENT_UNDEFINED, VIR_DOMAIN_EVENT_UNDEFINED_REMOVED); @@ -306,7 +306,7 @@ reread: goto cleanup; } } else if (e->mask & (IN_CREATE | IN_CLOSE_WRITE | IN_MOVED_TO)) { - virDomainEventPtr event; + virObjectEventPtr event; if (xenInotifyAddDomainConfigInfo(conn, fname) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Error adding file to config cache")); diff --git a/src/xen/xs_internal.c b/src/xen/xs_internal.c index c12e123..9be7591 100644 --- a/src/xen/xs_internal.c +++ b/src/xen/xs_internal.c @@ -835,7 +835,7 @@ retry: } if (!found) { - virDomainEventPtr event; + virObjectEventPtr event; char *name; unsigned char uuid[VIR_UUID_BUFLEN]; @@ -918,7 +918,7 @@ retry: } if (!found) { - virDomainEventPtr event = + virObjectEventPtr event = virDomainEventLifecycleNew(-1, priv->activeDomainList->doms[j]->name, priv->activeDomainList->doms[j]->uuid, -- 1.8.4.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list