bool postcopy = state == VIR_DOMAIN_PAUSED &&
(reason == VIR_DOMAIN_PAUSED_POSTCOPY ||
reason == VIR_DOMAIN_PAUSED_POSTCOPY_FAILED);
+ bool resume = false;
switch (phase) {
case QEMU_MIGRATION_PHASE_NONE:
VIR_WARN("Could not cancel ongoing migration of domain %s",
vm->def->name);
}
- goto resume;
+ resume = true;
}
break;
} else {
VIR_DEBUG("Resuming domain %s after failed migration",
vm->def->name);
- goto resume;
+ resume = true;
}
break;
return -1;
}
- return 0;
-
- resume:
- /* resume the domain but only if it was paused as a result of
- * migration
- */
- if (state == VIR_DOMAIN_PAUSED &&
- (reason == VIR_DOMAIN_PAUSED_MIGRATION ||
- reason == VIR_DOMAIN_PAUSED_UNKNOWN)) {
- if (qemuProcessStartCPUs(driver, vm, conn,
- VIR_DOMAIN_RUNNING_UNPAUSED,
- QEMU_ASYNC_JOB_NONE) < 0) {
- VIR_WARN("Could not resume domain %s", vm->def->name);
+ if (resume) {
+ /* resume the domain but only if it was paused as a result of
+ * migration
+ */
+ if (state == VIR_DOMAIN_PAUSED &&
+ (reason == VIR_DOMAIN_PAUSED_MIGRATION ||
+ reason == VIR_DOMAIN_PAUSED_UNKNOWN)) {
+ if (qemuProcessStartCPUs(driver, vm, conn,
+ VIR_DOMAIN_RUNNING_UNPAUSED,
+ QEMU_ASYNC_JOB_NONE) < 0) {
+ VIR_WARN("Could not resume domain %s", vm->def->name);
+ }
}
}
+
return 0;
}