diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 5daf12f38feedbdba77561b5849320d7688483bb..9fa58cada106d201489b1f57006a9e997ac7c4bf 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2369,7 +2369,7 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver, jobInfo->type = VIR_DOMAIN_JOB_UNBOUNDED; - while (jobInfo->type == VIR_DOMAIN_JOB_UNBOUNDED) { + while (1) { /* Poll every 50ms for progress & to allow cancellation */ struct timespec ts = { .tv_sec = 0, .tv_nsec = 50 * 1000 * 1000ull }; @@ -2391,6 +2391,9 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver, break; } + if (jobInfo->type != VIR_DOMAIN_JOB_UNBOUNDED) + break; + virObjectUnlock(vm); nanosleep(&ts, NULL);