mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
Renamed virDomainEventNew* to virDomainEventLifecycleNew*
This aims at providing some consistency with other domain events
This commit is contained in:
parent
0d1d632d79
commit
6ffce0f698
@ -790,7 +790,7 @@ static void *virDomainEventNewInternal(virClassPtr klass,
|
||||
return event;
|
||||
}
|
||||
|
||||
virDomainEventPtr virDomainEventNew(int id, const char *name,
|
||||
virDomainEventPtr virDomainEventLifecycleNew(int id, const char *name,
|
||||
const unsigned char *uuid,
|
||||
int type, int detail)
|
||||
{
|
||||
@ -810,19 +810,21 @@ virDomainEventPtr virDomainEventNew(int id, const char *name,
|
||||
return (virDomainEventPtr)event;
|
||||
}
|
||||
|
||||
virDomainEventPtr virDomainEventNewFromDom(virDomainPtr dom, int type, int detail)
|
||||
virDomainEventPtr virDomainEventLifecycleNewFromDom(virDomainPtr dom, int type, int detail)
|
||||
{
|
||||
return virDomainEventNew(dom->id, dom->name, dom->uuid, type, detail);
|
||||
return virDomainEventLifecycleNew(dom->id, dom->name, dom->uuid,
|
||||
type, detail);
|
||||
}
|
||||
|
||||
virDomainEventPtr virDomainEventNewFromObj(virDomainObjPtr obj, int type, int detail)
|
||||
virDomainEventPtr virDomainEventLifecycleNewFromObj(virDomainObjPtr obj, int type, int detail)
|
||||
{
|
||||
return virDomainEventNewFromDef(obj->def, type, detail);
|
||||
return virDomainEventLifecycleNewFromDef(obj->def, type, detail);
|
||||
}
|
||||
|
||||
virDomainEventPtr virDomainEventNewFromDef(virDomainDefPtr def, int type, int detail)
|
||||
virDomainEventPtr virDomainEventLifecycleNewFromDef(virDomainDefPtr def, int type, int detail)
|
||||
{
|
||||
return virDomainEventNew(def->id, def->name, def->uuid, type, detail);
|
||||
return virDomainEventLifecycleNew(def->id, def->name, def->uuid,
|
||||
type, detail);
|
||||
}
|
||||
|
||||
virDomainEventPtr virDomainEventRebootNew(int id, const char *name,
|
||||
|
@ -44,10 +44,20 @@ typedef virDomainEvent *virDomainEventPtr;
|
||||
typedef struct _virObjectEventState virObjectEventState;
|
||||
typedef virObjectEventState *virObjectEventStatePtr;
|
||||
|
||||
virDomainEventPtr virDomainEventNew(int id, const char *name, const unsigned char *uuid, int type, int detail);
|
||||
virDomainEventPtr virDomainEventNewFromDom(virDomainPtr dom, int type, int detail);
|
||||
virDomainEventPtr virDomainEventNewFromObj(virDomainObjPtr obj, int type, int detail);
|
||||
virDomainEventPtr virDomainEventNewFromDef(virDomainDefPtr def, int type, int detail);
|
||||
virDomainEventPtr virDomainEventLifecycleNew(int id,
|
||||
const char *name,
|
||||
const unsigned char *uuid,
|
||||
int type,
|
||||
int detail);
|
||||
virDomainEventPtr virDomainEventLifecycleNewFromDom(virDomainPtr dom,
|
||||
int type,
|
||||
int detail);
|
||||
virDomainEventPtr virDomainEventLifecycleNewFromObj(virDomainObjPtr obj,
|
||||
int type,
|
||||
int detail);
|
||||
virDomainEventPtr virDomainEventLifecycleNewFromDef(virDomainDefPtr def,
|
||||
int type,
|
||||
int detail);
|
||||
|
||||
virDomainEventPtr virDomainEventRebootNew(int id, const char *name, const unsigned char *uuid);
|
||||
virDomainEventPtr virDomainEventRebootNewFromDom(virDomainPtr dom);
|
||||
|
@ -430,10 +430,10 @@ virDomainEventIOErrorNewFromDom;
|
||||
virDomainEventIOErrorNewFromObj;
|
||||
virDomainEventIOErrorReasonNewFromDom;
|
||||
virDomainEventIOErrorReasonNewFromObj;
|
||||
virDomainEventNew;
|
||||
virDomainEventNewFromDef;
|
||||
virDomainEventNewFromDom;
|
||||
virDomainEventNewFromObj;
|
||||
virDomainEventLifecycleNew;
|
||||
virDomainEventLifecycleNewFromDef;
|
||||
virDomainEventLifecycleNewFromDom;
|
||||
virDomainEventLifecycleNewFromObj;
|
||||
virDomainEventPMSuspendDiskNewFromDom;
|
||||
virDomainEventPMSuspendDiskNewFromObj;
|
||||
virDomainEventPMSuspendNewFromDom;
|
||||
|
@ -380,7 +380,7 @@ libxlEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event)
|
||||
case LIBXL_SHUTDOWN_REASON_POWEROFF:
|
||||
case LIBXL_SHUTDOWN_REASON_CRASH:
|
||||
if (xl_reason == LIBXL_SHUTDOWN_REASON_CRASH) {
|
||||
dom_event = virDomainEventNewFromObj(vm,
|
||||
dom_event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_CRASHED);
|
||||
reason = VIR_DOMAIN_SHUTOFF_CRASHED;
|
||||
@ -675,7 +675,7 @@ libxlVmStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
|
||||
if (virAtomicIntInc(&driver->nactive) == 1 && driver->inhibitCallback)
|
||||
driver->inhibitCallback(true, driver->inhibitOpaque);
|
||||
|
||||
event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED,
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED,
|
||||
restore_fd < 0 ?
|
||||
VIR_DOMAIN_EVENT_STARTED_BOOTED :
|
||||
VIR_DOMAIN_EVENT_STARTED_RESTORED);
|
||||
@ -1324,7 +1324,7 @@ libxlDomainSuspend(virDomainPtr dom)
|
||||
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
|
||||
|
||||
event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
|
||||
}
|
||||
|
||||
@ -1377,7 +1377,7 @@ libxlDomainResume(virDomainPtr dom)
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING,
|
||||
VIR_DOMAIN_RUNNING_UNPAUSED);
|
||||
|
||||
event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_RESUMED,
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_RESUMED,
|
||||
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
|
||||
}
|
||||
|
||||
@ -1501,7 +1501,7 @@ libxlDomainDestroyFlags(virDomainPtr dom,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
|
||||
|
||||
if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
|
||||
@ -1821,7 +1821,7 @@ libxlDoDomainSave(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_SAVED);
|
||||
|
||||
if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_SAVED) != 0) {
|
||||
@ -2009,7 +2009,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
|
||||
goto cleanup_unpause;
|
||||
}
|
||||
|
||||
event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_CRASHED);
|
||||
if (!vm->persistent) {
|
||||
virDomainObjListRemove(driver->domains, vm);
|
||||
@ -2699,7 +2699,7 @@ libxlDomainDefineXML(virConnectPtr conn, const char *xml)
|
||||
if (dom)
|
||||
dom->id = vm->def->id;
|
||||
|
||||
event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_DEFINED,
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_DEFINED,
|
||||
!oldDef ?
|
||||
VIR_DOMAIN_EVENT_DEFINED_ADDED :
|
||||
VIR_DOMAIN_EVENT_DEFINED_UPDATED);
|
||||
@ -2766,7 +2766,7 @@ libxlDomainUndefineFlags(virDomainPtr dom,
|
||||
if (virDomainDeleteConfig(cfg->configDir, cfg->autostartDir, vm) < 0)
|
||||
goto cleanup;
|
||||
|
||||
event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_UNDEFINED,
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_UNDEFINED,
|
||||
VIR_DOMAIN_EVENT_UNDEFINED_REMOVED);
|
||||
|
||||
if (virDomainObjIsActive(vm)) {
|
||||
|
@ -480,7 +480,7 @@ static virDomainPtr lxcDomainDefineXML(virConnectPtr conn, const char *xml)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_DEFINED,
|
||||
!oldDef ?
|
||||
VIR_DOMAIN_EVENT_DEFINED_ADDED :
|
||||
@ -530,7 +530,7 @@ static int lxcDomainUndefineFlags(virDomainPtr dom,
|
||||
vm) < 0)
|
||||
goto cleanup;
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_UNDEFINED,
|
||||
VIR_DOMAIN_EVENT_UNDEFINED_REMOVED);
|
||||
|
||||
@ -932,7 +932,7 @@ static int lxcDomainCreateWithFiles(virDomainPtr dom,
|
||||
VIR_DOMAIN_RUNNING_BOOTED);
|
||||
|
||||
if (ret == 0) {
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_BOOTED);
|
||||
virDomainAuditStart(vm, "booted", true);
|
||||
@ -1040,7 +1040,7 @@ lxcDomainCreateXMLWithFiles(virConnectPtr conn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_BOOTED);
|
||||
virDomainAuditStart(vm, "booted", true);
|
||||
@ -1288,7 +1288,7 @@ lxcDomainDestroyFlags(virDomainPtr dom,
|
||||
|
||||
priv = vm->privateData;
|
||||
ret = virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
|
||||
priv->doneStopEvent = true;
|
||||
@ -1482,7 +1482,7 @@ static void lxcNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque)
|
||||
|
||||
if (newVM) {
|
||||
virDomainEventPtr event =
|
||||
virDomainEventNewFromObj(vm,
|
||||
virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_DEFINED,
|
||||
VIR_DOMAIN_EVENT_DEFINED_ADDED);
|
||||
if (event)
|
||||
@ -2361,7 +2361,7 @@ static int lxcDomainSuspend(virDomainPtr dom)
|
||||
}
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
|
||||
}
|
||||
@ -2411,7 +2411,7 @@ static int lxcDomainResume(virDomainPtr dom)
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING,
|
||||
VIR_DOMAIN_RUNNING_UNPAUSED);
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ lxcProcessAutoDestroy(virDomainObjPtr dom,
|
||||
VIR_DEBUG("Killing domain");
|
||||
virLXCProcessStop(driver, dom, VIR_DOMAIN_SHUTOFF_DESTROYED);
|
||||
virDomainAuditStop(dom, "destroyed");
|
||||
event = virDomainEventNewFromObj(dom,
|
||||
event = virDomainEventLifecycleNewFromObj(dom,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
|
||||
priv->doneStopEvent = true;
|
||||
@ -502,7 +502,7 @@ static void virLXCProcessMonitorEOFNotify(virLXCMonitorPtr mon,
|
||||
if (!priv->wantReboot) {
|
||||
virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
|
||||
if (!priv->doneStopEvent) {
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
priv->stopReason);
|
||||
virDomainAuditStop(vm, "shutdown");
|
||||
@ -520,7 +520,7 @@ static void virLXCProcessMonitorEOFNotify(virLXCMonitorPtr mon,
|
||||
if (ret == 0) {
|
||||
event = virDomainEventRebootNewFromObj(vm);
|
||||
} else {
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
priv->stopReason);
|
||||
if (!vm->persistent) {
|
||||
@ -1395,7 +1395,7 @@ virLXCProcessAutostartDomain(virDomainObjPtr vm,
|
||||
err ? err->message : "");
|
||||
} else {
|
||||
virDomainEventPtr event =
|
||||
virDomainEventNewFromObj(vm,
|
||||
virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_BOOTED);
|
||||
if (event)
|
||||
|
@ -879,7 +879,7 @@ static void qemuNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque)
|
||||
|
||||
if (newVM) {
|
||||
virDomainEventPtr event =
|
||||
virDomainEventNewFromObj(vm,
|
||||
virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_DEFINED,
|
||||
VIR_DOMAIN_EVENT_DEFINED_ADDED);
|
||||
if (event)
|
||||
@ -1627,7 +1627,7 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_BOOTED);
|
||||
if (event && (flags & VIR_DOMAIN_START_PAUSED)) {
|
||||
@ -1636,7 +1636,7 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
|
||||
* no matter what, but don't care about suspend events), and
|
||||
* those that also care about running/paused. To satisfy both
|
||||
* client types, we have to send two events. */
|
||||
event2 = virDomainEventNewFromObj(vm,
|
||||
event2 = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
|
||||
}
|
||||
@ -1721,7 +1721,7 @@ static int qemuDomainSuspend(virDomainPtr dom) {
|
||||
}
|
||||
|
||||
if (eventDetail >= 0) {
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
eventDetail);
|
||||
}
|
||||
@ -1785,7 +1785,7 @@ static int qemuDomainResume(virDomainPtr dom) {
|
||||
"%s", _("resume operation failed"));
|
||||
goto endjob;
|
||||
}
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
|
||||
}
|
||||
@ -2124,7 +2124,7 @@ qemuDomainDestroyFlags(virDomainPtr dom,
|
||||
}
|
||||
|
||||
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED, 0);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
|
||||
virDomainAuditStop(vm, "destroyed");
|
||||
@ -3107,7 +3107,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
|
||||
/* Shut it down */
|
||||
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SAVED, 0);
|
||||
virDomainAuditStop(vm, "saved");
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_SAVED);
|
||||
if (!vm->persistent) {
|
||||
@ -3125,7 +3125,7 @@ endjob:
|
||||
QEMU_ASYNC_JOB_SAVE);
|
||||
if (rc < 0) {
|
||||
VIR_WARN("Unable to resume guest CPUs after save failure");
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR);
|
||||
}
|
||||
@ -3568,7 +3568,7 @@ endjob:
|
||||
if ((ret == 0) && (flags & VIR_DUMP_CRASH)) {
|
||||
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_CRASHED, 0);
|
||||
virDomainAuditStop(vm, "crashed");
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_CRASHED);
|
||||
}
|
||||
@ -3588,7 +3588,7 @@ endjob:
|
||||
if (resume && qemuProcessStartCPUs(driver, vm, dom->conn,
|
||||
VIR_DOMAIN_RUNNING_UNPAUSED,
|
||||
QEMU_ASYNC_JOB_DUMP) < 0) {
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR);
|
||||
if (virGetLastError() == NULL)
|
||||
@ -3835,7 +3835,7 @@ processGuestPanicEvent(virQEMUDriverPtr driver,
|
||||
VIR_DOMAIN_CRASHED,
|
||||
VIR_DOMAIN_CRASHED_PANICKED);
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_CRASHED,
|
||||
VIR_DOMAIN_EVENT_CRASHED_PANICKED);
|
||||
|
||||
@ -3875,7 +3875,7 @@ processGuestPanicEvent(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_CRASHED, 0);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_CRASHED);
|
||||
|
||||
@ -5402,7 +5402,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_RESTORED);
|
||||
virDomainAuditStart(vm, "restored", true);
|
||||
@ -5427,7 +5427,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
|
||||
} else {
|
||||
int detail = (start_paused ? VIR_DOMAIN_EVENT_SUSPENDED_PAUSED :
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_RESTORED);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
detail);
|
||||
if (event)
|
||||
@ -6067,13 +6067,13 @@ qemuDomainObjStart(virConnectPtr conn,
|
||||
virDomainAuditStart(vm, "booted", ret >= 0);
|
||||
if (ret >= 0) {
|
||||
virDomainEventPtr event =
|
||||
virDomainEventNewFromObj(vm,
|
||||
virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_BOOTED);
|
||||
if (event) {
|
||||
qemuDomainEventQueue(driver, event);
|
||||
if (start_paused) {
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
|
||||
if (event)
|
||||
@ -6205,7 +6205,7 @@ static virDomainPtr qemuDomainDefineXML(virConnectPtr conn, const char *xml) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_DEFINED,
|
||||
!oldDef ?
|
||||
VIR_DOMAIN_EVENT_DEFINED_ADDED :
|
||||
@ -6293,7 +6293,7 @@ qemuDomainUndefineFlags(virDomainPtr dom,
|
||||
if (virDomainDeleteConfig(cfg->configDir, cfg->autostartDir, vm) < 0)
|
||||
goto cleanup;
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_UNDEFINED,
|
||||
VIR_DOMAIN_EVENT_UNDEFINED_REMOVED);
|
||||
|
||||
@ -11778,7 +11778,7 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn,
|
||||
goto cleanup;
|
||||
|
||||
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT) {
|
||||
event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT);
|
||||
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT, 0);
|
||||
virDomainAuditStop(vm, "from-snapshot");
|
||||
@ -11794,7 +11794,7 @@ cleanup:
|
||||
qemuProcessStartCPUs(driver, vm, conn,
|
||||
VIR_DOMAIN_RUNNING_UNPAUSED,
|
||||
QEMU_ASYNC_JOB_NONE) < 0) {
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR);
|
||||
if (virGetLastError() == NULL) {
|
||||
@ -12533,7 +12533,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
|
||||
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT) {
|
||||
virDomainEventPtr event;
|
||||
|
||||
event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT);
|
||||
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT, 0);
|
||||
virDomainAuditStop(vm, "from-snapshot");
|
||||
@ -12553,7 +12553,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
|
||||
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED,
|
||||
VIR_DOMAIN_PAUSED_FROM_SNAPSHOT);
|
||||
event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT);
|
||||
if (event)
|
||||
qemuDomainEventQueue(driver, event);
|
||||
@ -12567,7 +12567,7 @@ endjob:
|
||||
VIR_DOMAIN_RUNNING_UNPAUSED,
|
||||
QEMU_ASYNC_JOB_SNAPSHOT) < 0) {
|
||||
virDomainEventPtr event = NULL;
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR);
|
||||
if (event)
|
||||
@ -13364,7 +13364,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT, 0);
|
||||
virDomainAuditStop(vm, "from-snapshot");
|
||||
detail = VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT;
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
detail);
|
||||
if (event)
|
||||
@ -13384,7 +13384,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
* that user will be alerted that they are now paused.
|
||||
* If restore later succeeds, we might replace this. */
|
||||
detail = VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT;
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
detail);
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
@ -13416,7 +13416,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
VIR_QEMU_PROCESS_START_PAUSED);
|
||||
virDomainAuditStart(vm, "from-snapshot", rc >= 0);
|
||||
detail = VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT;
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
detail);
|
||||
if (rc < 0)
|
||||
@ -13433,7 +13433,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
if (was_stopped) {
|
||||
/* Transition 3, use event as-is and add event2 */
|
||||
detail = VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT;
|
||||
event2 = virDomainEventNewFromObj(vm,
|
||||
event2 = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
detail);
|
||||
} /* else transition 6 and 9 use event as-is */
|
||||
@ -13454,13 +13454,13 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
if (was_stopped) {
|
||||
/* Transition 2 */
|
||||
detail = VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT;
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
detail);
|
||||
} else if (was_running) {
|
||||
/* Transition 8 */
|
||||
detail = VIR_DOMAIN_EVENT_RESUMED;
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
detail);
|
||||
}
|
||||
@ -13477,7 +13477,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT, 0);
|
||||
virDomainAuditStop(vm, "from-snapshot");
|
||||
detail = VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT;
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
detail);
|
||||
}
|
||||
@ -13519,12 +13519,12 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
goto endjob;
|
||||
}
|
||||
detail = VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT;
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
detail);
|
||||
if (paused) {
|
||||
detail = VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT;
|
||||
event2 = virDomainEventNewFromObj(vm,
|
||||
event2 = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
detail);
|
||||
}
|
||||
@ -14184,7 +14184,7 @@ cleanup:
|
||||
VIR_DOMAIN_RUNNING_UNPAUSED,
|
||||
QEMU_ASYNC_JOB_NONE) < 0) {
|
||||
virDomainEventPtr event = NULL;
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR);
|
||||
if (event)
|
||||
|
@ -1513,7 +1513,7 @@ qemuMigrationSetOffline(virQEMUDriverPtr driver,
|
||||
if (ret == 0) {
|
||||
virDomainEventPtr event;
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED);
|
||||
if (event)
|
||||
@ -2422,7 +2422,7 @@ done:
|
||||
|
||||
if (!(flags & VIR_MIGRATE_OFFLINE)) {
|
||||
virDomainAuditStart(vm, "migrated", true);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_MIGRATED);
|
||||
}
|
||||
@ -2736,7 +2736,7 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver,
|
||||
VIR_QEMU_PROCESS_STOP_MIGRATED);
|
||||
virDomainAuditStop(vm, "migrated");
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_MIGRATED);
|
||||
} else {
|
||||
@ -2757,7 +2757,7 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
VIR_DOMAIN_EVENT_RESUMED_MIGRATED);
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
|
||||
@ -4100,7 +4100,7 @@ qemuMigrationPerformJob(virQEMUDriverPtr driver,
|
||||
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_MIGRATED,
|
||||
VIR_QEMU_PROCESS_STOP_MIGRATED);
|
||||
virDomainAuditStop(vm, "migrated");
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_MIGRATED);
|
||||
}
|
||||
@ -4123,7 +4123,7 @@ endjob:
|
||||
vm->def->name);
|
||||
}
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
VIR_DOMAIN_EVENT_RESUMED_MIGRATED);
|
||||
}
|
||||
@ -4205,7 +4205,7 @@ qemuMigrationPerformPhase(virQEMUDriverPtr driver,
|
||||
vm->def->name);
|
||||
}
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
VIR_DOMAIN_EVENT_RESUMED_MIGRATED);
|
||||
}
|
||||
@ -4418,7 +4418,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
|
||||
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED,
|
||||
VIR_QEMU_PROCESS_STOP_MIGRATED);
|
||||
virDomainAuditStop(vm, "failed");
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_FAILED);
|
||||
goto endjob;
|
||||
@ -4469,7 +4469,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_DEFINED,
|
||||
newVM ?
|
||||
VIR_DOMAIN_EVENT_DEFINED_ADDED :
|
||||
@ -4507,7 +4507,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
|
||||
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED,
|
||||
VIR_QEMU_PROCESS_STOP_MIGRATED);
|
||||
virDomainAuditStop(vm, "failed");
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_FAILED);
|
||||
}
|
||||
@ -4518,7 +4518,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
|
||||
dom = virGetDomain(dconn, vm->def->name, vm->def->uuid);
|
||||
|
||||
if (!(flags & VIR_MIGRATE_OFFLINE)) {
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
VIR_DOMAIN_EVENT_RESUMED_MIGRATED);
|
||||
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
|
||||
@ -4526,7 +4526,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
|
||||
VIR_DOMAIN_PAUSED_USER);
|
||||
if (event)
|
||||
qemuDomainEventQueue(driver, event);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
|
||||
}
|
||||
@ -4544,7 +4544,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
|
||||
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED,
|
||||
VIR_QEMU_PROCESS_STOP_MIGRATED);
|
||||
virDomainAuditStop(vm, "failed");
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_FAILED);
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||
auditReason = "failed";
|
||||
}
|
||||
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
eventReason);
|
||||
qemuProcessStop(driver, vm, stopReason, 0);
|
||||
@ -589,7 +589,7 @@ qemuProcessFakeReboot(void *opaque)
|
||||
goto endjob;
|
||||
}
|
||||
priv->gotShutdown = false;
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
|
||||
|
||||
@ -672,7 +672,7 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||
virDomainObjSetState(vm,
|
||||
VIR_DOMAIN_SHUTDOWN,
|
||||
VIR_DOMAIN_SHUTDOWN_UNKNOWN);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SHUTDOWN,
|
||||
VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED);
|
||||
|
||||
@ -718,7 +718,7 @@ qemuProcessHandleStop(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||
vm->def->name);
|
||||
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_UNKNOWN);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
|
||||
|
||||
@ -766,7 +766,7 @@ qemuProcessHandleResume(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING,
|
||||
VIR_DOMAIN_RUNNING_UNPAUSED);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
|
||||
|
||||
@ -857,7 +857,7 @@ qemuProcessHandleWatchdog(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||
VIR_DEBUG("Transitioned guest %s to paused state due to watchdog", vm->def->name);
|
||||
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_WATCHDOG);
|
||||
lifecycleEvent = virDomainEventNewFromObj(vm,
|
||||
lifecycleEvent = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG);
|
||||
|
||||
@ -939,7 +939,7 @@ qemuProcessHandleIOError(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||
VIR_DEBUG("Transitioned guest %s to paused state due to IO error", vm->def->name);
|
||||
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_IOERROR);
|
||||
lifecycleEvent = virDomainEventNewFromObj(vm,
|
||||
lifecycleEvent = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_IOERROR);
|
||||
|
||||
@ -1156,7 +1156,7 @@ qemuProcessHandlePMWakeup(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING,
|
||||
VIR_DOMAIN_RUNNING_WAKEUP);
|
||||
lifecycleEvent = virDomainEventNewFromObj(vm,
|
||||
lifecycleEvent = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_WAKEUP);
|
||||
|
||||
@ -1196,7 +1196,7 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_PMSUSPENDED,
|
||||
VIR_DOMAIN_PMSUSPENDED_UNKNOWN);
|
||||
lifecycleEvent =
|
||||
virDomainEventNewFromObj(vm,
|
||||
virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_PMSUSPENDED,
|
||||
VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY);
|
||||
|
||||
@ -1268,7 +1268,7 @@ qemuProcessHandlePMSuspendDisk(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_PMSUSPENDED,
|
||||
VIR_DOMAIN_PMSUSPENDED_UNKNOWN);
|
||||
lifecycleEvent =
|
||||
virDomainEventNewFromObj(vm,
|
||||
virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_PMSUSPENDED,
|
||||
VIR_DOMAIN_EVENT_PMSUSPENDED_DISK);
|
||||
|
||||
@ -4648,7 +4648,7 @@ qemuProcessAutoDestroy(virDomainObjPtr dom,
|
||||
VIR_QEMU_PROCESS_STOP_MIGRATED);
|
||||
|
||||
virDomainAuditStop(dom, "destroyed");
|
||||
event = virDomainEventNewFromObj(dom,
|
||||
event = virDomainEventLifecycleNewFromObj(dom,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
|
||||
|
||||
|
@ -4386,7 +4386,7 @@ remoteDomainBuildEventLifecycle(virNetClientProgramPtr prog ATTRIBUTE_UNUSED,
|
||||
if (!dom)
|
||||
return;
|
||||
|
||||
event = virDomainEventNewFromDom(dom, msg->event, msg->detail);
|
||||
event = virDomainEventLifecycleNewFromDom(dom, msg->event, msg->detail);
|
||||
virDomainFree(dom);
|
||||
|
||||
remoteDomainEventQueue(priv, event);
|
||||
|
@ -1638,7 +1638,7 @@ testDomainCreateXML(virConnectPtr conn, const char *xml,
|
||||
if (testDomainStartState(privconn, dom, VIR_DOMAIN_RUNNING_BOOTED) < 0)
|
||||
goto cleanup;
|
||||
|
||||
event = virDomainEventNewFromObj(dom,
|
||||
event = virDomainEventLifecycleNewFromObj(dom,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_BOOTED);
|
||||
|
||||
@ -1766,7 +1766,7 @@ static int testDomainDestroy(virDomainPtr domain)
|
||||
}
|
||||
|
||||
testDomainShutdownState(domain, privdom, VIR_DOMAIN_SHUTOFF_DESTROYED);
|
||||
event = virDomainEventNewFromObj(privdom,
|
||||
event = virDomainEventLifecycleNewFromObj(privdom,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
|
||||
|
||||
@ -1811,7 +1811,7 @@ static int testDomainResume(virDomainPtr domain)
|
||||
|
||||
virDomainObjSetState(privdom, VIR_DOMAIN_RUNNING,
|
||||
VIR_DOMAIN_RUNNING_UNPAUSED);
|
||||
event = virDomainEventNewFromObj(privdom,
|
||||
event = virDomainEventLifecycleNewFromObj(privdom,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
|
||||
ret = 0;
|
||||
@ -1853,7 +1853,7 @@ static int testDomainSuspend(virDomainPtr domain)
|
||||
}
|
||||
|
||||
virDomainObjSetState(privdom, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
|
||||
event = virDomainEventNewFromObj(privdom,
|
||||
event = virDomainEventLifecycleNewFromObj(privdom,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
|
||||
ret = 0;
|
||||
@ -1896,7 +1896,7 @@ static int testDomainShutdownFlags(virDomainPtr domain,
|
||||
}
|
||||
|
||||
testDomainShutdownState(domain, privdom, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
|
||||
event = virDomainEventNewFromObj(privdom,
|
||||
event = virDomainEventLifecycleNewFromObj(privdom,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN);
|
||||
|
||||
@ -1971,7 +1971,7 @@ static int testDomainReboot(virDomainPtr domain,
|
||||
|
||||
if (virDomainObjGetState(privdom, NULL) == VIR_DOMAIN_SHUTOFF) {
|
||||
testDomainShutdownState(domain, privdom, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
|
||||
event = virDomainEventNewFromObj(privdom,
|
||||
event = virDomainEventLifecycleNewFromObj(privdom,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN);
|
||||
|
||||
@ -2135,7 +2135,7 @@ testDomainSaveFlags(virDomainPtr domain, const char *path,
|
||||
fd = -1;
|
||||
|
||||
testDomainShutdownState(domain, privdom, VIR_DOMAIN_SHUTOFF_SAVED);
|
||||
event = virDomainEventNewFromObj(privdom,
|
||||
event = virDomainEventLifecycleNewFromObj(privdom,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_SAVED);
|
||||
|
||||
@ -2253,7 +2253,7 @@ testDomainRestoreFlags(virConnectPtr conn,
|
||||
if (testDomainStartState(privconn, dom, VIR_DOMAIN_RUNNING_RESTORED) < 0)
|
||||
goto cleanup;
|
||||
|
||||
event = virDomainEventNewFromObj(dom,
|
||||
event = virDomainEventLifecycleNewFromObj(dom,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_RESTORED);
|
||||
ret = 0;
|
||||
@ -2319,7 +2319,7 @@ static int testDomainCoreDump(virDomainPtr domain,
|
||||
|
||||
if (flags & VIR_DUMP_CRASH) {
|
||||
testDomainShutdownState(domain, privdom, VIR_DOMAIN_SHUTOFF_CRASHED);
|
||||
event = virDomainEventNewFromObj(privdom,
|
||||
event = virDomainEventLifecycleNewFromObj(privdom,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_CRASHED);
|
||||
if (!privdom->persistent) {
|
||||
@ -2803,7 +2803,7 @@ static virDomainPtr testDomainDefineXML(virConnectPtr conn,
|
||||
def = NULL;
|
||||
dom->persistent = 1;
|
||||
|
||||
event = virDomainEventNewFromObj(dom,
|
||||
event = virDomainEventLifecycleNewFromObj(dom,
|
||||
VIR_DOMAIN_EVENT_DEFINED,
|
||||
!oldDef ?
|
||||
VIR_DOMAIN_EVENT_DEFINED_ADDED :
|
||||
@ -2946,7 +2946,7 @@ static int testDomainCreateWithFlags(virDomainPtr domain, unsigned int flags) {
|
||||
goto cleanup;
|
||||
domain->id = privdom->def->id;
|
||||
|
||||
event = virDomainEventNewFromObj(privdom,
|
||||
event = virDomainEventLifecycleNewFromObj(privdom,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_BOOTED);
|
||||
ret = 0;
|
||||
@ -3011,7 +3011,7 @@ static int testDomainUndefineFlags(virDomainPtr domain,
|
||||
* behavior here. */
|
||||
}
|
||||
|
||||
event = virDomainEventNewFromObj(privdom,
|
||||
event = virDomainEventLifecycleNewFromObj(privdom,
|
||||
VIR_DOMAIN_EVENT_UNDEFINED,
|
||||
VIR_DOMAIN_EVENT_UNDEFINED_REMOVED);
|
||||
privdom->hasManagedSave = false;
|
||||
@ -6180,7 +6180,7 @@ testDomainManagedSave(virDomainPtr dom, unsigned int flags)
|
||||
}
|
||||
|
||||
testDomainShutdownState(dom, vm, VIR_DOMAIN_SHUTOFF_SAVED);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_SAVED);
|
||||
vm->hasManagedSave = true;
|
||||
@ -6719,7 +6719,7 @@ testDomainSnapshotCreateXML(virDomainPtr domain,
|
||||
virDomainObjIsActive(vm)) {
|
||||
testDomainShutdownState(domain, vm,
|
||||
VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT);
|
||||
event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT);
|
||||
}
|
||||
}
|
||||
@ -6985,7 +6985,7 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
virResetError(err);
|
||||
testDomainShutdownState(snapshot->domain, vm,
|
||||
VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT);
|
||||
if (event)
|
||||
@ -7001,7 +7001,7 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
/* Create an event now in case the restore fails, so
|
||||
* that user will be alerted that they are now paused.
|
||||
* If restore later succeeds, we might replace this. */
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT);
|
||||
}
|
||||
@ -7015,7 +7015,7 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
if (testDomainStartState(privconn, vm,
|
||||
VIR_DOMAIN_RUNNING_FROM_SNAPSHOT) < 0)
|
||||
goto cleanup;
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT);
|
||||
}
|
||||
@ -7029,7 +7029,7 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
VIR_DOMAIN_PAUSED_FROM_SNAPSHOT);
|
||||
if (was_stopped) {
|
||||
/* Transition 3, use event as-is and add event2 */
|
||||
event2 = virDomainEventNewFromObj(vm,
|
||||
event2 = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT);
|
||||
} /* else transition 6 and 9 use event as-is */
|
||||
@ -7040,12 +7040,12 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
|
||||
if (was_stopped) {
|
||||
/* Transition 2 */
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT);
|
||||
} else if (was_running) {
|
||||
/* Transition 8 */
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
VIR_DOMAIN_EVENT_RESUMED);
|
||||
}
|
||||
@ -7058,7 +7058,7 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
/* Transitions 4, 7 */
|
||||
testDomainShutdownState(snapshot->domain, vm,
|
||||
VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT);
|
||||
}
|
||||
@ -7070,11 +7070,11 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
|
||||
if (event)
|
||||
testDomainEventQueue(privconn, event);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT);
|
||||
if (paused) {
|
||||
event2 = virDomainEventNewFromObj(vm,
|
||||
event2 = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT);
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ umlAutostartDomain(virDomainObjPtr vm,
|
||||
vm->def->name, err ? err->message : _("unknown error"));
|
||||
} else {
|
||||
virDomainEventPtr event =
|
||||
virDomainEventNewFromObj(vm,
|
||||
virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_BOOTED);
|
||||
if (event)
|
||||
@ -347,7 +347,7 @@ reread:
|
||||
|
||||
umlShutdownVMDaemon(driver, dom, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
|
||||
virDomainAuditStop(dom, "shutdown");
|
||||
event = virDomainEventNewFromObj(dom,
|
||||
event = virDomainEventLifecycleNewFromObj(dom,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN);
|
||||
if (!dom->persistent) {
|
||||
@ -381,7 +381,7 @@ reread:
|
||||
umlShutdownVMDaemon(driver, dom,
|
||||
VIR_DOMAIN_SHUTOFF_FAILED);
|
||||
virDomainAuditStop(dom, "failed");
|
||||
event = virDomainEventNewFromObj(dom,
|
||||
event = virDomainEventLifecycleNewFromObj(dom,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_FAILED);
|
||||
if (!dom->persistent) {
|
||||
@ -394,7 +394,7 @@ reread:
|
||||
umlShutdownVMDaemon(driver, dom,
|
||||
VIR_DOMAIN_SHUTOFF_FAILED);
|
||||
virDomainAuditStop(dom, "failed");
|
||||
event = virDomainEventNewFromObj(dom,
|
||||
event = virDomainEventLifecycleNewFromObj(dom,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_FAILED);
|
||||
if (!dom->persistent) {
|
||||
@ -605,7 +605,7 @@ static void umlNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque)
|
||||
|
||||
if (newVM) {
|
||||
virDomainEventPtr event =
|
||||
virDomainEventNewFromObj(vm,
|
||||
virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_DEFINED,
|
||||
VIR_DOMAIN_EVENT_DEFINED_ADDED);
|
||||
if (event)
|
||||
@ -737,7 +737,7 @@ static void umlProcessAutoDestroyDom(void *payload,
|
||||
VIR_DEBUG("Killing domain");
|
||||
umlShutdownVMDaemon(data->driver, dom, VIR_DOMAIN_SHUTOFF_DESTROYED);
|
||||
virDomainAuditStop(dom, "destroyed");
|
||||
event = virDomainEventNewFromObj(dom,
|
||||
event = virDomainEventLifecycleNewFromObj(dom,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
|
||||
|
||||
@ -1600,7 +1600,7 @@ static virDomainPtr umlDomainCreateXML(virConnectPtr conn, const char *xml,
|
||||
goto cleanup;
|
||||
}
|
||||
virDomainAuditStart(vm, "booted", true);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_BOOTED);
|
||||
|
||||
@ -1685,7 +1685,7 @@ umlDomainDestroyFlags(virDomainPtr dom,
|
||||
|
||||
umlShutdownVMDaemon(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED);
|
||||
virDomainAuditStop(vm, "destroyed");
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
|
||||
if (!vm->persistent) {
|
||||
@ -2014,7 +2014,7 @@ static int umlDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) {
|
||||
(flags & VIR_DOMAIN_START_AUTODESTROY));
|
||||
virDomainAuditStart(vm, "booted", ret >= 0);
|
||||
if (ret == 0)
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_BOOTED);
|
||||
|
||||
|
@ -6996,7 +6996,7 @@ vboxCallbackOnMachineStateChange(IVirtualBoxCallback *pThis ATTRIBUTE_UNUSED,
|
||||
detail = VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN;
|
||||
}
|
||||
|
||||
ev = virDomainEventNewFromDom(dom, event, detail);
|
||||
ev = virDomainEventLifecycleNewFromDom(dom, event, detail);
|
||||
|
||||
if (ev)
|
||||
virObjectEventStateQueue(g_pVBoxGlobalData->domainEvents, ev);
|
||||
@ -7100,7 +7100,7 @@ vboxCallbackOnMachineRegistered(IVirtualBoxCallback *pThis ATTRIBUTE_UNUSED,
|
||||
detail = VIR_DOMAIN_EVENT_UNDEFINED_REMOVED;
|
||||
}
|
||||
|
||||
ev = virDomainEventNewFromDom(dom, event, detail);
|
||||
ev = virDomainEventLifecycleNewFromDom(dom, event, detail);
|
||||
|
||||
if (ev)
|
||||
virObjectEventStateQueue(g_pVBoxGlobalData->domainEvents, ev);
|
||||
|
@ -148,7 +148,7 @@ xenInotifyDomainEventFromFile(virConnectPtr conn,
|
||||
if (xenInotifyDomainLookup(conn, filename, &name, uuid) < 0)
|
||||
return NULL;
|
||||
|
||||
event = virDomainEventNew(-1, name, uuid, type, detail);
|
||||
event = virDomainEventLifecycleNew(-1, name, uuid, type, detail);
|
||||
VIR_FREE(name);
|
||||
return event;
|
||||
}
|
||||
|
@ -849,7 +849,7 @@ retry:
|
||||
continue;
|
||||
}
|
||||
|
||||
event = virDomainEventNew(new_domids[i], name, uuid,
|
||||
event = virDomainEventLifecycleNew(new_domids[i], name, uuid,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_BOOTED);
|
||||
if (event)
|
||||
@ -919,7 +919,7 @@ retry:
|
||||
|
||||
if (!found) {
|
||||
virDomainEventPtr event =
|
||||
virDomainEventNew(-1,
|
||||
virDomainEventLifecycleNew(-1,
|
||||
priv->activeDomainList->doms[j]->name,
|
||||
priv->activeDomainList->doms[j]->uuid,
|
||||
VIR_DOMAIN_EVENT_STOPPED,
|
||||
|
Loading…
Reference in New Issue
Block a user