mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
294397b63b
commit
03abfd2a6e
@ -286,7 +286,6 @@ struct _qemuDomainObjPrivate {
|
|||||||
qemuAgentPtr agent;
|
qemuAgentPtr agent;
|
||||||
bool agentError;
|
bool agentError;
|
||||||
|
|
||||||
bool gotShutdown;
|
|
||||||
bool beingDestroyed;
|
bool beingDestroyed;
|
||||||
char *pidfile;
|
char *pidfile;
|
||||||
|
|
||||||
|
@ -4748,7 +4748,8 @@ processMonitorEOFEvent(virQEMUDriverPtr driver,
|
|||||||
goto endjob;
|
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; "
|
VIR_DEBUG("Monitor connection to '%s' closed without SHUTDOWN event; "
|
||||||
"assuming the domain crashed", vm->def->name);
|
"assuming the domain crashed", vm->def->name);
|
||||||
eventReason = VIR_DOMAIN_EVENT_STOPPED_FAILED;
|
eventReason = VIR_DOMAIN_EVENT_STOPPED_FAILED;
|
||||||
|
@ -491,7 +491,6 @@ qemuProcessFakeReboot(void *opaque)
|
|||||||
"%s", _("resume operation failed"));
|
"%s", _("resume operation failed"));
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
priv->gotShutdown = false;
|
|
||||||
|
|
||||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||||
VIR_WARN("Unable to save status on vm %s after state change",
|
VIR_WARN("Unable to save status on vm %s after state change",
|
||||||
@ -578,7 +577,7 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
|||||||
virObjectLock(vm);
|
virObjectLock(vm);
|
||||||
|
|
||||||
priv = vm->privateData;
|
priv = vm->privateData;
|
||||||
if (priv->gotShutdown) {
|
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_SHUTDOWN) {
|
||||||
VIR_DEBUG("Ignoring repeated SHUTDOWN event from domain %s",
|
VIR_DEBUG("Ignoring repeated SHUTDOWN event from domain %s",
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
goto unlock;
|
goto unlock;
|
||||||
@ -587,7 +586,6 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
|||||||
vm->def->name);
|
vm->def->name);
|
||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
priv->gotShutdown = true;
|
|
||||||
|
|
||||||
VIR_DEBUG("Transitioned guest %s to shutdown state",
|
VIR_DEBUG("Transitioned guest %s to shutdown state",
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
@ -5980,7 +5978,6 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver,
|
|||||||
priv->monJSON = true;
|
priv->monJSON = true;
|
||||||
priv->monError = false;
|
priv->monError = false;
|
||||||
priv->monStart = 0;
|
priv->monStart = 0;
|
||||||
priv->gotShutdown = false;
|
|
||||||
priv->runningReason = VIR_DOMAIN_RUNNING_UNKNOWN;
|
priv->runningReason = VIR_DOMAIN_RUNNING_UNKNOWN;
|
||||||
|
|
||||||
VIR_DEBUG("Updating guest CPU definition");
|
VIR_DEBUG("Updating guest CPU definition");
|
||||||
@ -7394,8 +7391,6 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
monConfig = NULL;
|
monConfig = NULL;
|
||||||
priv->monJSON = monJSON;
|
priv->monJSON = monJSON;
|
||||||
|
|
||||||
priv->gotShutdown = false;
|
|
||||||
|
|
||||||
/* Attaching to running QEMU so we need to detect whether it was started
|
/* Attaching to running QEMU so we need to detect whether it was started
|
||||||
* with -no-reboot. */
|
* with -no-reboot. */
|
||||||
qemuProcessPrepareAllowReboot(vm);
|
qemuProcessPrepareAllowReboot(vm);
|
||||||
|
Loading…
Reference in New Issue
Block a user