mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
qemu: Add support for postcopy-recover QEMU migration state
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
5dd2d11ec0
commit
73b81fc55f
@ -1744,6 +1744,7 @@ qemuMigrationUpdateJobType(virDomainJobData *jobData)
|
||||
|
||||
switch ((qemuMonitorMigrationStatus) priv->stats.mig.status) {
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER:
|
||||
jobData->status = VIR_DOMAIN_JOB_STATUS_POSTCOPY;
|
||||
break;
|
||||
|
||||
|
@ -149,7 +149,7 @@ VIR_ENUM_IMPL(qemuMonitorMigrationStatus,
|
||||
"inactive", "setup",
|
||||
"active", "pre-switchover",
|
||||
"device", "postcopy-active",
|
||||
"postcopy-paused",
|
||||
"postcopy-paused", "postcopy-recover",
|
||||
"completed", "failed",
|
||||
"cancelling", "cancelled",
|
||||
"wait-unplug",
|
||||
|
@ -796,6 +796,7 @@ typedef enum {
|
||||
QEMU_MONITOR_MIGRATION_STATUS_DEVICE,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_PAUSED,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_COMPLETED,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_ERROR,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_CANCELLING,
|
||||
|
@ -3243,6 +3243,7 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply,
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_ACTIVE:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_PAUSED:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_COMPLETED:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_CANCELLING:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_PRE_SWITCHOVER:
|
||||
|
@ -1524,6 +1524,31 @@ qemuProcessHandleMigrationStatus(qemuMonitor *mon G_GNUC_UNUSED,
|
||||
}
|
||||
break;
|
||||
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER:
|
||||
if (virDomainObjIsFailedPostcopy(vm)) {
|
||||
int eventType = -1;
|
||||
int eventDetail = -1;
|
||||
|
||||
if (state == VIR_DOMAIN_PAUSED) {
|
||||
reason = VIR_DOMAIN_PAUSED_POSTCOPY;
|
||||
eventType = VIR_DOMAIN_EVENT_SUSPENDED;
|
||||
eventDetail = qemuDomainPausedReasonToSuspendedEvent(reason);
|
||||
} else {
|
||||
reason = VIR_DOMAIN_RUNNING_POSTCOPY;
|
||||
eventType = VIR_DOMAIN_EVENT_RESUMED;
|
||||
eventDetail = qemuDomainRunningReasonToResumeEvent(reason);
|
||||
}
|
||||
|
||||
VIR_DEBUG("Post-copy migration recovered; correcting state for domain '%s' to %s/%s",
|
||||
vm->def->name,
|
||||
virDomainStateTypeToString(state),
|
||||
NULLSTR(virDomainStateReasonToString(state, reason)));
|
||||
virDomainObjSetState(vm, state, reason);
|
||||
event = virDomainEventLifecycleNewFromObj(vm, eventType, eventDetail);
|
||||
qemuDomainSaveStatus(vm);
|
||||
}
|
||||
break;
|
||||
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_INACTIVE:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_SETUP:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_ACTIVE:
|
||||
|
Loading…
Reference in New Issue
Block a user