mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
libvirt: add daemon itself as shutdown reason
This patch introduces a new shutdown reason "daemon" in order to indicate that the daemon needed to force shutdown the domain as the best course of action to take at the moment. This action would occur during reconnection when processing encounters an error once the monitor reconnection is successful. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Reviewed-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
b0d4365a7f
commit
66a85cb136
@ -145,6 +145,8 @@ typedef enum {
|
||||
VIR_DOMAIN_SHUTOFF_FAILED = 6, /* domain failed to start */
|
||||
VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT = 7, /* restored from a snapshot which was
|
||||
* taken while domain was shutoff */
|
||||
VIR_DOMAIN_SHUTOFF_DAEMON = 8, /* daemon decides to kill domain
|
||||
during reconnection processing */
|
||||
# ifdef VIR_ENUM_SENTINELS
|
||||
VIR_DOMAIN_SHUTOFF_LAST
|
||||
# endif
|
||||
|
@ -779,7 +779,8 @@ VIR_ENUM_IMPL(virDomainShutoffReason, VIR_DOMAIN_SHUTOFF_LAST,
|
||||
"migrated",
|
||||
"saved",
|
||||
"failed",
|
||||
"from snapshot")
|
||||
"from snapshot",
|
||||
"daemon")
|
||||
|
||||
VIR_ENUM_IMPL(virDomainCrashedReason, VIR_DOMAIN_CRASHED_LAST,
|
||||
"unknown",
|
||||
|
@ -7978,10 +7978,14 @@ qemuProcessReconnect(void *opaque)
|
||||
*
|
||||
* If we cannot get to the monitor when the QEMU command
|
||||
* line used -no-shutdown, then we can safely say that the
|
||||
* domain crashed; otherwise, we don't really know. */
|
||||
* domain crashed; otherwise, if the monitor was started,
|
||||
* then we can blame ourselves, else we failed before the
|
||||
* monitor started so we don't really know. */
|
||||
if (!priv->mon && tryMonReconn &&
|
||||
qemuDomainIsUsingNoShutdown(priv))
|
||||
state = VIR_DOMAIN_SHUTOFF_CRASHED;
|
||||
else if (priv->mon)
|
||||
state = VIR_DOMAIN_SHUTOFF_DAEMON;
|
||||
else
|
||||
state = VIR_DOMAIN_SHUTOFF_UNKNOWN;
|
||||
|
||||
|
@ -212,7 +212,8 @@ VIR_ENUM_IMPL(virshDomainShutoffReason,
|
||||
N_("migrated"),
|
||||
N_("saved"),
|
||||
N_("failed"),
|
||||
N_("from snapshot"))
|
||||
N_("from snapshot"),
|
||||
N_("daemon"))
|
||||
|
||||
VIR_ENUM_DECL(virshDomainCrashedReason)
|
||||
VIR_ENUM_IMPL(virshDomainCrashedReason,
|
||||
|
Loading…
Reference in New Issue
Block a user