Use virObjectEventPtr instead of virDomainEventPtr

The virDomainEvent class is kept as it indicates what meta informations
are valid for the children classes. This may be useful in the future.
This commit is contained in:
Cédric Bosdonnat 2013-11-22 15:38:05 +01:00 committed by Daniel P. Berrange
parent d4d02b206a
commit 67d91cb2bd
19 changed files with 268 additions and 263 deletions

View File

@ -55,7 +55,7 @@ typedef virObjectEventCallbackList *virObjectEventCallbackListPtr;
struct _virObjectEventQueue { struct _virObjectEventQueue {
unsigned int count; unsigned int count;
virDomainEventPtr *events; virObjectEventPtr *events;
}; };
struct _virObjectEventState { struct _virObjectEventState {
@ -112,13 +112,17 @@ static void virDomainEventDeviceRemovedDispose(void *obj);
struct _virObjectEvent { struct _virObjectEvent {
virObject parent; virObject parent;
int eventID; int eventID;
virObjectMeta meta;
}; };
struct _virDomainEvent { struct _virDomainEvent {
virObjectEvent parent; virObjectEvent parent;
virObjectMeta meta; /* Unused attribute to get virDomainEvent class being created */
bool dummy;
}; };
typedef struct _virDomainEvent virDomainEvent;
typedef virDomainEvent *virDomainEventPtr;
struct _virDomainEventLifecycle { struct _virDomainEventLifecycle {
virDomainEvent parent; virDomainEvent parent;
@ -312,6 +316,8 @@ static void virObjectEventDispose(void *obj)
virObjectEventPtr event = obj; virObjectEventPtr event = obj;
VIR_DEBUG("obj=%p", event); VIR_DEBUG("obj=%p", event);
VIR_FREE(event->meta.name);
} }
static void virDomainEventDispose(void *obj) static void virDomainEventDispose(void *obj)
@ -319,8 +325,6 @@ static void virDomainEventDispose(void *obj)
virDomainEventPtr event = obj; virDomainEventPtr event = obj;
VIR_DEBUG("obj=%p", event); VIR_DEBUG("obj=%p", event);
VIR_FREE(event->meta.name);
} }
static void virDomainEventLifecycleDispose(void *obj) static void virDomainEventLifecycleDispose(void *obj)
@ -892,7 +896,10 @@ error:
} }
static void *virObjectEventNew(virClassPtr klass, static void *virObjectEventNew(virClassPtr klass,
int eventID) int eventID,
int id,
const char *name,
const unsigned char *uuid)
{ {
virObjectEventPtr event; virObjectEventPtr event;
@ -911,6 +918,13 @@ static void *virObjectEventNew(virClassPtr klass,
event->eventID = eventID; 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); VIR_DEBUG("obj=%p", event);
return event; return event;
} }
@ -933,20 +947,14 @@ static void *virDomainEventNew(virClassPtr klass,
return NULL; return NULL;
} }
if (!(event = virObjectEventNew(klass, eventID))) if (!(event = virObjectEventNew(klass, eventID,
id, name, uuid)))
return NULL; return NULL;
if (VIR_STRDUP(event->meta.name, name) < 0) { return (virObjectEventPtr)event;
VIR_FREE(event);
return NULL;
}
event->meta.id = id;
memcpy(event->meta.uuid, uuid, VIR_UUID_BUFLEN);
return event;
} }
virDomainEventPtr virDomainEventLifecycleNew(int id, const char *name, virObjectEventPtr virDomainEventLifecycleNew(int id, const char *name,
const unsigned char *uuid, const unsigned char *uuid,
int type, int detail) int type, int detail)
{ {
@ -963,27 +971,27 @@ virDomainEventPtr virDomainEventLifecycleNew(int id, const char *name,
event->type = type; event->type = type;
event->detail = detail; 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, return virDomainEventLifecycleNew(dom->id, dom->name, dom->uuid,
type, detail); type, detail);
} }
virDomainEventPtr virDomainEventLifecycleNewFromObj(virDomainObjPtr obj, int type, int detail) virObjectEventPtr virDomainEventLifecycleNewFromObj(virDomainObjPtr obj, int type, int detail)
{ {
return virDomainEventLifecycleNewFromDef(obj->def, type, 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, return virDomainEventLifecycleNew(def->id, def->name, def->uuid,
type, detail); type, detail);
} }
virDomainEventPtr virDomainEventRebootNew(int id, const char *name, virObjectEventPtr virDomainEventRebootNew(int id, const char *name,
const unsigned char *uuid) const unsigned char *uuid)
{ {
if (virObjectEventInitialize() < 0) if (virObjectEventInitialize() < 0)
@ -994,7 +1002,7 @@ virDomainEventPtr virDomainEventRebootNew(int id, const char *name,
id, name, uuid); id, name, uuid);
} }
virDomainEventPtr virDomainEventRebootNewFromDom(virDomainPtr dom) virObjectEventPtr virDomainEventRebootNewFromDom(virDomainPtr dom)
{ {
if (virObjectEventInitialize() < 0) if (virObjectEventInitialize() < 0)
return NULL; return NULL;
@ -1004,7 +1012,7 @@ virDomainEventPtr virDomainEventRebootNewFromDom(virDomainPtr dom)
dom->id, dom->name, dom->uuid); dom->id, dom->name, dom->uuid);
} }
virDomainEventPtr virDomainEventRebootNewFromObj(virDomainObjPtr obj) virObjectEventPtr virDomainEventRebootNewFromObj(virDomainObjPtr obj)
{ {
if (virObjectEventInitialize() < 0) if (virObjectEventInitialize() < 0)
return NULL; return NULL;
@ -1014,7 +1022,7 @@ virDomainEventPtr virDomainEventRebootNewFromObj(virDomainObjPtr obj)
obj->def->id, obj->def->name, obj->def->uuid); obj->def->id, obj->def->name, obj->def->uuid);
} }
virDomainEventPtr virDomainEventRTCChangeNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventRTCChangeNewFromDom(virDomainPtr dom,
long long offset) long long offset)
{ {
virDomainEventRTCChangePtr ev; virDomainEventRTCChangePtr ev;
@ -1029,9 +1037,9 @@ virDomainEventPtr virDomainEventRTCChangeNewFromDom(virDomainPtr dom,
ev->offset = offset; ev->offset = offset;
return (virDomainEventPtr)ev; return (virObjectEventPtr)ev;
} }
virDomainEventPtr virDomainEventRTCChangeNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventRTCChangeNewFromObj(virDomainObjPtr obj,
long long offset) long long offset)
{ {
virDomainEventRTCChangePtr ev; virDomainEventRTCChangePtr ev;
@ -1047,10 +1055,10 @@ virDomainEventPtr virDomainEventRTCChangeNewFromObj(virDomainObjPtr obj,
ev->offset = offset; ev->offset = offset;
return (virDomainEventPtr)ev; return (virObjectEventPtr)ev;
} }
virDomainEventPtr virDomainEventWatchdogNewFromDom(virDomainPtr dom, int action) virObjectEventPtr virDomainEventWatchdogNewFromDom(virDomainPtr dom, int action)
{ {
virDomainEventWatchdogPtr ev; virDomainEventWatchdogPtr ev;
@ -1064,9 +1072,9 @@ virDomainEventPtr virDomainEventWatchdogNewFromDom(virDomainPtr dom, int action)
ev->action = action; ev->action = action;
return (virDomainEventPtr)ev; return (virObjectEventPtr)ev;
} }
virDomainEventPtr virDomainEventWatchdogNewFromObj(virDomainObjPtr obj, int action) virObjectEventPtr virDomainEventWatchdogNewFromObj(virDomainObjPtr obj, int action)
{ {
virDomainEventWatchdogPtr ev; virDomainEventWatchdogPtr ev;
@ -1081,10 +1089,10 @@ virDomainEventPtr virDomainEventWatchdogNewFromObj(virDomainObjPtr obj, int acti
ev->action = action; ev->action = action;
return (virDomainEventPtr)ev; return (virObjectEventPtr)ev;
} }
static virDomainEventPtr virDomainEventIOErrorNewFromDomImpl(int event, static virObjectEventPtr virDomainEventIOErrorNewFromDomImpl(int event,
virDomainPtr dom, virDomainPtr dom,
const char *srcPath, const char *srcPath,
const char *devAlias, const char *devAlias,
@ -1108,10 +1116,10 @@ static virDomainEventPtr virDomainEventIOErrorNewFromDomImpl(int event,
ev = NULL; ev = NULL;
} }
return (virDomainEventPtr)ev; return (virObjectEventPtr)ev;
} }
static virDomainEventPtr virDomainEventIOErrorNewFromObjImpl(int event, static virObjectEventPtr virDomainEventIOErrorNewFromObjImpl(int event,
virDomainObjPtr obj, virDomainObjPtr obj,
const char *srcPath, const char *srcPath,
const char *devAlias, const char *devAlias,
@ -1136,10 +1144,10 @@ static virDomainEventPtr virDomainEventIOErrorNewFromObjImpl(int event,
ev = NULL; ev = NULL;
} }
return (virDomainEventPtr)ev; return (virObjectEventPtr)ev;
} }
virDomainEventPtr virDomainEventIOErrorNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventIOErrorNewFromDom(virDomainPtr dom,
const char *srcPath, const char *srcPath,
const char *devAlias, const char *devAlias,
int action) int action)
@ -1149,7 +1157,7 @@ virDomainEventPtr virDomainEventIOErrorNewFromDom(virDomainPtr dom,
action, NULL); action, NULL);
} }
virDomainEventPtr virDomainEventIOErrorNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventIOErrorNewFromObj(virDomainObjPtr obj,
const char *srcPath, const char *srcPath,
const char *devAlias, const char *devAlias,
int action) int action)
@ -1159,7 +1167,7 @@ virDomainEventPtr virDomainEventIOErrorNewFromObj(virDomainObjPtr obj,
action, NULL); action, NULL);
} }
virDomainEventPtr virDomainEventIOErrorReasonNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventIOErrorReasonNewFromDom(virDomainPtr dom,
const char *srcPath, const char *srcPath,
const char *devAlias, const char *devAlias,
int action, int action,
@ -1170,7 +1178,7 @@ virDomainEventPtr virDomainEventIOErrorReasonNewFromDom(virDomainPtr dom,
action, reason); action, reason);
} }
virDomainEventPtr virDomainEventIOErrorReasonNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventIOErrorReasonNewFromObj(virDomainObjPtr obj,
const char *srcPath, const char *srcPath,
const char *devAlias, const char *devAlias,
int action, int action,
@ -1182,7 +1190,7 @@ virDomainEventPtr virDomainEventIOErrorReasonNewFromObj(virDomainObjPtr obj,
} }
virDomainEventPtr virDomainEventGraphicsNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventGraphicsNewFromDom(virDomainPtr dom,
int phase, int phase,
virDomainEventGraphicsAddressPtr local, virDomainEventGraphicsAddressPtr local,
virDomainEventGraphicsAddressPtr remote, virDomainEventGraphicsAddressPtr remote,
@ -1208,10 +1216,10 @@ virDomainEventPtr virDomainEventGraphicsNewFromDom(virDomainPtr dom,
ev->remote = remote; ev->remote = remote;
ev->subject = subject; ev->subject = subject;
return (virDomainEventPtr)ev; return (virObjectEventPtr)ev;
} }
virDomainEventPtr virDomainEventGraphicsNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventGraphicsNewFromObj(virDomainObjPtr obj,
int phase, int phase,
virDomainEventGraphicsAddressPtr local, virDomainEventGraphicsAddressPtr local,
virDomainEventGraphicsAddressPtr remote, virDomainEventGraphicsAddressPtr remote,
@ -1238,11 +1246,11 @@ virDomainEventPtr virDomainEventGraphicsNewFromObj(virDomainObjPtr obj,
ev->remote = remote; ev->remote = remote;
ev->subject = subject; ev->subject = subject;
return (virDomainEventPtr)ev; return (virObjectEventPtr)ev;
} }
static static
virDomainEventPtr virDomainEventBlockJobNew(int id, virObjectEventPtr virDomainEventBlockJobNew(int id,
const char *name, const char *name,
unsigned char *uuid, unsigned char *uuid,
const char *path, const char *path,
@ -1266,10 +1274,10 @@ virDomainEventPtr virDomainEventBlockJobNew(int id,
ev->type = type; ev->type = type;
ev->status = status; ev->status = status;
return (virDomainEventPtr)ev; return (virObjectEventPtr)ev;
} }
virDomainEventPtr virDomainEventBlockJobNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventBlockJobNewFromObj(virDomainObjPtr obj,
const char *path, const char *path,
int type, int type,
int status) int status)
@ -1278,7 +1286,7 @@ virDomainEventPtr virDomainEventBlockJobNewFromObj(virDomainObjPtr obj,
obj->def->uuid, path, type, status); obj->def->uuid, path, type, status);
} }
virDomainEventPtr virDomainEventBlockJobNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventBlockJobNewFromDom(virDomainPtr dom,
const char *path, const char *path,
int type, int type,
int status) int status)
@ -1287,9 +1295,9 @@ virDomainEventPtr virDomainEventBlockJobNewFromDom(virDomainPtr dom,
path, type, status); path, type, status);
} }
virDomainEventPtr virDomainEventControlErrorNewFromDom(virDomainPtr dom) virObjectEventPtr virDomainEventControlErrorNewFromDom(virDomainPtr dom)
{ {
virDomainEventPtr ev; virObjectEventPtr ev;
if (virObjectEventInitialize() < 0) if (virObjectEventInitialize() < 0)
return NULL; return NULL;
@ -1302,9 +1310,9 @@ virDomainEventPtr virDomainEventControlErrorNewFromDom(virDomainPtr dom)
} }
virDomainEventPtr virDomainEventControlErrorNewFromObj(virDomainObjPtr obj) virObjectEventPtr virDomainEventControlErrorNewFromObj(virDomainObjPtr obj)
{ {
virDomainEventPtr ev; virObjectEventPtr ev;
if (virObjectEventInitialize() < 0) if (virObjectEventInitialize() < 0)
return NULL; return NULL;
@ -1318,7 +1326,7 @@ virDomainEventPtr virDomainEventControlErrorNewFromObj(virDomainObjPtr obj)
} }
static static
virDomainEventPtr virDomainEventDiskChangeNew(int id, const char *name, virObjectEventPtr virDomainEventDiskChangeNew(int id, const char *name,
unsigned char *uuid, unsigned char *uuid,
const char *oldSrcPath, const char *oldSrcPath,
const char *newSrcPath, const char *newSrcPath,
@ -1345,14 +1353,14 @@ virDomainEventPtr virDomainEventDiskChangeNew(int id, const char *name,
ev->reason = reason; ev->reason = reason;
return (virDomainEventPtr)ev; return (virObjectEventPtr)ev;
error: error:
virObjectUnref(ev); virObjectUnref(ev);
return NULL; return NULL;
} }
virDomainEventPtr virDomainEventDiskChangeNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventDiskChangeNewFromObj(virDomainObjPtr obj,
const char *oldSrcPath, const char *oldSrcPath,
const char *newSrcPath, const char *newSrcPath,
const char *devAlias, const char *devAlias,
@ -1363,7 +1371,7 @@ virDomainEventPtr virDomainEventDiskChangeNewFromObj(virDomainObjPtr obj,
newSrcPath, devAlias, reason); newSrcPath, devAlias, reason);
} }
virDomainEventPtr virDomainEventDiskChangeNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventDiskChangeNewFromDom(virDomainPtr dom,
const char *oldSrcPath, const char *oldSrcPath,
const char *newSrcPath, const char *newSrcPath,
const char *devAlias, const char *devAlias,
@ -1374,7 +1382,7 @@ virDomainEventPtr virDomainEventDiskChangeNewFromDom(virDomainPtr dom,
devAlias, reason); devAlias, reason);
} }
static virDomainEventPtr static virObjectEventPtr
virDomainEventTrayChangeNew(int id, const char *name, virDomainEventTrayChangeNew(int id, const char *name,
unsigned char *uuid, unsigned char *uuid,
const char *devAlias, const char *devAlias,
@ -1395,14 +1403,14 @@ virDomainEventTrayChangeNew(int id, const char *name,
ev->reason = reason; ev->reason = reason;
return (virDomainEventPtr)ev; return (virObjectEventPtr)ev;
error: error:
virObjectUnref(ev); virObjectUnref(ev);
return NULL; return NULL;
} }
virDomainEventPtr virDomainEventTrayChangeNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventTrayChangeNewFromObj(virDomainObjPtr obj,
const char *devAlias, const char *devAlias,
int reason) int reason)
{ {
@ -1413,7 +1421,7 @@ virDomainEventPtr virDomainEventTrayChangeNewFromObj(virDomainObjPtr obj,
reason); reason);
} }
virDomainEventPtr virDomainEventTrayChangeNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventTrayChangeNewFromDom(virDomainPtr dom,
const char *devAlias, const char *devAlias,
int reason) int reason)
{ {
@ -1421,11 +1429,11 @@ virDomainEventPtr virDomainEventTrayChangeNewFromDom(virDomainPtr dom,
devAlias, reason); devAlias, reason);
} }
static virDomainEventPtr static virObjectEventPtr
virDomainEventPMWakeupNew(int id, const char *name, virDomainEventPMWakeupNew(int id, const char *name,
unsigned char *uuid) unsigned char *uuid)
{ {
virDomainEventPtr ev; virObjectEventPtr ev;
if (virObjectEventInitialize() < 0) if (virObjectEventInitialize() < 0)
return NULL; return NULL;
@ -1438,7 +1446,7 @@ virDomainEventPMWakeupNew(int id, const char *name,
return ev; return ev;
} }
virDomainEventPtr virObjectEventPtr
virDomainEventPMWakeupNewFromObj(virDomainObjPtr obj) virDomainEventPMWakeupNewFromObj(virDomainObjPtr obj)
{ {
return virDomainEventPMWakeupNew(obj->def->id, return virDomainEventPMWakeupNew(obj->def->id,
@ -1446,17 +1454,17 @@ virDomainEventPMWakeupNewFromObj(virDomainObjPtr obj)
obj->def->uuid); obj->def->uuid);
} }
virDomainEventPtr virObjectEventPtr
virDomainEventPMWakeupNewFromDom(virDomainPtr dom) virDomainEventPMWakeupNewFromDom(virDomainPtr dom)
{ {
return virDomainEventPMWakeupNew(dom->id, dom->name, dom->uuid); return virDomainEventPMWakeupNew(dom->id, dom->name, dom->uuid);
} }
static virDomainEventPtr static virObjectEventPtr
virDomainEventPMSuspendNew(int id, const char *name, virDomainEventPMSuspendNew(int id, const char *name,
unsigned char *uuid) unsigned char *uuid)
{ {
virDomainEventPtr ev; virObjectEventPtr ev;
if (virObjectEventInitialize() < 0) if (virObjectEventInitialize() < 0)
return NULL; return NULL;
@ -1469,7 +1477,7 @@ virDomainEventPMSuspendNew(int id, const char *name,
return ev; return ev;
} }
virDomainEventPtr virObjectEventPtr
virDomainEventPMSuspendNewFromObj(virDomainObjPtr obj) virDomainEventPMSuspendNewFromObj(virDomainObjPtr obj)
{ {
return virDomainEventPMSuspendNew(obj->def->id, return virDomainEventPMSuspendNew(obj->def->id,
@ -1477,17 +1485,17 @@ virDomainEventPMSuspendNewFromObj(virDomainObjPtr obj)
obj->def->uuid); obj->def->uuid);
} }
virDomainEventPtr virObjectEventPtr
virDomainEventPMSuspendNewFromDom(virDomainPtr dom) virDomainEventPMSuspendNewFromDom(virDomainPtr dom)
{ {
return virDomainEventPMSuspendNew(dom->id, dom->name, dom->uuid); return virDomainEventPMSuspendNew(dom->id, dom->name, dom->uuid);
} }
static virDomainEventPtr static virObjectEventPtr
virDomainEventPMSuspendDiskNew(int id, const char *name, virDomainEventPMSuspendDiskNew(int id, const char *name,
unsigned char *uuid) unsigned char *uuid)
{ {
virDomainEventPtr ev; virObjectEventPtr ev;
if (virObjectEventInitialize() < 0) if (virObjectEventInitialize() < 0)
return NULL; return NULL;
@ -1499,7 +1507,7 @@ virDomainEventPMSuspendDiskNew(int id, const char *name,
return ev; return ev;
} }
virDomainEventPtr virObjectEventPtr
virDomainEventPMSuspendDiskNewFromObj(virDomainObjPtr obj) virDomainEventPMSuspendDiskNewFromObj(virDomainObjPtr obj)
{ {
return virDomainEventPMSuspendDiskNew(obj->def->id, return virDomainEventPMSuspendDiskNew(obj->def->id,
@ -1507,13 +1515,13 @@ virDomainEventPMSuspendDiskNewFromObj(virDomainObjPtr obj)
obj->def->uuid); obj->def->uuid);
} }
virDomainEventPtr virObjectEventPtr
virDomainEventPMSuspendDiskNewFromDom(virDomainPtr dom) virDomainEventPMSuspendDiskNewFromDom(virDomainPtr dom)
{ {
return virDomainEventPMSuspendDiskNew(dom->id, dom->name, dom->uuid); return virDomainEventPMSuspendDiskNew(dom->id, dom->name, dom->uuid);
} }
virDomainEventPtr virDomainEventBalloonChangeNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventBalloonChangeNewFromDom(virDomainPtr dom,
unsigned long long actual) unsigned long long actual)
{ {
virDomainEventBalloonChangePtr ev; virDomainEventBalloonChangePtr ev;
@ -1528,9 +1536,9 @@ virDomainEventPtr virDomainEventBalloonChangeNewFromDom(virDomainPtr dom,
ev->actual = actual; ev->actual = actual;
return (virDomainEventPtr)ev; return (virObjectEventPtr)ev;
} }
virDomainEventPtr virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj,
unsigned long long actual) unsigned long long actual)
{ {
virDomainEventBalloonChangePtr ev; virDomainEventBalloonChangePtr ev;
@ -1545,10 +1553,10 @@ virDomainEventPtr virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj,
ev->actual = actual; ev->actual = actual;
return (virDomainEventPtr)ev; return (virObjectEventPtr)ev;
} }
static virDomainEventPtr virDomainEventDeviceRemovedNew(int id, static virObjectEventPtr virDomainEventDeviceRemovedNew(int id,
const char *name, const char *name,
unsigned char *uuid, unsigned char *uuid,
const char *devAlias) const char *devAlias)
@ -1566,21 +1574,21 @@ static virDomainEventPtr virDomainEventDeviceRemovedNew(int id,
if (VIR_STRDUP(ev->devAlias, devAlias) < 0) if (VIR_STRDUP(ev->devAlias, devAlias) < 0)
goto error; goto error;
return (virDomainEventPtr)ev; return (virObjectEventPtr)ev;
error: error:
virObjectUnref(ev); virObjectUnref(ev);
return NULL; return NULL;
} }
virDomainEventPtr virDomainEventDeviceRemovedNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventDeviceRemovedNewFromObj(virDomainObjPtr obj,
const char *devAlias) const char *devAlias)
{ {
return virDomainEventDeviceRemovedNew(obj->def->id, obj->def->name, return virDomainEventDeviceRemovedNew(obj->def->id, obj->def->name,
obj->def->uuid, devAlias); obj->def->uuid, devAlias);
} }
virDomainEventPtr virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom,
const char *devAlias) const char *devAlias)
{ {
return virDomainEventDeviceRemovedNew(dom->id, dom->name, dom->uuid, return virDomainEventDeviceRemovedNew(dom->id, dom->name, dom->uuid,
@ -1598,7 +1606,7 @@ virDomainEventPtr virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom,
*/ */
static int static int
virObjectEventQueuePush(virObjectEventQueuePtr evtQueue, virObjectEventQueuePush(virObjectEventQueuePtr evtQueue,
virDomainEventPtr event) virObjectEventPtr event)
{ {
if (!evtQueue) { if (!evtQueue) {
return -1; return -1;
@ -1616,7 +1624,7 @@ virObjectEventQueuePush(virObjectEventQueuePtr evtQueue,
typedef void (*virObjectEventDispatchFunc)(virConnectPtr conn, typedef void (*virObjectEventDispatchFunc)(virConnectPtr conn,
virDomainEventPtr event, virObjectEventPtr event,
virConnectObjectEventGenericCallback cb, virConnectObjectEventGenericCallback cb,
void *cbopaque, void *cbopaque,
void *opaque); void *opaque);
@ -1624,7 +1632,7 @@ typedef void (*virObjectEventDispatchFunc)(virConnectPtr conn,
static void static void
virDomainEventDispatchDefaultFunc(virConnectPtr conn, virDomainEventDispatchDefaultFunc(virConnectPtr conn,
virDomainEventPtr event, virObjectEventPtr event,
virConnectDomainEventGenericCallback cb, virConnectDomainEventGenericCallback cb,
void *cbopaque, void *cbopaque,
void *opaque ATTRIBUTE_UNUSED) void *opaque ATTRIBUTE_UNUSED)
@ -1806,7 +1814,7 @@ cleanup:
} }
static int virDomainEventDispatchMatchCallback(virDomainEventPtr event, static int virObjectEventDispatchMatchCallback(virObjectEventPtr event,
virObjectEventCallbackPtr cb) virObjectEventCallbackPtr cb)
{ {
if (!cb) if (!cb)
@ -1834,7 +1842,7 @@ static int virDomainEventDispatchMatchCallback(virDomainEventPtr event,
static void static void
virDomainEventDispatch(virDomainEventPtr event, virObjectEventDispatch(virObjectEventPtr event,
virObjectEventCallbackListPtr callbacks, virObjectEventCallbackListPtr callbacks,
virObjectEventDispatchFunc dispatch, virObjectEventDispatchFunc dispatch,
void *opaque) void *opaque)
@ -1846,7 +1854,7 @@ virDomainEventDispatch(virDomainEventPtr event,
int cbCount = callbacks->count; int cbCount = callbacks->count;
for (i = 0; i < cbCount; i++) { for (i = 0; i < cbCount; i++) {
if (!virDomainEventDispatchMatchCallback(event, callbacks->callbacks[i])) if (!virObjectEventDispatchMatchCallback(event, callbacks->callbacks[i]))
continue; continue;
(*dispatch)(callbacks->callbacks[i]->conn, (*dispatch)(callbacks->callbacks[i]->conn,
@ -1867,7 +1875,7 @@ virObjectEventQueueDispatch(virObjectEventQueuePtr queue,
size_t i; size_t i;
for (i = 0; i < queue->count; 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]); virObjectUnref(queue->events[i]);
} }
VIR_FREE(queue->events); VIR_FREE(queue->events);
@ -1876,7 +1884,7 @@ virObjectEventQueueDispatch(virObjectEventQueuePtr queue,
void void
virObjectEventStateQueue(virObjectEventStatePtr state, virObjectEventStateQueue(virObjectEventStatePtr state,
virDomainEventPtr event) virObjectEventPtr event)
{ {
if (state->timer < 0) { if (state->timer < 0) {
virObjectUnref(event); virObjectUnref(event);
@ -1898,7 +1906,7 @@ virObjectEventStateQueue(virObjectEventStatePtr state,
static void static void
virObjectEventStateDispatchFunc(virConnectPtr conn, virObjectEventStateDispatchFunc(virConnectPtr conn,
virDomainEventPtr event, virObjectEventPtr event,
virConnectObjectEventGenericCallback cb, virConnectObjectEventGenericCallback cb,
void *cbopaque, void *cbopaque,
void *opaque) void *opaque)

View File

@ -38,110 +38,107 @@ typedef virObjectEventCallback *virObjectEventCallbackPtr;
typedef struct _virObjectEvent virObjectEvent; typedef struct _virObjectEvent virObjectEvent;
typedef virObjectEvent *virObjectEventPtr; typedef virObjectEvent *virObjectEventPtr;
typedef struct _virDomainEvent virDomainEvent;
typedef virDomainEvent *virDomainEventPtr;
typedef struct _virObjectEventState virObjectEventState; typedef struct _virObjectEventState virObjectEventState;
typedef virObjectEventState *virObjectEventStatePtr; typedef virObjectEventState *virObjectEventStatePtr;
virDomainEventPtr virDomainEventLifecycleNew(int id, virObjectEventPtr virDomainEventLifecycleNew(int id,
const char *name, const char *name,
const unsigned char *uuid, const unsigned char *uuid,
int type, int type,
int detail); int detail);
virDomainEventPtr virDomainEventLifecycleNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventLifecycleNewFromDom(virDomainPtr dom,
int type, int type,
int detail); int detail);
virDomainEventPtr virDomainEventLifecycleNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventLifecycleNewFromObj(virDomainObjPtr obj,
int type, int type,
int detail); int detail);
virDomainEventPtr virDomainEventLifecycleNewFromDef(virDomainDefPtr def, virObjectEventPtr virDomainEventLifecycleNewFromDef(virDomainDefPtr def,
int type, int type,
int detail); int detail);
virDomainEventPtr virDomainEventRebootNew(int id, const char *name, const unsigned char *uuid); virObjectEventPtr virDomainEventRebootNew(int id, const char *name, const unsigned char *uuid);
virDomainEventPtr virDomainEventRebootNewFromDom(virDomainPtr dom); virObjectEventPtr virDomainEventRebootNewFromDom(virDomainPtr dom);
virDomainEventPtr virDomainEventRebootNewFromObj(virDomainObjPtr obj); virObjectEventPtr virDomainEventRebootNewFromObj(virDomainObjPtr obj);
virDomainEventPtr virDomainEventRTCChangeNewFromDom(virDomainPtr dom, long long offset); virObjectEventPtr virDomainEventRTCChangeNewFromDom(virDomainPtr dom, long long offset);
virDomainEventPtr virDomainEventRTCChangeNewFromObj(virDomainObjPtr obj, long long offset); virObjectEventPtr virDomainEventRTCChangeNewFromObj(virDomainObjPtr obj, long long offset);
virDomainEventPtr virDomainEventWatchdogNewFromDom(virDomainPtr dom, int action); virObjectEventPtr virDomainEventWatchdogNewFromDom(virDomainPtr dom, int action);
virDomainEventPtr virDomainEventWatchdogNewFromObj(virDomainObjPtr obj, int action); virObjectEventPtr virDomainEventWatchdogNewFromObj(virDomainObjPtr obj, int action);
virDomainEventPtr virDomainEventIOErrorNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventIOErrorNewFromDom(virDomainPtr dom,
const char *srcPath, const char *srcPath,
const char *devAlias, const char *devAlias,
int action); int action);
virDomainEventPtr virDomainEventIOErrorNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventIOErrorNewFromObj(virDomainObjPtr obj,
const char *srcPath, const char *srcPath,
const char *devAlias, const char *devAlias,
int action); int action);
virDomainEventPtr virDomainEventIOErrorReasonNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventIOErrorReasonNewFromDom(virDomainPtr dom,
const char *srcPath, const char *srcPath,
const char *devAlias, const char *devAlias,
int action, int action,
const char *reason); const char *reason);
virDomainEventPtr virDomainEventIOErrorReasonNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventIOErrorReasonNewFromObj(virDomainObjPtr obj,
const char *srcPath, const char *srcPath,
const char *devAlias, const char *devAlias,
int action, int action,
const char *reason); const char *reason);
virDomainEventPtr virDomainEventGraphicsNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventGraphicsNewFromDom(virDomainPtr dom,
int phase, int phase,
virDomainEventGraphicsAddressPtr local, virDomainEventGraphicsAddressPtr local,
virDomainEventGraphicsAddressPtr remote, virDomainEventGraphicsAddressPtr remote,
const char *authScheme, const char *authScheme,
virDomainEventGraphicsSubjectPtr subject); virDomainEventGraphicsSubjectPtr subject);
virDomainEventPtr virDomainEventGraphicsNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventGraphicsNewFromObj(virDomainObjPtr obj,
int phase, int phase,
virDomainEventGraphicsAddressPtr local, virDomainEventGraphicsAddressPtr local,
virDomainEventGraphicsAddressPtr remote, virDomainEventGraphicsAddressPtr remote,
const char *authScheme, const char *authScheme,
virDomainEventGraphicsSubjectPtr subject); virDomainEventGraphicsSubjectPtr subject);
virDomainEventPtr virDomainEventControlErrorNewFromDom(virDomainPtr dom); virObjectEventPtr virDomainEventControlErrorNewFromDom(virDomainPtr dom);
virDomainEventPtr virDomainEventControlErrorNewFromObj(virDomainObjPtr obj); virObjectEventPtr virDomainEventControlErrorNewFromObj(virDomainObjPtr obj);
virDomainEventPtr virDomainEventBlockJobNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventBlockJobNewFromObj(virDomainObjPtr obj,
const char *path, const char *path,
int type, int type,
int status); int status);
virDomainEventPtr virDomainEventBlockJobNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventBlockJobNewFromDom(virDomainPtr dom,
const char *path, const char *path,
int type, int type,
int status); int status);
virDomainEventPtr virDomainEventDiskChangeNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventDiskChangeNewFromObj(virDomainObjPtr obj,
const char *oldSrcPath, const char *oldSrcPath,
const char *newSrcPath, const char *newSrcPath,
const char *devAlias, const char *devAlias,
int reason); int reason);
virDomainEventPtr virDomainEventDiskChangeNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventDiskChangeNewFromDom(virDomainPtr dom,
const char *oldSrcPath, const char *oldSrcPath,
const char *newSrcPath, const char *newSrcPath,
const char *devAlias, const char *devAlias,
int reason); int reason);
virDomainEventPtr virDomainEventTrayChangeNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventTrayChangeNewFromObj(virDomainObjPtr obj,
const char *devAlias, const char *devAlias,
int reason); int reason);
virDomainEventPtr virDomainEventTrayChangeNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventTrayChangeNewFromDom(virDomainPtr dom,
const char *devAlias, const char *devAlias,
int reason); int reason);
virDomainEventPtr virDomainEventPMWakeupNewFromObj(virDomainObjPtr obj); virObjectEventPtr virDomainEventPMWakeupNewFromObj(virDomainObjPtr obj);
virDomainEventPtr virDomainEventPMWakeupNewFromDom(virDomainPtr dom); virObjectEventPtr virDomainEventPMWakeupNewFromDom(virDomainPtr dom);
virDomainEventPtr virDomainEventPMSuspendNewFromObj(virDomainObjPtr obj); virObjectEventPtr virDomainEventPMSuspendNewFromObj(virDomainObjPtr obj);
virDomainEventPtr virDomainEventPMSuspendNewFromDom(virDomainPtr dom); virObjectEventPtr virDomainEventPMSuspendNewFromDom(virDomainPtr dom);
virDomainEventPtr virDomainEventBalloonChangeNewFromDom(virDomainPtr dom, unsigned long long actual); virObjectEventPtr virDomainEventBalloonChangeNewFromDom(virDomainPtr dom, unsigned long long actual);
virDomainEventPtr virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj, unsigned long long actual); virObjectEventPtr virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj, unsigned long long actual);
virDomainEventPtr virDomainEventPMSuspendDiskNewFromObj(virDomainObjPtr obj); virObjectEventPtr virDomainEventPMSuspendDiskNewFromObj(virDomainObjPtr obj);
virDomainEventPtr virDomainEventPMSuspendDiskNewFromDom(virDomainPtr dom); virObjectEventPtr virDomainEventPMSuspendDiskNewFromDom(virDomainPtr dom);
virDomainEventPtr virDomainEventDeviceRemovedNewFromObj(virDomainObjPtr obj, virObjectEventPtr virDomainEventDeviceRemovedNewFromObj(virDomainObjPtr obj,
const char *devAlias); const char *devAlias);
virDomainEventPtr virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom, virObjectEventPtr virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom,
const char *devAlias); const char *devAlias);
void virObjectEventStateFree(virObjectEventStatePtr state); void virObjectEventStateFree(virObjectEventStatePtr state);
@ -163,7 +160,7 @@ typedef void (*virConnectObjectEventGenericCallback)(virConnectPtr conn,
void void
virObjectEventStateQueue(virObjectEventStatePtr state, virObjectEventStateQueue(virObjectEventStatePtr state,
virDomainEventPtr event) virObjectEventPtr event)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int virDomainEventStateRegister(virConnectPtr conn, int virDomainEventStateRegister(virConnectPtr conn,
virObjectEventStatePtr state, virObjectEventStatePtr state,

View File

@ -100,7 +100,7 @@ libxlDomObjFromDomain(virDomainPtr dom)
} }
static void static void
libxlDomainEventQueue(libxlDriverPrivatePtr driver, virDomainEventPtr event) libxlDomainEventQueue(libxlDriverPrivatePtr driver, virObjectEventPtr event)
{ {
virObjectEventStateQueue(driver->domainEventState, event); virObjectEventStateQueue(driver->domainEventState, event);
} }
@ -359,7 +359,7 @@ libxlEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event)
libxlDriverPrivatePtr driver = libxl_driver; libxlDriverPrivatePtr driver = libxl_driver;
libxlDomainObjPrivatePtr priv = ((virDomainObjPtr)data)->privateData; libxlDomainObjPrivatePtr priv = ((virDomainObjPtr)data)->privateData;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainEventPtr dom_event = NULL; virObjectEventPtr dom_event = NULL;
libxl_shutdown_reason xl_reason = event->u.domain_shutdown.shutdown_reason; libxl_shutdown_reason xl_reason = event->u.domain_shutdown.shutdown_reason;
if (event->type == LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN) { if (event->type == LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN) {
@ -546,7 +546,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
{ {
libxl_domain_config d_config; libxl_domain_config d_config;
virDomainDefPtr def = NULL; virDomainDefPtr def = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
libxlSavefileHeader hdr; libxlSavefileHeader hdr;
int ret; int ret;
uint32_t domid = 0; uint32_t domid = 0;
@ -1298,7 +1298,7 @@ libxlDomainSuspend(virDomainPtr dom)
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
virDomainObjPtr vm; virDomainObjPtr vm;
libxlDomainObjPrivatePtr priv; libxlDomainObjPrivatePtr priv;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
if (!(vm = libxlDomObjFromDomain(dom))) if (!(vm = libxlDomObjFromDomain(dom)))
@ -1350,7 +1350,7 @@ libxlDomainResume(virDomainPtr dom)
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
virDomainObjPtr vm; virDomainObjPtr vm;
libxlDomainObjPrivatePtr priv; libxlDomainObjPrivatePtr priv;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
if (!(vm = libxlDomObjFromDomain(dom))) if (!(vm = libxlDomObjFromDomain(dom)))
@ -1485,7 +1485,7 @@ libxlDomainDestroyFlags(virDomainPtr dom,
libxlDriverPrivatePtr driver = dom->conn->privateData; libxlDriverPrivatePtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
int ret = -1; int ret = -1;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virCheckFlags(0, -1); virCheckFlags(0, -1);
@ -1773,7 +1773,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
{ {
libxlDomainObjPrivatePtr priv = vm->privateData; libxlDomainObjPrivatePtr priv = vm->privateData;
libxlSavefileHeader hdr; libxlSavefileHeader hdr;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
char *xml = NULL; char *xml = NULL;
uint32_t xml_len; uint32_t xml_len;
int fd = -1; int fd = -1;
@ -1963,7 +1963,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
libxlDriverPrivatePtr driver = dom->conn->privateData; libxlDriverPrivatePtr driver = dom->conn->privateData;
libxlDomainObjPrivatePtr priv; libxlDomainObjPrivatePtr priv;
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
bool paused = false; bool paused = false;
int ret = -1; int ret = -1;
@ -2665,7 +2665,7 @@ libxlDomainDefineXML(virConnectPtr conn, const char *xml)
virDomainDefPtr def = NULL; virDomainDefPtr def = NULL;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainPtr dom = NULL; virDomainPtr dom = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virDomainDefPtr oldDef = NULL; virDomainDefPtr oldDef = NULL;
/* Lock the driver until the virDomainObj is created and locked */ /* Lock the driver until the virDomainObj is created and locked */
@ -2726,7 +2726,7 @@ libxlDomainUndefineFlags(virDomainPtr dom,
libxlDriverPrivatePtr driver = dom->conn->privateData; libxlDriverPrivatePtr driver = dom->conn->privateData;
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
char *name = NULL; char *name = NULL;
int ret = -1; int ret = -1;

View File

@ -441,7 +441,7 @@ static virDomainPtr lxcDomainDefineXML(virConnectPtr conn, const char *xml)
virDomainDefPtr def = NULL; virDomainDefPtr def = NULL;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainPtr dom = NULL; virDomainPtr dom = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virDomainDefPtr oldDef = NULL; virDomainDefPtr oldDef = NULL;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
virCapsPtr caps = NULL; virCapsPtr caps = NULL;
@ -507,7 +507,7 @@ static int lxcDomainUndefineFlags(virDomainPtr dom,
{ {
virLXCDriverPtr driver = dom->conn->privateData; virLXCDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
@ -902,7 +902,7 @@ static int lxcDomainCreateWithFiles(virDomainPtr dom,
{ {
virLXCDriverPtr driver = dom->conn->privateData; virLXCDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
@ -996,7 +996,7 @@ lxcDomainCreateXMLWithFiles(virConnectPtr conn,
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainDefPtr def = NULL; virDomainDefPtr def = NULL;
virDomainPtr dom = NULL; virDomainPtr dom = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
virCapsPtr caps = NULL; virCapsPtr caps = NULL;
@ -1268,7 +1268,7 @@ lxcDomainDestroyFlags(virDomainPtr dom,
{ {
virLXCDriverPtr driver = dom->conn->privateData; virLXCDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
virLXCDomainObjPrivatePtr priv; virLXCDomainObjPrivatePtr priv;
@ -1481,7 +1481,7 @@ static void lxcNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque)
virLXCDriverPtr driver = opaque; virLXCDriverPtr driver = opaque;
if (newVM) { if (newVM) {
virDomainEventPtr event = virObjectEventPtr event =
virDomainEventLifecycleNewFromObj(vm, virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_DEFINED, VIR_DOMAIN_EVENT_DEFINED,
VIR_DOMAIN_EVENT_DEFINED_ADDED); VIR_DOMAIN_EVENT_DEFINED_ADDED);
@ -2337,7 +2337,7 @@ static int lxcDomainSuspend(virDomainPtr dom)
{ {
virLXCDriverPtr driver = dom->conn->privateData; virLXCDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
@ -2383,7 +2383,7 @@ static int lxcDomainResume(virDomainPtr dom)
{ {
virLXCDriverPtr driver = dom->conn->privateData; virLXCDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
virLXCDomainObjPrivatePtr priv; virLXCDomainObjPrivatePtr priv;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);

View File

@ -62,7 +62,7 @@ lxcProcessAutoDestroy(virDomainObjPtr dom,
void *opaque) void *opaque)
{ {
virLXCDriverPtr driver = opaque; virLXCDriverPtr driver = opaque;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virLXCDomainObjPrivatePtr priv; virLXCDomainObjPrivatePtr priv;
VIR_DEBUG("driver=%p dom=%s conn=%p", driver, dom->def->name, conn); VIR_DEBUG("driver=%p dom=%s conn=%p", driver, dom->def->name, conn);
@ -490,7 +490,7 @@ static void virLXCProcessMonitorEOFNotify(virLXCMonitorPtr mon,
virDomainObjPtr vm) virDomainObjPtr vm)
{ {
virLXCDriverPtr driver = lxc_driver; virLXCDriverPtr driver = lxc_driver;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virLXCDomainObjPrivatePtr priv; virLXCDomainObjPrivatePtr priv;
VIR_DEBUG("mon=%p vm=%p", mon, vm); VIR_DEBUG("mon=%p vm=%p", mon, vm);
@ -1394,7 +1394,7 @@ virLXCProcessAutostartDomain(virDomainObjPtr vm,
vm->def->name, vm->def->name,
err ? err->message : ""); err ? err->message : "");
} else { } else {
virDomainEventPtr event = virObjectEventPtr event =
virDomainEventLifecycleNewFromObj(vm, virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_STARTED, VIR_DOMAIN_EVENT_STARTED,
VIR_DOMAIN_EVENT_STARTED_BOOTED); VIR_DOMAIN_EVENT_STARTED_BOOTED);

View File

@ -118,7 +118,7 @@ qemuDomainAsyncJobPhaseFromString(enum qemuDomainAsyncJob job,
void qemuDomainEventQueue(virQEMUDriverPtr driver, void qemuDomainEventQueue(virQEMUDriverPtr driver,
virDomainEventPtr event) virObjectEventPtr event)
{ {
virObjectEventStateQueue(driver->domainEventState, event); virObjectEventStateQueue(driver->domainEventState, event);
} }
@ -2117,7 +2117,7 @@ qemuDomainCheckRemoveOptionalDisk(virQEMUDriverPtr driver,
virDomainDiskDefPtr disk) virDomainDiskDefPtr disk)
{ {
char uuid[VIR_UUID_STRING_BUFLEN]; char uuid[VIR_UUID_STRING_BUFLEN];
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virDomainDiskDefPtr del_disk = NULL; virDomainDiskDefPtr del_disk = NULL;
virUUIDFormat(vm->def->uuid, uuid); virUUIDFormat(vm->def->uuid, uuid);

View File

@ -196,7 +196,7 @@ int qemuDomainAsyncJobPhaseFromString(enum qemuDomainAsyncJob job,
void qemuDomainEventFlush(int timer, void *opaque); void qemuDomainEventFlush(int timer, void *opaque);
void qemuDomainEventQueue(virQEMUDriverPtr driver, void qemuDomainEventQueue(virQEMUDriverPtr driver,
virDomainEventPtr event); virObjectEventPtr event);
int qemuDomainObjBeginJob(virQEMUDriverPtr driver, int qemuDomainObjBeginJob(virQEMUDriverPtr driver,
virDomainObjPtr obj, virDomainObjPtr obj,

View File

@ -878,7 +878,7 @@ static void qemuNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque)
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
if (newVM) { if (newVM) {
virDomainEventPtr event = virObjectEventPtr event =
virDomainEventLifecycleNewFromObj(vm, virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_DEFINED, VIR_DOMAIN_EVENT_DEFINED,
VIR_DOMAIN_EVENT_DEFINED_ADDED); VIR_DOMAIN_EVENT_DEFINED_ADDED);
@ -1566,8 +1566,8 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
virDomainDefPtr def = NULL; virDomainDefPtr def = NULL;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainPtr dom = NULL; virDomainPtr dom = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virDomainEventPtr event2 = NULL; virObjectEventPtr event2 = NULL;
unsigned int start_flags = VIR_QEMU_PROCESS_START_COLD; unsigned int start_flags = VIR_QEMU_PROCESS_START_COLD;
virQEMUCapsPtr qemuCaps = NULL; virQEMUCapsPtr qemuCaps = NULL;
virCapsPtr caps = NULL; virCapsPtr caps = NULL;
@ -1668,7 +1668,7 @@ static int qemuDomainSuspend(virDomainPtr dom) {
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
int ret = -1; int ret = -1;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
virDomainPausedReason reason; virDomainPausedReason reason;
int eventDetail; int eventDetail;
@ -1749,7 +1749,7 @@ static int qemuDomainResume(virDomainPtr dom) {
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
int ret = -1; int ret = -1;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int state; int state;
virQEMUDriverConfigPtr cfg = NULL; virQEMUDriverConfigPtr cfg = NULL;
virCapsPtr caps = NULL; virCapsPtr caps = NULL;
@ -2074,7 +2074,7 @@ qemuDomainDestroyFlags(virDomainPtr dom,
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
int ret = -1; int ret = -1;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
virCheckFlags(VIR_DOMAIN_DESTROY_GRACEFUL, -1); virCheckFlags(VIR_DOMAIN_DESTROY_GRACEFUL, -1);
@ -3037,7 +3037,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
bool was_running = false; bool was_running = false;
int ret = -1; int ret = -1;
int rc; int rc;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
virCapsPtr caps; virCapsPtr caps;
@ -3517,7 +3517,7 @@ static int qemuDomainCoreDump(virDomainPtr dom,
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
bool resume = false, paused = false; bool resume = false, paused = false;
int ret = -1; int ret = -1;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virCheckFlags(VIR_DUMP_LIVE | VIR_DUMP_CRASH | virCheckFlags(VIR_DUMP_LIVE | VIR_DUMP_CRASH |
VIR_DUMP_BYPASS_CACHE | VIR_DUMP_RESET | VIR_DUMP_BYPASS_CACHE | VIR_DUMP_RESET |
@ -3822,7 +3822,7 @@ processGuestPanicEvent(virQEMUDriverPtr driver,
int action) int action)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
if (!virDomainObjIsActive(vm)) { if (!virDomainObjIsActive(vm)) {
@ -5344,7 +5344,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
bool start_paused) bool start_paused)
{ {
int ret = -1; int ret = -1;
virDomainEventPtr event; virObjectEventPtr event;
int intermediatefd = -1; int intermediatefd = -1;
virCommandPtr cmd = NULL; virCommandPtr cmd = NULL;
char *errbuf = NULL; char *errbuf = NULL;
@ -6066,7 +6066,7 @@ qemuDomainObjStart(virConnectPtr conn,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE, start_flags); VIR_NETDEV_VPORT_PROFILE_OP_CREATE, start_flags);
virDomainAuditStart(vm, "booted", ret >= 0); virDomainAuditStart(vm, "booted", ret >= 0);
if (ret >= 0) { if (ret >= 0) {
virDomainEventPtr event = virObjectEventPtr event =
virDomainEventLifecycleNewFromObj(vm, virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_STARTED, VIR_DOMAIN_EVENT_STARTED,
VIR_DOMAIN_EVENT_STARTED_BOOTED); VIR_DOMAIN_EVENT_STARTED_BOOTED);
@ -6141,7 +6141,7 @@ static virDomainPtr qemuDomainDefineXML(virConnectPtr conn, const char *xml) {
virDomainDefPtr oldDef = NULL; virDomainDefPtr oldDef = NULL;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainPtr dom = NULL; virDomainPtr dom = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virQEMUCapsPtr qemuCaps = NULL; virQEMUCapsPtr qemuCaps = NULL;
virQEMUDriverConfigPtr cfg; virQEMUDriverConfigPtr cfg;
virCapsPtr caps = NULL; virCapsPtr caps = NULL;
@ -6234,7 +6234,7 @@ qemuDomainUndefineFlags(virDomainPtr dom,
{ {
virQEMUDriverPtr driver = dom->conn->privateData; virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
char *name = NULL; char *name = NULL;
int ret = -1; int ret = -1;
int nsnapshots; int nsnapshots;
@ -11741,7 +11741,7 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn,
{ {
virDomainObjPtr vm = *vmptr; virDomainObjPtr vm = *vmptr;
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
bool resume = false; bool resume = false;
int ret = -1; int ret = -1;
@ -12531,7 +12531,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
/* the snapshot is complete now */ /* the snapshot is complete now */
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT) { if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT) {
virDomainEventPtr event; virObjectEventPtr event;
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED, event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT); VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT);
@ -12549,7 +12549,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
/* qemu 1.3 is unable to save a domain in pm-suspended (S3) /* qemu 1.3 is unable to save a domain in pm-suspended (S3)
* state; so we must emit an event stating that it was * state; so we must emit an event stating that it was
* converted to paused. */ * converted to paused. */
virDomainEventPtr event; virObjectEventPtr event;
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, virDomainObjSetState(vm, VIR_DOMAIN_PAUSED,
VIR_DOMAIN_PAUSED_FROM_SNAPSHOT); VIR_DOMAIN_PAUSED_FROM_SNAPSHOT);
@ -12566,7 +12566,7 @@ endjob:
qemuProcessStartCPUs(driver, vm, conn, qemuProcessStartCPUs(driver, vm, conn,
VIR_DOMAIN_RUNNING_UNPAUSED, VIR_DOMAIN_RUNNING_UNPAUSED,
QEMU_ASYNC_JOB_SNAPSHOT) < 0) { QEMU_ASYNC_JOB_SNAPSHOT) < 0) {
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
event = virDomainEventLifecycleNewFromObj(vm, event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_SUSPENDED, VIR_DOMAIN_EVENT_SUSPENDED,
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR); VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR);
@ -13227,8 +13227,8 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
int ret = -1; int ret = -1;
virDomainSnapshotObjPtr snap = NULL; virDomainSnapshotObjPtr snap = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virDomainEventPtr event2 = NULL; virObjectEventPtr event2 = NULL;
int detail; int detail;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
int rc; int rc;
@ -14183,7 +14183,7 @@ cleanup:
qemuProcessStartCPUs(driver, vm, conn, qemuProcessStartCPUs(driver, vm, conn,
VIR_DOMAIN_RUNNING_UNPAUSED, VIR_DOMAIN_RUNNING_UNPAUSED,
QEMU_ASYNC_JOB_NONE) < 0) { QEMU_ASYNC_JOB_NONE) < 0) {
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
event = virDomainEventLifecycleNewFromObj(vm, event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_SUSPENDED, VIR_DOMAIN_EVENT_SUSPENDED,
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR); VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR);
@ -14210,7 +14210,7 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm,
char *device = NULL; char *device = NULL;
int ret = -1; int ret = -1;
bool async = false; bool async = false;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int idx; int idx;
virDomainDiskDefPtr disk; virDomainDiskDefPtr disk;

View File

@ -2459,7 +2459,7 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
virDomainDiskDefPtr disk) virDomainDiskDefPtr disk)
{ {
virDomainDeviceDef dev; virDomainDeviceDef dev;
virDomainEventPtr event; virObjectEventPtr event;
size_t i; size_t i;
VIR_DEBUG("Removing disk %s from domain %p %s", VIR_DEBUG("Removing disk %s from domain %p %s",
@ -2503,7 +2503,7 @@ qemuDomainRemoveControllerDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainControllerDefPtr controller) virDomainControllerDefPtr controller)
{ {
virDomainEventPtr event; virObjectEventPtr event;
size_t i; size_t i;
VIR_DEBUG("Removing controller %s from domain %p %s", VIR_DEBUG("Removing controller %s from domain %p %s",
@ -2591,7 +2591,7 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver,
{ {
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virDomainNetDefPtr net = NULL; virDomainNetDefPtr net = NULL;
virDomainEventPtr event; virObjectEventPtr event;
size_t i; size_t i;
VIR_DEBUG("Removing host device %s from domain %p %s", VIR_DEBUG("Removing host device %s from domain %p %s",
@ -2662,7 +2662,7 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
{ {
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virNetDevVPortProfilePtr vport; virNetDevVPortProfilePtr vport;
virDomainEventPtr event; virObjectEventPtr event;
size_t i; size_t i;
if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_HOSTDEV) { if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
@ -2727,7 +2727,7 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainChrDefPtr chr) virDomainChrDefPtr chr)
{ {
virDomainEventPtr event; virObjectEventPtr event;
VIR_DEBUG("Removing character device %s from domain %p %s", VIR_DEBUG("Removing character device %s from domain %p %s",
chr->info.alias, vm, vm->def->name); chr->info.alias, vm, vm->def->name);

View File

@ -1511,7 +1511,7 @@ qemuMigrationSetOffline(virQEMUDriverPtr driver,
ret = qemuProcessStopCPUs(driver, vm, VIR_DOMAIN_PAUSED_MIGRATION, ret = qemuProcessStopCPUs(driver, vm, VIR_DOMAIN_PAUSED_MIGRATION,
QEMU_ASYNC_JOB_MIGRATION_OUT); QEMU_ASYNC_JOB_MIGRATION_OUT);
if (ret == 0) { if (ret == 0) {
virDomainEventPtr event; virObjectEventPtr event;
event = virDomainEventLifecycleNewFromObj(vm, event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_SUSPENDED, VIR_DOMAIN_EVENT_SUSPENDED,
@ -2169,7 +2169,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
unsigned long flags) unsigned long flags)
{ {
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
int dataFD[2] = { -1, -1 }; int dataFD[2] = { -1, -1 };
qemuDomainObjPrivatePtr priv = NULL; qemuDomainObjPrivatePtr priv = NULL;
@ -2702,7 +2702,7 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver,
int retcode) int retcode)
{ {
qemuMigrationCookiePtr mig; qemuMigrationCookiePtr mig;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int rv = -1; int rv = -1;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
@ -4055,7 +4055,7 @@ qemuMigrationPerformJob(virQEMUDriverPtr driver,
unsigned long resource, unsigned long resource,
bool v3proto) bool v3proto)
{ {
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
int resume = 0; int resume = 0;
virErrorPtr orig_err = NULL; virErrorPtr orig_err = NULL;
@ -4169,7 +4169,7 @@ qemuMigrationPerformPhase(virQEMUDriverPtr driver,
unsigned long flags, unsigned long flags,
unsigned long resource) unsigned long resource)
{ {
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
bool resume; bool resume;
bool hasrefs; bool hasrefs;
@ -4365,7 +4365,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
bool v3proto) bool v3proto)
{ {
virDomainPtr dom = NULL; virDomainPtr dom = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
bool newVM = true; bool newVM = true;
qemuMigrationCookiePtr mig = NULL; qemuMigrationCookiePtr mig = NULL;
virErrorPtr orig_err = NULL; virErrorPtr orig_err = NULL;

View File

@ -286,7 +286,7 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
int eventReason = VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN; int eventReason = VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN;
int stopReason = VIR_DOMAIN_SHUTOFF_SHUTDOWN; int stopReason = VIR_DOMAIN_SHUTOFF_SHUTDOWN;
@ -348,7 +348,7 @@ qemuProcessHandleMonitorError(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
VIR_DEBUG("Received error on %p '%s'", vm, vm->def->name); VIR_DEBUG("Received error on %p '%s'", vm, vm->def->name);
@ -516,7 +516,7 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr event; virObjectEventPtr event;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
virObjectLock(vm); virObjectLock(vm);
@ -549,7 +549,7 @@ qemuProcessFakeReboot(void *opaque)
virQEMUDriverPtr driver = qemu_driver; virQEMUDriverPtr driver = qemu_driver;
virDomainObjPtr vm = opaque; virDomainObjPtr vm = opaque;
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virDomainRunningReason reason = VIR_DOMAIN_RUNNING_BOOTED; virDomainRunningReason reason = VIR_DOMAIN_RUNNING_BOOTED;
int ret = -1; int ret = -1;
@ -648,7 +648,7 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
VIR_DEBUG("vm=%p", vm); VIR_DEBUG("vm=%p", vm);
@ -702,7 +702,7 @@ qemuProcessHandleStop(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virObjectLock(vm); virObjectLock(vm);
@ -749,7 +749,7 @@ qemuProcessHandleResume(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virObjectLock(vm); virObjectLock(vm);
@ -803,7 +803,7 @@ qemuProcessHandleRTCChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virObjectLock(vm); virObjectLock(vm);
@ -844,8 +844,8 @@ qemuProcessHandleWatchdog(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr watchdogEvent = NULL; virObjectEventPtr watchdogEvent = NULL;
virDomainEventPtr lifecycleEvent = NULL; virObjectEventPtr lifecycleEvent = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virObjectLock(vm); virObjectLock(vm);
@ -911,9 +911,9 @@ qemuProcessHandleIOError(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr ioErrorEvent = NULL; virObjectEventPtr ioErrorEvent = NULL;
virDomainEventPtr ioErrorEvent2 = NULL; virObjectEventPtr ioErrorEvent2 = NULL;
virDomainEventPtr lifecycleEvent = NULL; virObjectEventPtr lifecycleEvent = NULL;
const char *srcPath; const char *srcPath;
const char *devAlias; const char *devAlias;
virDomainDiskDefPtr disk; virDomainDiskDefPtr disk;
@ -972,7 +972,7 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
const char *path; const char *path;
virDomainDiskDefPtr disk; virDomainDiskDefPtr disk;
@ -1025,7 +1025,7 @@ qemuProcessHandleGraphics(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr event; virObjectEventPtr event;
virDomainEventGraphicsAddressPtr localAddr = NULL; virDomainEventGraphicsAddressPtr localAddr = NULL;
virDomainEventGraphicsAddressPtr remoteAddr = NULL; virDomainEventGraphicsAddressPtr remoteAddr = NULL;
virDomainEventGraphicsSubjectPtr subject = NULL; virDomainEventGraphicsSubjectPtr subject = NULL;
@ -1104,7 +1104,7 @@ qemuProcessHandleTrayChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virDomainDiskDefPtr disk; virDomainDiskDefPtr disk;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
@ -1140,8 +1140,8 @@ qemuProcessHandlePMWakeup(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virDomainEventPtr lifecycleEvent = NULL; virObjectEventPtr lifecycleEvent = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virObjectLock(vm); virObjectLock(vm);
@ -1181,8 +1181,8 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virDomainEventPtr lifecycleEvent = NULL; virObjectEventPtr lifecycleEvent = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virObjectLock(vm); virObjectLock(vm);
@ -1226,7 +1226,7 @@ qemuProcessHandleBalloonChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virObjectLock(vm); virObjectLock(vm);
@ -1253,8 +1253,8 @@ qemuProcessHandlePMSuspendDisk(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virDomainEventPtr lifecycleEvent = NULL; virObjectEventPtr lifecycleEvent = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
virObjectLock(vm); virObjectLock(vm);
@ -4628,7 +4628,7 @@ qemuProcessAutoDestroy(virDomainObjPtr dom,
{ {
virQEMUDriverPtr driver = opaque; virQEMUDriverPtr driver = opaque;
qemuDomainObjPrivatePtr priv = dom->privateData; qemuDomainObjPrivatePtr priv = dom->privateData;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
VIR_DEBUG("vm=%s, conn=%p", dom->def->name, conn); VIR_DEBUG("vm=%s, conn=%p", dom->def->name, conn);

View File

@ -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_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_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 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. */ /* Helper functions for remoteOpen. */
@ -4380,7 +4380,7 @@ remoteDomainBuildEventLifecycle(virNetClientProgramPtr prog ATTRIBUTE_UNUSED,
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_lifecycle_msg *msg = evdata; remote_domain_event_lifecycle_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -4402,7 +4402,7 @@ remoteDomainBuildEventReboot(virNetClientProgramPtr prog ATTRIBUTE_UNUSED,
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_reboot_msg *msg = evdata; remote_domain_event_reboot_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -4424,7 +4424,7 @@ remoteDomainBuildEventRTCChange(virNetClientProgramPtr prog ATTRIBUTE_UNUSED,
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_rtc_change_msg *msg = evdata; remote_domain_event_rtc_change_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -4446,7 +4446,7 @@ remoteDomainBuildEventWatchdog(virNetClientProgramPtr prog ATTRIBUTE_UNUSED,
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_watchdog_msg *msg = evdata; remote_domain_event_watchdog_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -4468,7 +4468,7 @@ remoteDomainBuildEventIOError(virNetClientProgramPtr prog ATTRIBUTE_UNUSED,
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_io_error_msg *msg = evdata; remote_domain_event_io_error_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -4493,7 +4493,7 @@ remoteDomainBuildEventIOErrorReason(virNetClientProgramPtr prog ATTRIBUTE_UNUSED
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_io_error_reason_msg *msg = evdata; remote_domain_event_io_error_reason_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -4519,7 +4519,7 @@ remoteDomainBuildEventBlockJob(virNetClientProgramPtr prog ATTRIBUTE_UNUSED,
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_block_job_msg *msg = evdata; remote_domain_event_block_job_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -4542,7 +4542,7 @@ remoteDomainBuildEventGraphics(virNetClientProgramPtr prog ATTRIBUTE_UNUSED,
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_graphics_msg *msg = evdata; remote_domain_event_graphics_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virDomainEventGraphicsAddressPtr localAddr = NULL; virDomainEventGraphicsAddressPtr localAddr = NULL;
virDomainEventGraphicsAddressPtr remoteAddr = NULL; virDomainEventGraphicsAddressPtr remoteAddr = NULL;
virDomainEventGraphicsSubjectPtr subject = NULL; virDomainEventGraphicsSubjectPtr subject = NULL;
@ -4622,7 +4622,7 @@ remoteDomainBuildEventControlError(virNetClientProgramPtr prog ATTRIBUTE_UNUSED,
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_control_error_msg *msg = evdata; remote_domain_event_control_error_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -4645,7 +4645,7 @@ remoteDomainBuildEventDiskChange(virNetClientProgramPtr prog ATTRIBUTE_UNUSED,
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_disk_change_msg *msg = evdata; remote_domain_event_disk_change_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -4672,7 +4672,7 @@ remoteDomainBuildEventTrayChange(virNetClientProgramPtr prog ATTRIBUTE_UNUSED,
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_tray_change_msg *msg = evdata; remote_domain_event_tray_change_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -4696,7 +4696,7 @@ remoteDomainBuildEventPMWakeup(virNetClientProgramPtr prog ATTRIBUTE_UNUSED,
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_pmwakeup_msg *msg = evdata; remote_domain_event_pmwakeup_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -4718,7 +4718,7 @@ remoteDomainBuildEventPMSuspend(virNetClientProgramPtr prog ATTRIBUTE_UNUSED,
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_pmsuspend_msg *msg = evdata; remote_domain_event_pmsuspend_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -4741,7 +4741,7 @@ remoteDomainBuildEventBalloonChange(virNetClientProgramPtr prog ATTRIBUTE_UNUSED
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_balloon_change_msg *msg = evdata; remote_domain_event_balloon_change_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -4763,7 +4763,7 @@ remoteDomainBuildEventPMSuspendDisk(virNetClientProgramPtr prog ATTRIBUTE_UNUSED
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_pmsuspend_disk_msg *msg = evdata; remote_domain_event_pmsuspend_disk_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -4786,7 +4786,7 @@ remoteDomainBuildEventDeviceRemoved(virNetClientProgramPtr prog ATTRIBUTE_UNUSED
struct private_data *priv = conn->privateData; struct private_data *priv = conn->privateData;
remote_domain_event_device_removed_msg *msg = evdata; remote_domain_event_device_removed_msg *msg = evdata;
virDomainPtr dom; virDomainPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
dom = get_nonnull_domain(conn, msg->dom); dom = get_nonnull_domain(conn, msg->dom);
if (!dom) if (!dom)
@ -6690,7 +6690,7 @@ done:
} }
static void static void
remoteDomainEventQueue(struct private_data *priv, virDomainEventPtr event) remoteDomainEventQueue(struct private_data *priv, virObjectEventPtr event)
{ {
virObjectEventStateQueue(priv->domainEventState, event); virObjectEventStateQueue(priv->domainEventState, event);
} }

View File

@ -122,7 +122,7 @@ static const virNodeInfo defaultNodeInfo = {
static int testConnectClose(virConnectPtr conn); static int testConnectClose(virConnectPtr conn);
static void testDomainEventQueue(testConnPtr driver, static void testDomainEventQueue(testConnPtr driver,
virDomainEventPtr event); virObjectEventPtr event);
static void testDriverLock(testConnPtr driver) static void testDriverLock(testConnPtr driver)
@ -1615,7 +1615,7 @@ testDomainCreateXML(virConnectPtr conn, const char *xml,
virDomainPtr ret = NULL; virDomainPtr ret = NULL;
virDomainDefPtr def; virDomainDefPtr def;
virDomainObjPtr dom = NULL; virDomainObjPtr dom = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virCheckFlags(0, NULL); virCheckFlags(0, NULL);
@ -1753,7 +1753,7 @@ static int testDomainDestroy(virDomainPtr domain)
{ {
testConnPtr privconn = domain->conn->privateData; testConnPtr privconn = domain->conn->privateData;
virDomainObjPtr privdom; virDomainObjPtr privdom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
testDriverLock(privconn); testDriverLock(privconn);
@ -1790,7 +1790,7 @@ static int testDomainResume(virDomainPtr domain)
{ {
testConnPtr privconn = domain->conn->privateData; testConnPtr privconn = domain->conn->privateData;
virDomainObjPtr privdom; virDomainObjPtr privdom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
testDriverLock(privconn); testDriverLock(privconn);
@ -1831,7 +1831,7 @@ static int testDomainSuspend(virDomainPtr domain)
{ {
testConnPtr privconn = domain->conn->privateData; testConnPtr privconn = domain->conn->privateData;
virDomainObjPtr privdom; virDomainObjPtr privdom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
int state; int state;
@ -1875,7 +1875,7 @@ static int testDomainShutdownFlags(virDomainPtr domain,
{ {
testConnPtr privconn = domain->conn->privateData; testConnPtr privconn = domain->conn->privateData;
virDomainObjPtr privdom; virDomainObjPtr privdom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
virCheckFlags(0, -1); virCheckFlags(0, -1);
@ -1927,7 +1927,7 @@ static int testDomainReboot(virDomainPtr domain,
{ {
testConnPtr privconn = domain->conn->privateData; testConnPtr privconn = domain->conn->privateData;
virDomainObjPtr privdom; virDomainObjPtr privdom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
testDriverLock(privconn); testDriverLock(privconn);
@ -2071,7 +2071,7 @@ testDomainSaveFlags(virDomainPtr domain, const char *path,
int fd = -1; int fd = -1;
int len; int len;
virDomainObjPtr privdom; virDomainObjPtr privdom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
virCheckFlags(0, -1); virCheckFlags(0, -1);
@ -2184,7 +2184,7 @@ testDomainRestoreFlags(virConnectPtr conn,
int len; int len;
virDomainDefPtr def = NULL; virDomainDefPtr def = NULL;
virDomainObjPtr dom = NULL; virDomainObjPtr dom = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
virCheckFlags(0, -1); virCheckFlags(0, -1);
@ -2284,7 +2284,7 @@ static int testDomainCoreDump(virDomainPtr domain,
testConnPtr privconn = domain->conn->privateData; testConnPtr privconn = domain->conn->privateData;
int fd = -1; int fd = -1;
virDomainObjPtr privdom; virDomainObjPtr privdom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
virCheckFlags(VIR_DUMP_CRASH, -1); virCheckFlags(VIR_DUMP_CRASH, -1);
@ -2783,7 +2783,7 @@ static virDomainPtr testDomainDefineXML(virConnectPtr conn,
virDomainPtr ret = NULL; virDomainPtr ret = NULL;
virDomainDefPtr def; virDomainDefPtr def;
virDomainObjPtr dom = NULL; virDomainObjPtr dom = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virDomainDefPtr oldDef = NULL; virDomainDefPtr oldDef = NULL;
testDriverLock(privconn); testDriverLock(privconn);
@ -2921,7 +2921,7 @@ cleanup:
static int testDomainCreateWithFlags(virDomainPtr domain, unsigned int flags) { static int testDomainCreateWithFlags(virDomainPtr domain, unsigned int flags) {
testConnPtr privconn = domain->conn->privateData; testConnPtr privconn = domain->conn->privateData;
virDomainObjPtr privdom; virDomainObjPtr privdom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
virCheckFlags(0, -1); virCheckFlags(0, -1);
@ -2969,7 +2969,7 @@ static int testDomainUndefineFlags(virDomainPtr domain,
{ {
testConnPtr privconn = domain->conn->privateData; testConnPtr privconn = domain->conn->privateData;
virDomainObjPtr privdom; virDomainObjPtr privdom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int nsnapshots; int nsnapshots;
int ret = -1; int ret = -1;
@ -6029,7 +6029,7 @@ testConnectDomainEventDeregisterAny(virConnectPtr conn,
/* driver must be locked before calling */ /* driver must be locked before calling */
static void testDomainEventQueue(testConnPtr driver, static void testDomainEventQueue(testConnPtr driver,
virDomainEventPtr event) virObjectEventPtr event)
{ {
virObjectEventStateQueue(driver->domainEventState, event); virObjectEventStateQueue(driver->domainEventState, event);
} }
@ -6151,7 +6151,7 @@ testDomainManagedSave(virDomainPtr dom, unsigned int flags)
{ {
testConnPtr privconn = dom->conn->privateData; testConnPtr privconn = dom->conn->privateData;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
virCheckFlags(VIR_DOMAIN_SAVE_BYPASS_CACHE | virCheckFlags(VIR_DOMAIN_SAVE_BYPASS_CACHE |
@ -6641,7 +6641,7 @@ testDomainSnapshotCreateXML(virDomainPtr domain,
virDomainSnapshotDefPtr def = NULL; virDomainSnapshotDefPtr def = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainSnapshotObjPtr snap = NULL;
virDomainSnapshotPtr snapshot = NULL; virDomainSnapshotPtr snapshot = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
char *xml = NULL; char *xml = NULL;
bool update_current = true; bool update_current = true;
bool redefine = flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE; bool redefine = flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE;
@ -6890,8 +6890,8 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
testConnPtr privconn = snapshot->domain->conn->privateData; testConnPtr privconn = snapshot->domain->conn->privateData;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainSnapshotObjPtr snap = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virDomainEventPtr event2 = NULL; virObjectEventPtr event2 = NULL;
virDomainDefPtr config = NULL; virDomainDefPtr config = NULL;
int ret = -1; int ret = -1;

View File

@ -128,7 +128,7 @@ static int umlOpenMonitor(struct uml_driver *driver,
static int umlReadPidFile(struct uml_driver *driver, static int umlReadPidFile(struct uml_driver *driver,
virDomainObjPtr vm); virDomainObjPtr vm);
static void umlDomainEventQueue(struct uml_driver *driver, static void umlDomainEventQueue(struct uml_driver *driver,
virDomainEventPtr event); virObjectEventPtr event);
static int umlStartVMDaemon(virConnectPtr conn, static int umlStartVMDaemon(virConnectPtr conn,
struct uml_driver *driver, struct uml_driver *driver,
@ -194,7 +194,7 @@ umlAutostartDomain(virDomainObjPtr vm,
VIR_ERROR(_("Failed to autostart VM '%s': %s"), VIR_ERROR(_("Failed to autostart VM '%s': %s"),
vm->def->name, err ? err->message : _("unknown error")); vm->def->name, err ? err->message : _("unknown error"));
} else { } else {
virDomainEventPtr event = virObjectEventPtr event =
virDomainEventLifecycleNewFromObj(vm, virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_STARTED, VIR_DOMAIN_EVENT_STARTED,
VIR_DOMAIN_EVENT_STARTED_BOOTED); VIR_DOMAIN_EVENT_STARTED_BOOTED);
@ -301,7 +301,7 @@ umlInotifyEvent(int watch,
char *tmp, *name; char *tmp, *name;
struct uml_driver *driver = data; struct uml_driver *driver = data;
virDomainObjPtr dom; virDomainObjPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
umlDriverLock(driver); umlDriverLock(driver);
if (watch != driver->inotifyWatch) if (watch != driver->inotifyWatch)
@ -604,7 +604,7 @@ static void umlNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque)
struct uml_driver *driver = opaque; struct uml_driver *driver = opaque;
if (newVM) { if (newVM) {
virDomainEventPtr event = virObjectEventPtr event =
virDomainEventLifecycleNewFromObj(vm, virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_DEFINED, VIR_DOMAIN_EVENT_DEFINED,
VIR_DOMAIN_EVENT_DEFINED_ADDED); VIR_DOMAIN_EVENT_DEFINED_ADDED);
@ -716,7 +716,7 @@ static void umlProcessAutoDestroyDom(void *payload,
const char *uuidstr = name; const char *uuidstr = name;
unsigned char uuid[VIR_UUID_BUFLEN]; unsigned char uuid[VIR_UUID_BUFLEN];
virDomainObjPtr dom; virDomainObjPtr dom;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
VIR_DEBUG("conn=%p uuidstr=%s thisconn=%p", conn, uuidstr, data->conn); 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; virDomainDefPtr def;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainPtr dom = NULL; virDomainPtr dom = NULL;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
virCheckFlags(VIR_DOMAIN_START_AUTODESTROY, NULL); virCheckFlags(VIR_DOMAIN_START_AUTODESTROY, NULL);
@ -1667,7 +1667,7 @@ umlDomainDestroyFlags(virDomainPtr dom,
{ {
struct uml_driver *driver = dom->conn->privateData; struct uml_driver *driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
virCheckFlags(0, -1); virCheckFlags(0, -1);
@ -1993,7 +1993,7 @@ static int umlConnectNumOfDefinedDomains(virConnectPtr conn) {
static int umlDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) { static int umlDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) {
struct uml_driver *driver = dom->conn->privateData; struct uml_driver *driver = dom->conn->privateData;
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainEventPtr event = NULL; virObjectEventPtr event = NULL;
int ret = -1; int ret = -1;
virCheckFlags(VIR_DOMAIN_START_AUTODESTROY, -1); virCheckFlags(VIR_DOMAIN_START_AUTODESTROY, -1);
@ -2691,7 +2691,7 @@ umlConnectDomainEventDeregisterAny(virConnectPtr conn,
/* driver must be locked before calling */ /* driver must be locked before calling */
static void umlDomainEventQueue(struct uml_driver *driver, static void umlDomainEventQueue(struct uml_driver *driver,
virDomainEventPtr event) virObjectEventPtr event)
{ {
virObjectEventStateQueue(driver->domainEventState, event); virObjectEventStateQueue(driver->domainEventState, event);
} }

View File

@ -6965,7 +6965,7 @@ vboxCallbackOnMachineStateChange(IVirtualBoxCallback *pThis ATTRIBUTE_UNUSED,
dom = vboxDomainLookupByUUID(g_pVBoxGlobalData->conn, uuid); dom = vboxDomainLookupByUUID(g_pVBoxGlobalData->conn, uuid);
if (dom) { if (dom) {
virDomainEventPtr ev; virObjectEventPtr ev;
if (state == MachineState_Starting) { if (state == MachineState_Starting) {
event = VIR_DOMAIN_EVENT_STARTED; event = VIR_DOMAIN_EVENT_STARTED;
@ -7084,7 +7084,7 @@ vboxCallbackOnMachineRegistered(IVirtualBoxCallback *pThis ATTRIBUTE_UNUSED,
dom = vboxDomainLookupByUUID(g_pVBoxGlobalData->conn, uuid); dom = vboxDomainLookupByUUID(g_pVBoxGlobalData->conn, uuid);
if (dom) { if (dom) {
virDomainEventPtr ev; virObjectEventPtr ev;
/* CURRENT LIMITATION: we never get the VIR_DOMAIN_EVENT_UNDEFINED /* CURRENT LIMITATION: we never get the VIR_DOMAIN_EVENT_UNDEFINED
* event because the when the machine is de-registered the call * event because the when the machine is de-registered the call

View File

@ -2946,7 +2946,7 @@ xenUnifiedRemoveDomainInfo(xenUnifiedDomainInfoListPtr list,
* *
*/ */
void xenUnifiedDomainEventDispatch(xenUnifiedPrivatePtr priv, void xenUnifiedDomainEventDispatch(xenUnifiedPrivatePtr priv,
virDomainEventPtr event) virObjectEventPtr event)
{ {
if (!priv) if (!priv)
return; return;

View File

@ -199,7 +199,7 @@ int xenUnifiedRemoveDomainInfo(xenUnifiedDomainInfoListPtr info,
int id, char *name, int id, char *name,
unsigned char *uuid); unsigned char *uuid);
void xenUnifiedDomainEventDispatch (xenUnifiedPrivatePtr priv, void xenUnifiedDomainEventDispatch (xenUnifiedPrivatePtr priv,
virDomainEventPtr event); virObjectEventPtr event);
unsigned long xenUnifiedVersion(void); unsigned long xenUnifiedVersion(void);
int xenUnifiedConnectGetMaxVcpus(virConnectPtr conn, const char *type); int xenUnifiedConnectGetMaxVcpus(virConnectPtr conn, const char *type);

View File

@ -135,13 +135,13 @@ xenInotifyDomainLookup(virConnectPtr conn,
return xenInotifyXendDomainsDirLookup(conn, filename, name, uuid); return xenInotifyXendDomainsDirLookup(conn, filename, name, uuid);
} }
static virDomainEventPtr static virObjectEventPtr
xenInotifyDomainEventFromFile(virConnectPtr conn, xenInotifyDomainEventFromFile(virConnectPtr conn,
const char *filename, const char *filename,
int type, int type,
int detail) int detail)
{ {
virDomainEventPtr event; virObjectEventPtr event;
char *name = NULL; char *name = NULL;
unsigned char uuid[VIR_UUID_BUFLEN]; unsigned char uuid[VIR_UUID_BUFLEN];
@ -290,7 +290,7 @@ reread:
priv->configDir, name); priv->configDir, name);
if (e->mask & (IN_DELETE | IN_MOVED_FROM)) { if (e->mask & (IN_DELETE | IN_MOVED_FROM)) {
virDomainEventPtr event = virObjectEventPtr event =
xenInotifyDomainEventFromFile(conn, fname, xenInotifyDomainEventFromFile(conn, fname,
VIR_DOMAIN_EVENT_UNDEFINED, VIR_DOMAIN_EVENT_UNDEFINED,
VIR_DOMAIN_EVENT_UNDEFINED_REMOVED); VIR_DOMAIN_EVENT_UNDEFINED_REMOVED);
@ -306,7 +306,7 @@ reread:
goto cleanup; goto cleanup;
} }
} else if (e->mask & (IN_CREATE | IN_CLOSE_WRITE | IN_MOVED_TO)) { } else if (e->mask & (IN_CREATE | IN_CLOSE_WRITE | IN_MOVED_TO)) {
virDomainEventPtr event; virObjectEventPtr event;
if (xenInotifyAddDomainConfigInfo(conn, fname) < 0) { if (xenInotifyAddDomainConfigInfo(conn, fname) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Error adding file to config cache")); "%s", _("Error adding file to config cache"));

View File

@ -835,7 +835,7 @@ retry:
} }
if (!found) { if (!found) {
virDomainEventPtr event; virObjectEventPtr event;
char *name; char *name;
unsigned char uuid[VIR_UUID_BUFLEN]; unsigned char uuid[VIR_UUID_BUFLEN];
@ -918,7 +918,7 @@ retry:
} }
if (!found) { if (!found) {
virDomainEventPtr event = virObjectEventPtr event =
virDomainEventLifecycleNew(-1, virDomainEventLifecycleNew(-1,
priv->activeDomainList->doms[j]->name, priv->activeDomainList->doms[j]->name,
priv->activeDomainList->doms[j]->uuid, priv->activeDomainList->doms[j]->uuid,