And replace all calls with virObjectEventStateQueue such that:
qemuDomainEventQueue(driver, event);
becomes:
virObjectEventStateQueue(driver->domainEventState, event);
And remove NULL checking from all callers.
Signed-off-by: Anya Harter <aharter(a)redhat.com>
---
src/qemu/qemu_blockjob.c | 4 +-
src/qemu/qemu_cgroup.c | 2 +-
src/qemu/qemu_domain.c | 11 +----
src/qemu/qemu_domain.h | 2 -
src/qemu/qemu_driver.c | 88 ++++++++++++++++++---------------------
src/qemu/qemu_hotplug.c | 26 ++++++------
src/qemu/qemu_migration.c | 24 +++++------
src/qemu/qemu_process.c | 54 ++++++++++++------------
8 files changed, 98 insertions(+), 113 deletions(-)
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index e0dfb88c1c..b08e047490 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -210,8 +210,8 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver,
"after block job", vm->def->name);
}
- qemuDomainEventQueue(driver, event);
- qemuDomainEventQueue(driver, event2);
+ virObjectEventStateQueue(driver->domainEventState, event);
+ virObjectEventStateQueue(driver->domainEventState, event2);
virObjectUnref(cfg);
}
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 43c5ae8f8e..c8fba7f9e6 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -896,7 +896,7 @@ qemuSetupCpuCgroup(virDomainObjPtr vm)
event = virDomainEventTunableNewFromObj(vm, eventParams, eventNparams);
}
- qemuDomainEventQueue(priv->driver, event);
+ virObjectEventStateQueue(priv->driver->domainEventState, event);
}
return 0;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 756e938858..2119233907 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -256,13 +256,6 @@ qemuDomainDisableNamespace(virDomainObjPtr vm,
}
-void qemuDomainEventQueue(virQEMUDriverPtr driver,
- virObjectEventPtr event)
-{
- virObjectEventStateQueue(driver->domainEventState, event);
-}
-
-
void
qemuDomainEventEmitJobCompleted(virQEMUDriverPtr driver,
virDomainObjPtr vm)
@@ -283,7 +276,7 @@ qemuDomainEventEmitJobCompleted(virQEMUDriverPtr driver,
}
event = virDomainEventJobCompletedNewFromObj(vm, params, nparams);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
@@ -7872,7 +7865,7 @@ qemuDomainCheckRemoveOptionalDisk(virQEMUDriverPtr driver,
virDomainDiskDefFree(disk);
}
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index f17157b951..fd8d9b5305 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -493,8 +493,6 @@ int qemuDomainAsyncJobPhaseFromString(qemuDomainAsyncJob job,
void qemuDomainEventFlush(int timer, void *opaque);
-void qemuDomainEventQueue(virQEMUDriverPtr driver,
- virObjectEventPtr event);
void qemuDomainEventEmitJobCompleted(virQEMUDriverPtr driver,
virDomainObjPtr vm);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index f0fb806fcd..7c79c324e6 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -975,7 +975,7 @@ static void qemuNotifyLoadDomain(virDomainObjPtr vm, int newVM, void
*opaque)
virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_DEFINED,
VIR_DOMAIN_EVENT_DEFINED_ADDED);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
}
@@ -1806,10 +1806,8 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
cleanup:
virDomainDefFree(def);
virDomainObjEndAPI(&vm);
- if (event) {
- qemuDomainEventQueue(driver, event);
- qemuDomainEventQueue(driver, event2);
- }
+ virObjectEventStateQueue(driver->domainEventState, event);
+ virObjectEventStateQueue(driver->domainEventState, event2);
virObjectUnref(caps);
virNWFilterUnlockFilterUpdates();
return dom;
@@ -1879,7 +1877,7 @@ static int qemuDomainSuspend(virDomainPtr dom)
cleanup:
virDomainObjEndAPI(&vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(cfg);
return ret;
}
@@ -1942,7 +1940,7 @@ static int qemuDomainResume(virDomainPtr dom)
cleanup:
virDomainObjEndAPI(&vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(cfg);
return ret;
}
@@ -2250,7 +2248,7 @@ qemuDomainDestroyFlags(virDomainPtr dom,
cleanup:
virDomainObjEndAPI(&vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
return ret;
}
@@ -3385,7 +3383,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver,
VIR_DOMAIN_RUNNING_SAVE_CANCELED,
QEMU_ASYNC_JOB_SAVE) < 0) {
VIR_WARN("Unable to resume guest CPUs after save failure");
- qemuDomainEventQueue(driver,
+ virObjectEventStateQueue(driver->domainEventState,
virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_SUSPENDED,
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR));
@@ -3402,7 +3400,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver,
virObjectUnref(cookie);
VIR_FREE(xml);
virQEMUSaveDataFree(data);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(caps);
return ret;
}
@@ -3973,7 +3971,7 @@ qemuDomainCoreDumpWithFormat(virDomainPtr dom,
cleanup:
virDomainObjEndAPI(&vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
return ret;
}
@@ -4251,7 +4249,7 @@ processGuestPanicEvent(virQEMUDriverPtr driver,
VIR_DOMAIN_EVENT_CRASHED,
VIR_DOMAIN_EVENT_CRASHED_PANICKED);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps)
< 0) {
VIR_WARN("Unable to save status on vm %s after state change",
@@ -4275,7 +4273,7 @@ processGuestPanicEvent(virQEMUDriverPtr driver,
VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_CRASHED);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virDomainAuditStop(vm, "destroyed");
removeInactive = true;
break;
@@ -4719,7 +4717,7 @@ processSerialChangedEvent(virQEMUDriverPtr driver,
event = virDomainEventAgentLifecycleNewFromObj(vm, newstate,
VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
endjob:
@@ -4793,7 +4791,7 @@ processMonitorEOFEvent(virQEMUDriverPtr driver,
eventReason);
qemuProcessStop(driver, vm, stopReason, QEMU_ASYNC_JOB_NONE, stopFlags);
virDomainAuditStop(vm, auditReason);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
endjob:
qemuDomainRemoveInactive(driver, vm);
@@ -5072,7 +5070,7 @@ qemuDomainPinVcpuLive(virDomainObjPtr vm,
virBitmapFree(tmpmap);
virCgroupFree(&cgroup_vcpu);
VIR_FREE(str);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
return ret;
}
@@ -5309,7 +5307,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
cleanup:
if (cgroup_emulator)
virCgroupFree(&cgroup_emulator);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
VIR_FREE(str);
virBitmapFree(pcpumap);
virDomainObjEndAPI(&vm);
@@ -5791,7 +5789,7 @@ qemuDomainPinIOThread(virDomainPtr dom,
cleanup:
if (cgroup_iothread)
virCgroupFree(&cgroup_iothread);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
VIR_FREE(str);
virBitmapFree(pcpumap);
virDomainObjEndAPI(&vm);
@@ -6622,7 +6620,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_STARTED,
VIR_DOMAIN_EVENT_STARTED_RESTORED);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
/* If it was running before, resume it now unless caller requested pause. */
@@ -6645,7 +6643,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_SUSPENDED,
detail);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
ret = 0;
@@ -7293,14 +7291,12 @@ qemuDomainObjStart(virConnectPtr conn,
virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_STARTED,
VIR_DOMAIN_EVENT_STARTED_BOOTED);
- if (event) {
- qemuDomainEventQueue(driver, event);
- if (start_paused) {
- event = virDomainEventLifecycleNewFromObj(vm,
- VIR_DOMAIN_EVENT_SUSPENDED,
- VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
- qemuDomainEventQueue(driver, event);
- }
+ virObjectEventStateQueue(driver->domainEventState, event);
+ if (start_paused) {
+ event = virDomainEventLifecycleNewFromObj(vm,
+ VIR_DOMAIN_EVENT_SUSPENDED,
+ VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
}
@@ -7444,7 +7440,7 @@ qemuDomainDefineXMLFlags(virConnectPtr conn,
virDomainDefFree(oldDef);
virDomainDefFree(def);
virDomainObjEndAPI(&vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(caps);
virObjectUnref(cfg);
return dom;
@@ -7571,7 +7567,7 @@ qemuDomainUndefineFlags(virDomainPtr dom,
cleanup:
VIR_FREE(name);
virDomainObjEndAPI(&vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(cfg);
return ret;
}
@@ -7728,7 +7724,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
* is in monitor */
virObjectEventPtr event;
event = virDomainEventDeviceAddedNewFromObj(vm, alias);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
if (ret == 0)
@@ -10647,7 +10643,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
if (eventNparams) {
event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams);
eventNparams = 0;
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
if (persistentDef) {
@@ -14320,7 +14316,7 @@ qemuDomainSnapshotCreateActiveInternal(virQEMUDriverPtr driver,
}
}
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
return ret;
}
@@ -15255,7 +15251,7 @@ qemuDomainSnapshotCreateActiveExternal(virQEMUDriverPtr driver,
virDomainAuditStop(vm, "from-snapshot");
resume = false;
thaw = 0;
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
} else if (memory && pmsuspended) {
/* qemu 1.3 is unable to save a domain in pm-suspended (S3)
* state; so we must emit an event stating that it was
@@ -15264,7 +15260,7 @@ qemuDomainSnapshotCreateActiveExternal(virQEMUDriverPtr driver,
VIR_DOMAIN_PAUSED_FROM_SNAPSHOT);
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED,
VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
ret = 0;
@@ -15277,7 +15273,7 @@ qemuDomainSnapshotCreateActiveExternal(virQEMUDriverPtr driver,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_SUSPENDED,
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
if (virGetLastErrorCode() == VIR_ERR_OK) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("resuming after snapshot failed"));
@@ -16165,7 +16161,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_STOPPED,
detail);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
goto load;
}
}
@@ -16317,7 +16313,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
start_flags |= paused ? VIR_QEMU_PROCESS_START_PAUSED : 0;
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
rc = qemuProcessStart(snapshot->domain->conn, driver, vm, NULL,
QEMU_ASYNC_JOB_START, NULL, -1, NULL, NULL,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
@@ -16377,15 +16373,13 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
!(ret = virDomainSaveConfig(cfg->configDir, driver->caps,
vm->newDef ? vm->newDef : vm->def))) {
detail = VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT;
- qemuDomainEventQueue(driver,
+ virObjectEventStateQueue(driver->domainEventState,
virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_DEFINED,
detail));
}
- if (event) {
- qemuDomainEventQueue(driver, event);
- qemuDomainEventQueue(driver, event2);
- }
+ virObjectEventStateQueue(driver->domainEventState, event);
+ virObjectEventStateQueue(driver->domainEventState, event2);
virDomainObjEndAPI(&vm);
virObjectUnref(caps);
virObjectUnref(cfg);
@@ -18545,7 +18539,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
if (eventNparams) {
event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams);
eventNparams = 0;
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
}
@@ -18845,7 +18839,7 @@ qemuDomainSetMetadata(virDomainPtr dom,
if (ret == 0) {
virObjectEventPtr ev = NULL;
ev = virDomainEventMetadataChangeNewFromObj(vm, type, uri);
- qemuDomainEventQueue(driver, ev);
+ virObjectEventStateQueue(driver->domainEventState, ev);
}
qemuDomainObjEndJob(driver, vm);
@@ -20908,8 +20902,8 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
VIR_FREE(new_dom_cfg_file);
VIR_FREE(old_dom_name);
VIR_FREE(new_dom_name);
- qemuDomainEventQueue(driver, event_old);
- qemuDomainEventQueue(driver, event_new);
+ virObjectEventStateQueue(driver->domainEventState, event_old);
+ virObjectEventStateQueue(driver->domainEventState, event_new);
virObjectUnref(cfg);
return ret;
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 822e38ae08..7c0c366b99 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -2042,7 +2042,7 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver,
}
event = virDomainEventDeviceAddedNewFromObj(vm, objalias);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
/* fix the balloon size */
ignore_value(qemuProcessRefreshBalloonState(driver, vm, QEMU_ASYNC_JOB_NONE));
@@ -3807,7 +3807,7 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
virDomainAuditDisk(vm, disk->src, NULL, "detach", true);
event = virDomainEventDeviceRemovedNewFromObj(vm, disk->info.alias);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
if (prManaged && !prUsed)
qemuProcessKillManagedPRDaemon(vm);
@@ -3848,7 +3848,7 @@ qemuDomainRemoveControllerDevice(virQEMUDriverPtr driver,
controller->info.alias, vm, vm->def->name);
event = virDomainEventDeviceRemovedNewFromObj(vm, controller->info.alias);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
for (i = 0; i < vm->def->ncontrollers; i++) {
if (vm->def->controllers[i] == controller) {
@@ -3894,7 +3894,7 @@ qemuDomainRemoveMemoryDevice(virQEMUDriverPtr driver,
return -1;
event = virDomainEventDeviceRemovedNewFromObj(vm, mem->info.alias);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
if ((idx = virDomainMemoryFindByDef(vm->def, mem)) >= 0)
virDomainMemoryRemove(vm->def, idx);
@@ -4020,7 +4020,7 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver,
}
event = virDomainEventDeviceRemovedNewFromObj(vm, hostdev->info->alias);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
if (hostdev->parent.type == VIR_DOMAIN_DEVICE_NET) {
net =
hostdev->parent.data.net;
@@ -4146,7 +4146,7 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
virDomainAuditNet(vm, net, NULL, "detach", true);
event = virDomainEventDeviceRemovedNewFromObj(vm, net->info.alias);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
for (i = 0; i < vm->def->nnets; i++) {
if (vm->def->nets[i] == net) {
@@ -4229,7 +4229,7 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver,
VIR_WARN("Unable to remove chr device from /dev");
event = virDomainEventDeviceRemovedNewFromObj(vm, chr->info.alias);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
qemuDomainReleaseDeviceAddress(vm, &chr->info, NULL);
qemuDomainChrRemove(vm->def, chr);
@@ -4290,7 +4290,7 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
VIR_WARN("Unable to remove RNG device from /dev");
event = virDomainEventDeviceRemovedNewFromObj(vm, rng->info.alias);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
if ((idx = virDomainRNGFind(vm->def, rng)) >= 0)
virDomainRNGRemove(vm->def, idx);
@@ -4345,7 +4345,7 @@ qemuDomainRemoveShmemDevice(virQEMUDriverPtr driver,
goto cleanup;
event = virDomainEventDeviceRemovedNewFromObj(vm, shmem->info.alias);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
if ((idx = virDomainShmemDefFind(vm->def, shmem)) >= 0)
virDomainShmemDefRemove(vm->def, idx);
@@ -4372,7 +4372,7 @@ qemuDomainRemoveWatchdog(virQEMUDriverPtr driver,
watchdog->info.alias, vm, vm->def->name);
event = virDomainEventDeviceRemovedNewFromObj(vm, watchdog->info.alias);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
qemuDomainReleaseDeviceAddress(vm, &watchdog->info, NULL);
virDomainWatchdogDefFree(vm->def->watchdog);
vm->def->watchdog = NULL;
@@ -4393,7 +4393,7 @@ qemuDomainRemoveInputDevice(virDomainObjPtr vm,
dev->info.alias, vm, vm->def->name);
event = virDomainEventDeviceRemovedNewFromObj(vm, dev->info.alias);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
for (i = 0; i < vm->def->ninputs; i++) {
if (vm->def->inputs[i] == dev)
break;
@@ -4426,7 +4426,7 @@ qemuDomainRemoveVsockDevice(virDomainObjPtr vm,
dev->info.alias, vm, vm->def->name);
event = virDomainEventDeviceRemovedNewFromObj(vm, dev->info.alias);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
qemuDomainReleaseDeviceAddress(vm, &dev->info, NULL);
virDomainVsockDefFree(vm->def->vsock);
vm->def->vsock = NULL;
@@ -4466,7 +4466,7 @@ qemuDomainRemoveRedirdevDevice(virQEMUDriverPtr driver,
virDomainAuditRedirdev(vm, dev, "detach", true);
event = virDomainEventDeviceRemovedNewFromObj(vm, dev->info.alias);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
if ((idx = virDomainRedirdevDefFind(vm->def, dev)) >= 0)
virDomainRedirdevDefRemove(vm->def, idx);
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index ee482475f5..910766080c 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1245,7 +1245,7 @@ qemuMigrationSrcSetOffline(virQEMUDriverPtr driver,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_SUSPENDED,
VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
return ret;
@@ -1285,7 +1285,7 @@ qemuMigrationAnyPostcopyFailed(virQEMUDriverPtr driver,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_SUSPENDED,
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
} else {
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED,
VIR_DOMAIN_PAUSED_POSTCOPY_FAILED);
@@ -2613,7 +2613,7 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
qemuDomainRemoveInactiveJob(driver, vm);
}
virDomainObjEndAPI(&vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
qemuMigrationCookieFree(mig);
virObjectUnref(caps);
virNWFilterUnlockFilterUpdates();
@@ -2967,7 +2967,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_MIGRATED);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
qemuDomainEventEmitJobCompleted(driver, vm);
} else {
virErrorPtr orig_err = virSaveLastError();
@@ -2987,7 +2987,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_RESUMED,
VIR_DOMAIN_EVENT_RESUMED_MIGRATED);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
@@ -4649,7 +4649,7 @@ qemuMigrationSrcPerformJob(virQEMUDriverPtr driver,
cleanup:
virDomainObjEndAPI(&vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(cfg);
return ret;
}
@@ -4725,7 +4725,7 @@ qemuMigrationSrcPerformPhase(virQEMUDriverPtr driver,
cleanup:
virDomainObjEndAPI(&vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
return ret;
}
@@ -4889,7 +4889,7 @@ qemuMigrationDstPersist(virQEMUDriverPtr driver,
oldPersist ?
VIR_DOMAIN_EVENT_DEFINED_UPDATED :
VIR_DOMAIN_EVENT_DEFINED_ADDED);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
ret = 0;
@@ -5082,7 +5082,7 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_RESUMED,
VIR_DOMAIN_EVENT_RESUMED_POSTCOPY);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
}
@@ -5117,14 +5117,14 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_RESUMED,
VIR_DOMAIN_EVENT_RESUMED_MIGRATED);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_SUSPENDED,
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
if (virDomainObjIsActive(vm) &&
@@ -5146,7 +5146,7 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_FAILED);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
} else {
qemuMigrationAnyPostcopyFailed(driver, vm);
}
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 480bc8c1ad..84e0506d93 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -344,7 +344,7 @@ qemuProcessHandleMonitorError(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
((qemuDomainObjPrivatePtr) vm->privateData)->monError = true;
event = virDomainEventControlErrorNewFromObj(vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnlock(vm);
}
@@ -416,7 +416,7 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
ret = 0;
cleanup:
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(cfg);
return ret;
}
@@ -491,7 +491,7 @@ qemuProcessFakeReboot(void *opaque)
if (ret == -1)
ignore_value(qemuProcessKill(vm, VIR_QEMU_PROCESS_KILL_FORCE));
virDomainObjEndAPI(&vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(cfg);
}
@@ -540,7 +540,7 @@ qemuProcessHandleEvent(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
seconds, micros, details);
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
return 0;
}
@@ -612,7 +612,7 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
unlock:
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(cfg);
return 0;
@@ -677,7 +677,7 @@ qemuProcessHandleStop(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
unlock:
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(cfg);
return 0;
@@ -719,7 +719,7 @@ qemuProcessHandleResume(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
unlock:
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(cfg);
return 0;
}
@@ -763,7 +763,7 @@ qemuProcessHandleRTCChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(cfg);
return 0;
}
@@ -823,8 +823,8 @@ qemuProcessHandleWatchdog(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
if (vm)
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, watchdogEvent);
- qemuDomainEventQueue(driver, lifecycleEvent);
+ virObjectEventStateQueue(driver->domainEventState, watchdogEvent);
+ virObjectEventStateQueue(driver->domainEventState, lifecycleEvent);
virObjectUnref(cfg);
return 0;
@@ -885,9 +885,9 @@ qemuProcessHandleIOError(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
}
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, ioErrorEvent);
- qemuDomainEventQueue(driver, ioErrorEvent2);
- qemuDomainEventQueue(driver, lifecycleEvent);
+ virObjectEventStateQueue(driver->domainEventState, ioErrorEvent);
+ virObjectEventStateQueue(driver->domainEventState, ioErrorEvent2);
+ virObjectEventStateQueue(driver->domainEventState, lifecycleEvent);
virObjectUnref(cfg);
return 0;
}
@@ -1010,7 +1010,7 @@ qemuProcessHandleGraphics(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
event = virDomainEventGraphicsNewFromObj(vm, phase, localAddr, remoteAddr,
authScheme, subject);
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
return 0;
@@ -1071,7 +1071,7 @@ qemuProcessHandleTrayChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
}
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(cfg);
return 0;
}
@@ -1109,8 +1109,8 @@ qemuProcessHandlePMWakeup(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
}
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, event);
- qemuDomainEventQueue(driver, lifecycleEvent);
+ virObjectEventStateQueue(driver->domainEventState, event);
+ virObjectEventStateQueue(driver->domainEventState, lifecycleEvent);
virObjectUnref(cfg);
return 0;
}
@@ -1151,8 +1151,8 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, event);
- qemuDomainEventQueue(driver, lifecycleEvent);
+ virObjectEventStateQueue(driver->domainEventState, event);
+ virObjectEventStateQueue(driver->domainEventState, lifecycleEvent);
virObjectUnref(cfg);
return 0;
}
@@ -1179,7 +1179,7 @@ qemuProcessHandleBalloonChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
virObjectUnref(cfg);
return 0;
}
@@ -1220,8 +1220,8 @@ qemuProcessHandlePMSuspendDisk(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, event);
- qemuDomainEventQueue(driver, lifecycleEvent);
+ virObjectEventStateQueue(driver->domainEventState, event);
+ virObjectEventStateQueue(driver->domainEventState, lifecycleEvent);
virObjectUnref(cfg);
return 0;
@@ -1367,7 +1367,7 @@ qemuProcessHandleAcpiOstInfo(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
}
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
return 0;
}
@@ -1407,7 +1407,7 @@ qemuProcessHandleBlockThreshold(qemuMonitorPtr mon
ATTRIBUTE_UNUSED,
}
virObjectUnlock(vm);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
return 0;
}
@@ -1567,7 +1567,7 @@ qemuProcessHandleMigrationPass(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
goto cleanup;
}
- qemuDomainEventQueue(driver,
+ virObjectEventStateQueue(driver->domainEventState,
virDomainEventMigrationIterationNewFromObj(vm, pass));
cleanup:
@@ -1977,7 +1977,7 @@ qemuProcessRefreshChannelVirtioState(virQEMUDriverPtr driver,
STREQ_NULLABLE(chr->target.name, "org.qemu.guest_agent.0")
&&
(event = virDomainEventAgentLifecycleNewFromObj(vm, entry->state,
agentReason)))
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
chr->state = entry->state;
}
@@ -7320,7 +7320,7 @@ qemuProcessAutoDestroy(virDomainObjPtr dom,
qemuDomainObjEndJob(driver, dom);
- qemuDomainEventQueue(driver, event);
+ virObjectEventStateQueue(driver->domainEventState, event);
}
int qemuProcessAutoDestroyAdd(virQEMUDriverPtr driver,
--
2.17.1