mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
Add event and state details for post-copy
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY and VIR_DOMAIN_PAUSED_POSTCOPY are used on the source host once migration enters post-copy mode (which means the domain gets paused on the source. After the destination host takes over the execution of the domain, its virtual CPUs are resumed and the domain enters VIR_DOMAIN_RUNNING_POSTCOPY state and VIR_DOMAIN_EVENT_RESUMED_POSTCOPY event is emitted. In case migration fails during post-copy mode and none of the hosts have complete state of the domain, both domains will remain paused with VIR_DOMAIN_PAUSED_POSTCOPY_FAILED reason and an upper layer may decide what to do. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
573c41a275
commit
5a9cbc6265
@ -161,6 +161,12 @@ static const char *eventDetailToString(int event, int detail) {
|
||||
case VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR:
|
||||
ret = "API error";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY:
|
||||
ret = "Post-copy";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED:
|
||||
ret = "Post-copy Error";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_RESUMED:
|
||||
@ -174,6 +180,9 @@ static const char *eventDetailToString(int event, int detail) {
|
||||
case VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT:
|
||||
ret = "Snapshot";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_RESUMED_POSTCOPY:
|
||||
ret = "Post-copy";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_STOPPED:
|
||||
|
@ -90,6 +90,7 @@ typedef enum {
|
||||
VIR_DOMAIN_RUNNING_WAKEUP = 8, /* returned from pmsuspended due to
|
||||
wakeup event */
|
||||
VIR_DOMAIN_RUNNING_CRASHED = 9, /* resumed from crashed */
|
||||
VIR_DOMAIN_RUNNING_POSTCOPY = 10, /* running in post-copy migration mode */
|
||||
|
||||
# ifdef VIR_ENUM_SENTINELS
|
||||
VIR_DOMAIN_RUNNING_LAST
|
||||
@ -117,6 +118,8 @@ typedef enum {
|
||||
VIR_DOMAIN_PAUSED_SNAPSHOT = 9, /* paused while creating a snapshot */
|
||||
VIR_DOMAIN_PAUSED_CRASHED = 10, /* paused due to a guest crash */
|
||||
VIR_DOMAIN_PAUSED_STARTING_UP = 11, /* the domain is being started */
|
||||
VIR_DOMAIN_PAUSED_POSTCOPY = 12, /* paused for post-copy migration */
|
||||
VIR_DOMAIN_PAUSED_POSTCOPY_FAILED = 13, /* paused after failed post-copy */
|
||||
|
||||
# ifdef VIR_ENUM_SENTINELS
|
||||
VIR_DOMAIN_PAUSED_LAST
|
||||
@ -2407,6 +2410,8 @@ typedef enum {
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_RESTORED = 4, /* Restored from paused state file */
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT = 5, /* Restored from paused snapshot */
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR = 6, /* suspended after failure during libvirt API call */
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY = 7, /* suspended for post-copy migration */
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED = 8, /* suspended after failed post-copy */
|
||||
|
||||
# ifdef VIR_ENUM_SENTINELS
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_LAST
|
||||
@ -2422,6 +2427,8 @@ typedef enum {
|
||||
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED = 0, /* Normal resume due to admin unpause */
|
||||
VIR_DOMAIN_EVENT_RESUMED_MIGRATED = 1, /* Resumed for completion of migration */
|
||||
VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT = 2, /* Resumed from snapshot */
|
||||
VIR_DOMAIN_EVENT_RESUMED_POSTCOPY = 3, /* Resumed, but migration is still
|
||||
running in post-copy mode */
|
||||
|
||||
# ifdef VIR_ENUM_SENTINELS
|
||||
VIR_DOMAIN_EVENT_RESUMED_LAST
|
||||
|
@ -675,7 +675,8 @@ VIR_ENUM_IMPL(virDomainRunningReason, VIR_DOMAIN_RUNNING_LAST,
|
||||
"migration canceled",
|
||||
"save canceled",
|
||||
"wakeup",
|
||||
"crashed")
|
||||
"crashed",
|
||||
"post-copy")
|
||||
|
||||
VIR_ENUM_IMPL(virDomainBlockedReason, VIR_DOMAIN_BLOCKED_LAST,
|
||||
"unknown")
|
||||
@ -692,7 +693,9 @@ VIR_ENUM_IMPL(virDomainPausedReason, VIR_DOMAIN_PAUSED_LAST,
|
||||
"shutdown",
|
||||
"snapshot",
|
||||
"panicked",
|
||||
"starting up")
|
||||
"starting up",
|
||||
"post-copy",
|
||||
"post-copy failed")
|
||||
|
||||
VIR_ENUM_IMPL(virDomainShutdownReason, VIR_DOMAIN_SHUTDOWN_LAST,
|
||||
"unknown",
|
||||
|
@ -182,7 +182,8 @@ VIR_ENUM_IMPL(virshDomainRunningReason,
|
||||
N_("migration canceled"),
|
||||
N_("save canceled"),
|
||||
N_("event wakeup"),
|
||||
N_("crashed"))
|
||||
N_("crashed"),
|
||||
N_("post-copy"))
|
||||
|
||||
VIR_ENUM_DECL(virshDomainBlockedReason)
|
||||
VIR_ENUM_IMPL(virshDomainBlockedReason,
|
||||
@ -203,7 +204,9 @@ VIR_ENUM_IMPL(virshDomainPausedReason,
|
||||
N_("shutting down"),
|
||||
N_("creating snapshot"),
|
||||
N_("crashed"),
|
||||
N_("starting up"))
|
||||
N_("starting up"),
|
||||
N_("post-copy"),
|
||||
N_("post-copy failed"))
|
||||
|
||||
VIR_ENUM_DECL(virshDomainShutdownReason)
|
||||
VIR_ENUM_IMPL(virshDomainShutdownReason,
|
||||
|
@ -11449,14 +11449,17 @@ VIR_ENUM_IMPL(virshDomainEventSuspended,
|
||||
N_("Watchdog"),
|
||||
N_("Restored"),
|
||||
N_("Snapshot"),
|
||||
N_("API error"))
|
||||
N_("API error"),
|
||||
N_("Post-copy"),
|
||||
N_("Post-copy Error"))
|
||||
|
||||
VIR_ENUM_DECL(virshDomainEventResumed)
|
||||
VIR_ENUM_IMPL(virshDomainEventResumed,
|
||||
VIR_DOMAIN_EVENT_RESUMED_LAST,
|
||||
N_("Unpaused"),
|
||||
N_("Migrated"),
|
||||
N_("Snapshot"))
|
||||
N_("Snapshot"),
|
||||
N_("Post-copy"))
|
||||
|
||||
VIR_ENUM_DECL(virshDomainEventStopped)
|
||||
VIR_ENUM_IMPL(virshDomainEventStopped,
|
||||
|
Loading…
Reference in New Issue
Block a user