mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: better detection of crashed domains
When libvirtd is started and there is an unusable/not-connectable leftover from earlier started machine, it's more reasonable to say that the machine "crashed" if we know it was started with "-no-shutdown". This patch fixes that and also changes the other result (when machine was started without "-no-shutdown") to "unknown", because the previous "failed" reason means (according to include/libvirt/libvirt.h.in:174), that the machine failed to start.
This commit is contained in:
parent
b2ecfe9795
commit
bda2f17d7e
@ -3141,7 +3141,17 @@ error:
|
|||||||
* to remove danger of it ending up running twice if
|
* to remove danger of it ending up running twice if
|
||||||
* user tries to start it again later
|
* user tries to start it again later
|
||||||
*/
|
*/
|
||||||
qemuProcessStop(driver, obj, 0, VIR_DOMAIN_SHUTOFF_FAILED);
|
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_NO_SHUTDOWN)) {
|
||||||
|
/* If we couldn't get the monitor and qemu supports
|
||||||
|
* no-shutdown, we can safely say that the domain
|
||||||
|
* crashed ... */
|
||||||
|
state = VIR_DOMAIN_SHUTOFF_CRASHED;
|
||||||
|
} else {
|
||||||
|
/* ... but if it doesn't we can't say what the state
|
||||||
|
* really is and FAILED means "failed to start" */
|
||||||
|
state = VIR_DOMAIN_SHUTOFF_UNKNOWN;
|
||||||
|
}
|
||||||
|
qemuProcessStop(driver, obj, 0, state);
|
||||||
if (!obj->persistent)
|
if (!obj->persistent)
|
||||||
qemuDomainRemoveInactive(driver, obj);
|
qemuDomainRemoveInactive(driver, obj);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user