mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
libvirt: Define domain crash event types
This patch introduces domain crashed types and crashed reasons which will be used while guest panicked.
This commit is contained in:
parent
336bf8e28b
commit
14e7e0ae8d
@ -93,6 +93,9 @@ const char *eventToString(int event) {
|
||||
case VIR_DOMAIN_EVENT_PMSUSPENDED:
|
||||
ret = "PMSuspended";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_CRASHED:
|
||||
ret = "Crashed";
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -209,6 +212,13 @@ static const char *eventDetailToString(int event, int detail) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_CRASHED:
|
||||
switch ((virDomainEventCrashedDetailType) detail) {
|
||||
case VIR_DOMAIN_EVENT_CRASHED_PANICKED:
|
||||
ret = "Panicked";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -155,6 +155,7 @@ typedef enum {
|
||||
VIR_DOMAIN_RUNNING_SAVE_CANCELED = 7, /* returned from failed save process */
|
||||
VIR_DOMAIN_RUNNING_WAKEUP = 8, /* returned from pmsuspended due to
|
||||
wakeup event */
|
||||
VIR_DOMAIN_RUNNING_CRASHED = 9, /* resumed from crashed */
|
||||
|
||||
#ifdef VIR_ENUM_SENTINELS
|
||||
VIR_DOMAIN_RUNNING_LAST
|
||||
@ -180,6 +181,7 @@ typedef enum {
|
||||
VIR_DOMAIN_PAUSED_FROM_SNAPSHOT = 7, /* paused after restoring from snapshot */
|
||||
VIR_DOMAIN_PAUSED_SHUTTING_DOWN = 8, /* paused during shutdown process */
|
||||
VIR_DOMAIN_PAUSED_SNAPSHOT = 9, /* paused while creating a snapshot */
|
||||
VIR_DOMAIN_PAUSED_GUEST_PANICKED = 10, /* paused due to a guest panicked event */
|
||||
|
||||
#ifdef VIR_ENUM_SENTINELS
|
||||
VIR_DOMAIN_PAUSED_LAST
|
||||
@ -189,6 +191,7 @@ typedef enum {
|
||||
typedef enum {
|
||||
VIR_DOMAIN_SHUTDOWN_UNKNOWN = 0, /* the reason is unknown */
|
||||
VIR_DOMAIN_SHUTDOWN_USER = 1, /* shutting down on user request */
|
||||
VIR_DOMAIN_SHUTDOWN_CRASHED = 2, /* domain crashed */
|
||||
|
||||
#ifdef VIR_ENUM_SENTINELS
|
||||
VIR_DOMAIN_SHUTDOWN_LAST
|
||||
@ -212,6 +215,7 @@ typedef enum {
|
||||
|
||||
typedef enum {
|
||||
VIR_DOMAIN_CRASHED_UNKNOWN = 0, /* crashed for unknown reason */
|
||||
VIR_DOMAIN_CRASHED_PANICKED = 1, /* domain panicked */
|
||||
|
||||
#ifdef VIR_ENUM_SENTINELS
|
||||
VIR_DOMAIN_CRASHED_LAST
|
||||
@ -3409,6 +3413,7 @@ typedef enum {
|
||||
VIR_DOMAIN_EVENT_STOPPED = 5,
|
||||
VIR_DOMAIN_EVENT_SHUTDOWN = 6,
|
||||
VIR_DOMAIN_EVENT_PMSUSPENDED = 7,
|
||||
VIR_DOMAIN_EVENT_CRASHED = 8,
|
||||
|
||||
#ifdef VIR_ENUM_SENTINELS
|
||||
VIR_DOMAIN_EVENT_LAST
|
||||
@ -3540,6 +3545,17 @@ typedef enum {
|
||||
#endif
|
||||
} virDomainEventPMSuspendedDetailType;
|
||||
|
||||
/*
|
||||
* Details about the 'crashed' lifecycle event
|
||||
*/
|
||||
typedef enum {
|
||||
VIR_DOMAIN_EVENT_CRASHED_PANICKED = 0, /* Guest was panicked */
|
||||
|
||||
#ifdef VIR_ENUM_SENTINELS
|
||||
VIR_DOMAIN_EVENT_CRASHED_LAST
|
||||
#endif
|
||||
} virDomainEventCrashedDetailType;
|
||||
|
||||
/**
|
||||
* virConnectDomainEventCallback:
|
||||
* @conn: virConnect connection
|
||||
|
@ -645,7 +645,8 @@ VIR_ENUM_IMPL(virDomainRunningReason, VIR_DOMAIN_RUNNING_LAST,
|
||||
"unpaused",
|
||||
"migration canceled",
|
||||
"save canceled",
|
||||
"wakeup")
|
||||
"wakeup",
|
||||
"crashed")
|
||||
|
||||
VIR_ENUM_IMPL(virDomainBlockedReason, VIR_DOMAIN_BLOCKED_LAST,
|
||||
"unknown")
|
||||
@ -660,11 +661,13 @@ VIR_ENUM_IMPL(virDomainPausedReason, VIR_DOMAIN_PAUSED_LAST,
|
||||
"watchdog",
|
||||
"from snapshot",
|
||||
"shutdown",
|
||||
"snapshot")
|
||||
"snapshot",
|
||||
"panicked")
|
||||
|
||||
VIR_ENUM_IMPL(virDomainShutdownReason, VIR_DOMAIN_SHUTDOWN_LAST,
|
||||
"unknown",
|
||||
"user")
|
||||
"user",
|
||||
"crashed")
|
||||
|
||||
VIR_ENUM_IMPL(virDomainShutoffReason, VIR_DOMAIN_SHUTOFF_LAST,
|
||||
"unknown",
|
||||
@ -677,7 +680,8 @@ VIR_ENUM_IMPL(virDomainShutoffReason, VIR_DOMAIN_SHUTOFF_LAST,
|
||||
"from snapshot")
|
||||
|
||||
VIR_ENUM_IMPL(virDomainCrashedReason, VIR_DOMAIN_CRASHED_LAST,
|
||||
"unknown")
|
||||
"unknown",
|
||||
"panicked")
|
||||
|
||||
VIR_ENUM_IMPL(virDomainPMSuspendedReason, VIR_DOMAIN_PMSUSPENDED_LAST,
|
||||
"unknown")
|
||||
|
@ -192,6 +192,8 @@ vshDomainStateReasonToString(int state, int reason)
|
||||
return N_("save canceled");
|
||||
case VIR_DOMAIN_RUNNING_WAKEUP:
|
||||
return N_("event wakeup");
|
||||
case VIR_DOMAIN_RUNNING_CRASHED:
|
||||
return N_("crashed");
|
||||
case VIR_DOMAIN_RUNNING_UNKNOWN:
|
||||
case VIR_DOMAIN_RUNNING_LAST:
|
||||
;
|
||||
@ -226,6 +228,8 @@ vshDomainStateReasonToString(int state, int reason)
|
||||
return N_("shutting down");
|
||||
case VIR_DOMAIN_PAUSED_SNAPSHOT:
|
||||
return N_("creating snapshot");
|
||||
case VIR_DOMAIN_PAUSED_GUEST_PANICKED:
|
||||
return N_("guest panicked");
|
||||
case VIR_DOMAIN_PAUSED_UNKNOWN:
|
||||
case VIR_DOMAIN_PAUSED_LAST:
|
||||
;
|
||||
@ -236,6 +240,8 @@ vshDomainStateReasonToString(int state, int reason)
|
||||
switch ((virDomainShutdownReason) reason) {
|
||||
case VIR_DOMAIN_SHUTDOWN_USER:
|
||||
return N_("user");
|
||||
case VIR_DOMAIN_SHUTDOWN_CRASHED:
|
||||
return N_("crashed");
|
||||
case VIR_DOMAIN_SHUTDOWN_UNKNOWN:
|
||||
case VIR_DOMAIN_SHUTDOWN_LAST:
|
||||
;
|
||||
@ -266,6 +272,8 @@ vshDomainStateReasonToString(int state, int reason)
|
||||
|
||||
case VIR_DOMAIN_CRASHED:
|
||||
switch ((virDomainCrashedReason) reason) {
|
||||
case VIR_DOMAIN_CRASHED_PANICKED:
|
||||
return N_("panicked");
|
||||
case VIR_DOMAIN_CRASHED_UNKNOWN:
|
||||
case VIR_DOMAIN_CRASHED_LAST:
|
||||
;
|
||||
|
Loading…
Reference in New Issue
Block a user