mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
qemu: Add support for postcopy-recover-setup migration state
This patch adds support for recognizing the new migration state reported by QEMU when post-copy recovery is requested. It is not actually used for anything yet. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
18fd4899f3
commit
79e0b50bb6
@ -106,6 +106,7 @@ virDomainJobStatusToType(virDomainJobStatus status)
|
||||
case VIR_DOMAIN_JOB_STATUS_HYPERVISOR_COMPLETED:
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY:
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY_PAUSED:
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY_RECOVER:
|
||||
case VIR_DOMAIN_JOB_STATUS_PAUSED:
|
||||
return VIR_DOMAIN_JOB_UNBOUNDED;
|
||||
|
||||
|
@ -89,6 +89,7 @@ typedef enum {
|
||||
VIR_DOMAIN_JOB_STATUS_PAUSED,
|
||||
VIR_DOMAIN_JOB_STATUS_POSTCOPY,
|
||||
VIR_DOMAIN_JOB_STATUS_POSTCOPY_PAUSED,
|
||||
VIR_DOMAIN_JOB_STATUS_POSTCOPY_RECOVER,
|
||||
VIR_DOMAIN_JOB_STATUS_COMPLETED,
|
||||
VIR_DOMAIN_JOB_STATUS_FAILED,
|
||||
VIR_DOMAIN_JOB_STATUS_CANCELED,
|
||||
|
@ -1873,6 +1873,8 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivate *priv)
|
||||
virHashRemoveAll(priv->statsSchema);
|
||||
|
||||
g_slist_free_full(g_steal_pointer(&priv->threadContextAliases), g_free);
|
||||
|
||||
priv->migrationRecoverSetup = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -199,6 +199,10 @@ struct _qemuDomainObjPrivate {
|
||||
* private XML. */
|
||||
virBitmap *migrationCaps;
|
||||
|
||||
/* True if QEMU supports "postcopy-recover-setup" migration state. Checked
|
||||
* QEMU enters the state, not to be stored in private XML. */
|
||||
bool migrationRecoverSetup;
|
||||
|
||||
/* true if qemu-pr-helper process is running for the domain */
|
||||
bool prDaemonRunning;
|
||||
|
||||
|
@ -11963,6 +11963,7 @@ qemuDomainGetJobInfoMigrationStats(virDomainObj *vm,
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY:
|
||||
case VIR_DOMAIN_JOB_STATUS_PAUSED:
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY_PAUSED:
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY_RECOVER:
|
||||
if (qemuMigrationAnyFetchStats(vm, VIR_ASYNC_JOB_NONE,
|
||||
jobData, NULL) < 0)
|
||||
return -1;
|
||||
|
@ -1802,6 +1802,10 @@ qemuMigrationUpdateJobType(virDomainJobData *jobData)
|
||||
jobData->status = VIR_DOMAIN_JOB_STATUS_POSTCOPY;
|
||||
break;
|
||||
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP:
|
||||
jobData->status = VIR_DOMAIN_JOB_STATUS_POSTCOPY_RECOVER;
|
||||
break;
|
||||
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_PAUSED:
|
||||
jobData->status = VIR_DOMAIN_JOB_STATUS_POSTCOPY_PAUSED;
|
||||
break;
|
||||
@ -1943,6 +1947,7 @@ qemuMigrationJobCheckStatus(virDomainObj *vm,
|
||||
case VIR_DOMAIN_JOB_STATUS_MIGRATING:
|
||||
case VIR_DOMAIN_JOB_STATUS_HYPERVISOR_COMPLETED:
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY:
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY_RECOVER:
|
||||
case VIR_DOMAIN_JOB_STATUS_PAUSED:
|
||||
break;
|
||||
}
|
||||
@ -2028,6 +2033,7 @@ qemuMigrationAnyCompleted(virDomainObj *vm,
|
||||
case VIR_DOMAIN_JOB_STATUS_MIGRATING:
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY:
|
||||
case VIR_DOMAIN_JOB_STATUS_PAUSED:
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY_RECOVER:
|
||||
/* The migration was aborted by us rather than QEMU itself. */
|
||||
jobData->status = VIR_DOMAIN_JOB_STATUS_FAILED;
|
||||
return -2;
|
||||
@ -4669,6 +4675,7 @@ qemuMigrationSrcIsCanceled(virDomainObj *vm)
|
||||
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_PAUSED:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_PRE_SWITCHOVER:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_DEVICE:
|
||||
|
@ -152,6 +152,7 @@ VIR_ENUM_IMPL(qemuMonitorMigrationStatus,
|
||||
"postcopy-active",
|
||||
"postcopy-paused",
|
||||
"postcopy-recover",
|
||||
"postcopy-recover-setup",
|
||||
"completed",
|
||||
"failed",
|
||||
"cancelling",
|
||||
|
@ -762,6 +762,7 @@ typedef enum {
|
||||
QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_PAUSED,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_COMPLETED,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_ERROR,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_CANCELLING,
|
||||
|
@ -2969,6 +2969,7 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply,
|
||||
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_POSTCOPY_RECOVER_SETUP:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_COMPLETED:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_CANCELLING:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_PRE_SWITCHOVER:
|
||||
|
@ -1503,6 +1503,10 @@ qemuProcessHandleMigrationStatus(qemuMonitor *mon G_GNUC_UNUSED,
|
||||
}
|
||||
break;
|
||||
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP:
|
||||
priv->migrationRecoverSetup = true;
|
||||
break;
|
||||
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER:
|
||||
if (virDomainObjIsFailedPostcopy(vm, vm->job)) {
|
||||
int eventType = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user