提交 03abfd2a 编写于 作者: J Jiri Denemark

qemu: Drop priv->gotShutdown

The gotShutdown bool has been redundant since we started setting
VIR_DOMAIN_SHUTDOWN state after receiving SHUTDOWN event from QEMU.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 294397b6
......@@ -286,7 +286,6 @@ struct _qemuDomainObjPrivate {
qemuAgentPtr agent;
bool agentError;
bool gotShutdown;
bool beingDestroyed;
char *pidfile;
......
......@@ -4748,7 +4748,8 @@ processMonitorEOFEvent(virQEMUDriverPtr driver,
goto endjob;
}
if (priv->monJSON && !priv->gotShutdown) {
if (priv->monJSON &&
virDomainObjGetState(vm, NULL) != VIR_DOMAIN_SHUTDOWN) {
VIR_DEBUG("Monitor connection to '%s' closed without SHUTDOWN event; "
"assuming the domain crashed", vm->def->name);
eventReason = VIR_DOMAIN_EVENT_STOPPED_FAILED;
......
......@@ -491,7 +491,6 @@ qemuProcessFakeReboot(void *opaque)
"%s", _("resume operation failed"));
goto endjob;
}
priv->gotShutdown = false;
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
VIR_WARN("Unable to save status on vm %s after state change",
......@@ -578,7 +577,7 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virObjectLock(vm);
priv = vm->privateData;
if (priv->gotShutdown) {
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_SHUTDOWN) {
VIR_DEBUG("Ignoring repeated SHUTDOWN event from domain %s",
vm->def->name);
goto unlock;
......@@ -587,7 +586,6 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
vm->def->name);
goto unlock;
}
priv->gotShutdown = true;
VIR_DEBUG("Transitioned guest %s to shutdown state",
vm->def->name);
......@@ -5980,7 +5978,6 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver,
priv->monJSON = true;
priv->monError = false;
priv->monStart = 0;
priv->gotShutdown = false;
priv->runningReason = VIR_DOMAIN_RUNNING_UNKNOWN;
VIR_DEBUG("Updating guest CPU definition");
......@@ -7394,8 +7391,6 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
monConfig = NULL;
priv->monJSON = monJSON;
priv->gotShutdown = false;
/* Attaching to running QEMU so we need to detect whether it was started
* with -no-reboot. */
qemuProcessPrepareAllowReboot(vm);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册