提交 cda2afac 编写于 作者: J Jiri Denemark

qemuDomainEventQueue: Check if event is non-NULL

Every single call to qemuDomainEventQueue() uses the following pattern:

    if (event)
        qemuDomainEventQueue(driver, event);

Let's move the check for valid event to qemuDomainEventQueue and
simplify all callers.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 5f7ad327
......@@ -194,10 +194,8 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver,
"after block job", vm->def->name);
}
if (event)
qemuDomainEventQueue(driver, event);
if (event2)
qemuDomainEventQueue(driver, event2);
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event2);
virObjectUnref(cfg);
}
......
......@@ -706,8 +706,7 @@ qemuSetupCpuCgroup(virQEMUDriverPtr driver,
event = virDomainEventTunableNewFromObj(vm, eventParams, eventNparams);
}
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
}
return 0;
......
......@@ -126,7 +126,8 @@ qemuDomainAsyncJobPhaseFromString(qemuDomainAsyncJob job,
void qemuDomainEventQueue(virQEMUDriverPtr driver,
virObjectEventPtr event)
{
virObjectEventStateQueue(driver->domainEventState, event);
if (event)
virObjectEventStateQueue(driver->domainEventState, event);
}
......@@ -2732,8 +2733,7 @@ qemuDomainCheckRemoveOptionalDisk(virQEMUDriverPtr driver,
virDomainDiskDefFree(disk);
}
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
return 0;
}
......
......@@ -977,8 +977,7 @@ static void qemuNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque)
virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_DEFINED,
VIR_DOMAIN_EVENT_DEFINED_ADDED);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
}
}
......@@ -1792,8 +1791,7 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
virDomainObjEndAPI(&vm);
if (event) {
qemuDomainEventQueue(driver, event);
if (event2)
qemuDomainEventQueue(driver, event2);
qemuDomainEventQueue(driver, event2);
}
virObjectUnref(caps);
virObjectUnref(qemuCaps);
......@@ -1874,8 +1872,7 @@ static int qemuDomainSuspend(virDomainPtr dom)
cleanup:
virDomainObjEndAPI(&vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(cfg);
return ret;
}
......@@ -1934,8 +1931,7 @@ static int qemuDomainResume(virDomainPtr dom)
cleanup:
virDomainObjEndAPI(&vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(cfg);
return ret;
}
......@@ -2255,8 +2251,7 @@ qemuDomainDestroyFlags(virDomainPtr dom,
cleanup:
virDomainObjEndAPI(&vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
return ret;
}
......@@ -3279,8 +3274,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
cleanup:
VIR_FREE(xml);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(caps);
return ret;
}
......@@ -3781,8 +3775,7 @@ qemuDomainCoreDumpWithFormat(virDomainPtr dom,
cleanup:
virDomainObjEndAPI(&vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
return ret;
}
......@@ -4020,8 +4013,7 @@ processGuestPanicEvent(virQEMUDriverPtr driver,
VIR_DOMAIN_EVENT_CRASHED,
VIR_DOMAIN_EVENT_CRASHED_PANICKED);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
if (virDomainLockProcessPause(driver->lockManager, vm, &priv->lockState) < 0)
VIR_WARN("Unable to release lease on %s", vm->def->name);
......@@ -4054,8 +4046,7 @@ processGuestPanicEvent(virQEMUDriverPtr driver,
VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_CRASHED);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virDomainAuditStop(vm, "destroyed");
......@@ -4498,9 +4489,9 @@ processSerialChangedEvent(virQEMUDriverPtr driver,
}
}
if ((event = virDomainEventAgentLifecycleNewFromObj(vm, newstate,
VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL)))
qemuDomainEventQueue(driver, event);
event = virDomainEventAgentLifecycleNewFromObj(vm, newstate,
VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL);
qemuDomainEventQueue(driver, event);
}
dev.data.chr->state = newstate;
......@@ -5199,8 +5190,7 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
if (cgroup_vcpu)
virCgroupFree(&cgroup_vcpu);
virDomainObjEndAPI(&vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
VIR_FREE(str);
virBitmapFree(pcpumap);
virObjectUnref(cfg);
......@@ -5401,8 +5391,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
cleanup:
if (cgroup_emulator)
virCgroupFree(&cgroup_emulator);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
VIR_FREE(str);
virBitmapFree(pcpumap);
virDomainObjEndAPI(&vm);
......@@ -5902,8 +5891,7 @@ qemuDomainPinIOThread(virDomainPtr dom,
cleanup:
if (cgroup_iothread)
virCgroupFree(&cgroup_iothread);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
VIR_FREE(str);
virBitmapFree(pcpumap);
virDomainObjEndAPI(&vm);
......@@ -6711,8 +6699,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
VIR_DOMAIN_EVENT_STARTED,
VIR_DOMAIN_EVENT_STARTED_RESTORED);
virDomainAuditStart(vm, "restored", true);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
/* If it was running before, resume it now unless caller requested pause. */
......@@ -6735,8 +6722,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_SUSPENDED,
detail);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
}
ret = 0;
......@@ -7404,8 +7390,7 @@ qemuDomainObjStart(virConnectPtr conn,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_SUSPENDED,
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
}
}
}
......@@ -7554,8 +7539,7 @@ static virDomainPtr qemuDomainDefineXMLFlags(virConnectPtr conn, const char *xml
virDomainDefFree(oldDef);
virDomainDefFree(def);
virDomainObjEndAPI(&vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(qemuCaps);
virObjectUnref(caps);
virObjectUnref(cfg);
......@@ -7672,8 +7656,7 @@ qemuDomainUndefineFlags(virDomainPtr dom,
cleanup:
VIR_FREE(name);
virDomainObjEndAPI(&vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(cfg);
return ret;
}
......@@ -7821,8 +7804,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
* is in monitor */
virObjectEventPtr event;
event = virDomainEventDeviceAddedNewFromObj(vm, alias);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
}
if (ret == 0)
......@@ -10506,8 +10488,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
if (eventNparams) {
event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams);
eventNparams = 0;
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
}
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
......@@ -13742,8 +13723,7 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn,
}
}
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
return ret;
}
......@@ -14564,8 +14544,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
virDomainAuditStop(vm, "from-snapshot");
resume = false;
thaw = 0;
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, 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
......@@ -14574,8 +14553,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
VIR_DOMAIN_PAUSED_FROM_SNAPSHOT);
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED,
VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
}
ret = 0;
......@@ -14588,8 +14566,7 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_SUSPENDED,
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
if (virGetLastError() == NULL) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("resuming after snapshot failed"));
......@@ -15428,8 +15405,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_STOPPED,
detail);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
goto load;
}
......@@ -15567,8 +15543,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
start_flags |= paused ? VIR_QEMU_PROCESS_START_PAUSED : 0;
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
rc = qemuProcessStart(snapshot->domain->conn, driver, vm,
QEMU_ASYNC_JOB_NONE, NULL, -1, NULL, NULL,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
......@@ -15628,8 +15603,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
}
if (event) {
qemuDomainEventQueue(driver, event);
if (event2)
qemuDomainEventQueue(driver, event2);
qemuDomainEventQueue(driver, event2);
}
virDomainObjEndAPI(&vm);
virObjectUnref(caps);
......@@ -17711,8 +17685,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
if (eventNparams) {
event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams);
eventNparams = 0;
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
}
}
......@@ -20057,10 +20030,8 @@ static int qemuDomainRename(virDomainPtr dom,
VIR_FREE(old_dom_name);
VIR_FREE(new_dom_name);
VIR_FREE(rename_log_msg);
if (event_old)
qemuDomainEventQueue(driver, event_old);
if (event_new)
qemuDomainEventQueue(driver, event_new);
qemuDomainEventQueue(driver, event_old);
qemuDomainEventQueue(driver, event_new);
virObjectUnref(cfg);
return ret;
......
......@@ -1834,8 +1834,7 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver,
}
event = virDomainEventDeviceAddedNewFromObj(vm, objalias);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
/* fix the balloon size if it was set to maximum */
if (fix_balloon)
......@@ -2865,8 +2864,7 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
virDomainAuditDisk(vm, disk->src, NULL, "detach", true);
event = virDomainEventDeviceRemovedNewFromObj(vm, disk->info.alias);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
for (i = 0; i < vm->def->ndisks; i++) {
if (vm->def->disks[i] == disk) {
......@@ -2908,8 +2906,7 @@ qemuDomainRemoveControllerDevice(virQEMUDriverPtr driver,
controller->info.alias, vm, vm->def->name);
event = virDomainEventDeviceRemovedNewFromObj(vm, controller->info.alias);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
for (i = 0; i < vm->def->ncontrollers; i++) {
if (vm->def->controllers[i] == controller) {
......@@ -2940,8 +2937,8 @@ qemuDomainRemoveMemoryDevice(virQEMUDriverPtr driver,
VIR_DEBUG("Removing memory device %s from domain %p %s",
mem->info.alias, vm, vm->def->name);
if ((event = virDomainEventDeviceRemovedNewFromObj(vm, mem->info.alias)))
qemuDomainEventQueue(driver, event);
event = virDomainEventDeviceRemovedNewFromObj(vm, mem->info.alias);
qemuDomainEventQueue(driver, event);
if (virAsprintf(&backendAlias, "mem%s", mem->info.alias) < 0)
return -1;
......@@ -3023,8 +3020,7 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver,
}
event = virDomainEventDeviceRemovedNewFromObj(vm, hostdev->info->alias);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
if (hostdev->parent.type == VIR_DOMAIN_DEVICE_NET) {
net = hostdev->parent.data.net;
......@@ -3138,8 +3134,7 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
virDomainAuditNet(vm, net, NULL, "detach", true);
event = virDomainEventDeviceRemovedNewFromObj(vm, net->info.alias);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
for (i = 0; i < vm->def->nnets; i++) {
if (vm->def->nets[i] == net) {
......@@ -3216,8 +3211,7 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver,
goto cleanup;
event = virDomainEventDeviceRemovedNewFromObj(vm, chr->info.alias);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
qemuDomainChrRemove(vm->def, chr);
virDomainChrDefFree(chr);
......@@ -3265,8 +3259,8 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
if (rc < 0)
goto cleanup;
if ((event = virDomainEventDeviceRemovedNewFromObj(vm, rng->info.alias)))
qemuDomainEventQueue(driver, event);
event = virDomainEventDeviceRemovedNewFromObj(vm, rng->info.alias);
qemuDomainEventQueue(driver, event);
if ((idx = virDomainRNGFind(vm->def, rng)) >= 0)
virDomainRNGRemove(vm->def, idx);
......
......@@ -2303,8 +2303,7 @@ qemuMigrationSetOffline(virQEMUDriverPtr driver,
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_SUSPENDED,
VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
}
return ret;
......@@ -3475,8 +3474,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
qemuDomainRemoveInactive(driver, vm);
}
virDomainObjEndAPI(&vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
qemuMigrationCookieFree(mig);
virObjectUnref(caps);
virNWFilterUnlockFilterUpdates();
......@@ -3825,8 +3823,7 @@ qemuMigrationConfirmPhase(virQEMUDriverPtr driver,
rv = 0;
cleanup:
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(cfg);
return rv;
}
......@@ -5362,8 +5359,7 @@ qemuMigrationPerformJob(virQEMUDriverPtr driver,
cleanup:
virDomainObjEndAPI(&vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(cfg);
return ret;
}
......@@ -5431,8 +5427,7 @@ qemuMigrationPerformPhase(virQEMUDriverPtr driver,
cleanup:
virDomainObjEndAPI(&vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
return ret;
}
......@@ -5592,8 +5587,7 @@ qemuMigrationPersist(virQEMUDriverPtr driver,
newVM ?
VIR_DOMAIN_EVENT_DEFINED_ADDED :
VIR_DOMAIN_EVENT_DEFINED_UPDATED);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
ret = 0;
......@@ -5751,8 +5745,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED,
VIR_DOMAIN_PAUSED_USER);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
event = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_SUSPENDED,
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
......@@ -5802,8 +5795,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
qemuMonitorSetDomainLog(priv->mon, -1);
VIR_FREE(priv->origname);
virDomainObjEndAPI(&vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
qemuMigrationCookieFree(mig);
if (orig_err) {
virSetError(orig_err);
......
......@@ -328,8 +328,7 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
cleanup:
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
}
......@@ -353,8 +352,7 @@ qemuProcessHandleMonitorError(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
((qemuDomainObjPrivatePtr) vm->privateData)->monError = true;
event = virDomainEventControlErrorNewFromObj(vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnlock(vm);
}
......@@ -517,8 +515,7 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(cfg);
return 0;
......@@ -594,8 +591,7 @@ qemuProcessFakeReboot(void *opaque)
if (ret == -1)
ignore_value(qemuProcessKill(vm, VIR_QEMU_PROCESS_KILL_FORCE));
virDomainObjEndAPI(&vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(cfg);
}
......@@ -644,8 +640,7 @@ qemuProcessHandleEvent(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
seconds, micros, details);
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
return 0;
}
......@@ -698,8 +693,7 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
unlock:
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(cfg);
return 0;
......@@ -748,8 +742,7 @@ qemuProcessHandleStop(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
unlock:
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(cfg);
return 0;
......@@ -802,8 +795,7 @@ qemuProcessHandleResume(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
unlock:
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(cfg);
return 0;
}
......@@ -847,8 +839,7 @@ qemuProcessHandleRTCChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(cfg);
return 0;
}
......@@ -909,10 +900,8 @@ qemuProcessHandleWatchdog(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
if (vm)
virObjectUnlock(vm);
if (watchdogEvent)
qemuDomainEventQueue(driver, watchdogEvent);
if (lifecycleEvent)
qemuDomainEventQueue(driver, lifecycleEvent);
qemuDomainEventQueue(driver, watchdogEvent);
qemuDomainEventQueue(driver, lifecycleEvent);
virObjectUnref(cfg);
return 0;
......@@ -973,12 +962,9 @@ qemuProcessHandleIOError(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
}
virObjectUnlock(vm);
if (ioErrorEvent)
qemuDomainEventQueue(driver, ioErrorEvent);
if (ioErrorEvent2)
qemuDomainEventQueue(driver, ioErrorEvent2);
if (lifecycleEvent)
qemuDomainEventQueue(driver, lifecycleEvent);
qemuDomainEventQueue(driver, ioErrorEvent);
qemuDomainEventQueue(driver, ioErrorEvent2);
qemuDomainEventQueue(driver, lifecycleEvent);
virObjectUnref(cfg);
return 0;
}
......@@ -1101,8 +1087,7 @@ qemuProcessHandleGraphics(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
event = virDomainEventGraphicsNewFromObj(vm, phase, localAddr, remoteAddr, authScheme, subject);
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
return 0;
......@@ -1163,8 +1148,7 @@ qemuProcessHandleTrayChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
}
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(cfg);
return 0;
}
......@@ -1202,10 +1186,8 @@ qemuProcessHandlePMWakeup(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
}
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
if (lifecycleEvent)
qemuDomainEventQueue(driver, lifecycleEvent);
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, lifecycleEvent);
virObjectUnref(cfg);
return 0;
}
......@@ -1246,10 +1228,8 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
if (lifecycleEvent)
qemuDomainEventQueue(driver, lifecycleEvent);
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, lifecycleEvent);
virObjectUnref(cfg);
return 0;
}
......@@ -1276,8 +1256,7 @@ qemuProcessHandleBalloonChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
virObjectUnref(cfg);
return 0;
}
......@@ -1318,10 +1297,8 @@ qemuProcessHandlePMSuspendDisk(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectUnlock(vm);
if (event)
qemuDomainEventQueue(driver, event);
if (lifecycleEvent)
qemuDomainEventQueue(driver, lifecycleEvent);
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, lifecycleEvent);
virObjectUnref(cfg);
return 0;
......@@ -5775,8 +5752,7 @@ qemuProcessAutoDestroy(virDomainObjPtr dom,
if (!dom->persistent)
qemuDomainRemoveInactive(driver, dom);
if (event)
qemuDomainEventQueue(driver, event);
qemuDomainEventQueue(driver, event);
cleanup:
virDomainObjEndAPI(&dom);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册