|
|
3e5111 |
From 7e2bb20a6318c5e7a42b0fe417b6e12862c65d64 Mon Sep 17 00:00:00 2001
|
|
|
3e5111 |
Message-Id: <7e2bb20a6318c5e7a42b0fe417b6e12862c65d64@dist-git>
|
|
|
3e5111 |
From: Jiri Denemark <jdenemar@redhat.com>
|
|
|
3e5111 |
Date: Tue, 4 Apr 2017 20:54:57 +0200
|
|
|
3e5111 |
Subject: [PATCH] qemu: Drop resume label in qemuProcessRecoverMigrationOut
|
|
|
3e5111 |
|
|
|
3e5111 |
Let's use a bool variable to create a single shared path returning 0.
|
|
|
3e5111 |
|
|
|
3e5111 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
3e5111 |
(cherry picked from commit 3e803176a3d9242f6833687e305aebd7353ffaa3)
|
|
|
3e5111 |
|
|
|
3e5111 |
https://bugzilla.redhat.com/show_bug.cgi?id=1425003
|
|
|
3e5111 |
|
|
|
3e5111 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
3e5111 |
---
|
|
|
3e5111 |
src/qemu/qemu_process.c | 31 ++++++++++++++++---------------
|
|
|
3e5111 |
1 file changed, 16 insertions(+), 15 deletions(-)
|
|
|
3e5111 |
|
|
|
3e5111 |
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
|
3e5111 |
index 0b9b4f76a..70b06a28f 100644
|
|
|
3e5111 |
--- a/src/qemu/qemu_process.c
|
|
|
3e5111 |
+++ b/src/qemu/qemu_process.c
|
|
|
3e5111 |
@@ -2998,6 +2998,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
|
|
|
3e5111 |
bool postcopy = state == VIR_DOMAIN_PAUSED &&
|
|
|
3e5111 |
(reason == VIR_DOMAIN_PAUSED_POSTCOPY ||
|
|
|
3e5111 |
reason == VIR_DOMAIN_PAUSED_POSTCOPY_FAILED);
|
|
|
3e5111 |
+ bool resume = false;
|
|
|
3e5111 |
|
|
|
3e5111 |
switch (phase) {
|
|
|
3e5111 |
case QEMU_MIGRATION_PHASE_NONE:
|
|
|
3e5111 |
@@ -3028,7 +3029,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
|
|
|
3e5111 |
VIR_WARN("Could not cancel ongoing migration of domain %s",
|
|
|
3e5111 |
vm->def->name);
|
|
|
3e5111 |
}
|
|
|
3e5111 |
- goto resume;
|
|
|
3e5111 |
+ resume = true;
|
|
|
3e5111 |
}
|
|
|
3e5111 |
break;
|
|
|
3e5111 |
|
|
|
3e5111 |
@@ -3051,7 +3052,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
|
|
|
3e5111 |
} else {
|
|
|
3e5111 |
VIR_DEBUG("Resuming domain %s after failed migration",
|
|
|
3e5111 |
vm->def->name);
|
|
|
3e5111 |
- goto resume;
|
|
|
3e5111 |
+ resume = true;
|
|
|
3e5111 |
}
|
|
|
3e5111 |
break;
|
|
|
3e5111 |
|
|
|
3e5111 |
@@ -3061,21 +3062,21 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
|
|
|
3e5111 |
return -1;
|
|
|
3e5111 |
}
|
|
|
3e5111 |
|
|
|
3e5111 |
- return 0;
|
|
|
3e5111 |
-
|
|
|
3e5111 |
- resume:
|
|
|
3e5111 |
- /* resume the domain but only if it was paused as a result of
|
|
|
3e5111 |
- * migration
|
|
|
3e5111 |
- */
|
|
|
3e5111 |
- if (state == VIR_DOMAIN_PAUSED &&
|
|
|
3e5111 |
- (reason == VIR_DOMAIN_PAUSED_MIGRATION ||
|
|
|
3e5111 |
- reason == VIR_DOMAIN_PAUSED_UNKNOWN)) {
|
|
|
3e5111 |
- if (qemuProcessStartCPUs(driver, vm, conn,
|
|
|
3e5111 |
- VIR_DOMAIN_RUNNING_UNPAUSED,
|
|
|
3e5111 |
- QEMU_ASYNC_JOB_NONE) < 0) {
|
|
|
3e5111 |
- VIR_WARN("Could not resume domain %s", vm->def->name);
|
|
|
3e5111 |
+ if (resume) {
|
|
|
3e5111 |
+ /* resume the domain but only if it was paused as a result of
|
|
|
3e5111 |
+ * migration
|
|
|
3e5111 |
+ */
|
|
|
3e5111 |
+ if (state == VIR_DOMAIN_PAUSED &&
|
|
|
3e5111 |
+ (reason == VIR_DOMAIN_PAUSED_MIGRATION ||
|
|
|
3e5111 |
+ reason == VIR_DOMAIN_PAUSED_UNKNOWN)) {
|
|
|
3e5111 |
+ if (qemuProcessStartCPUs(driver, vm, conn,
|
|
|
3e5111 |
+ VIR_DOMAIN_RUNNING_UNPAUSED,
|
|
|
3e5111 |
+ QEMU_ASYNC_JOB_NONE) < 0) {
|
|
|
3e5111 |
+ VIR_WARN("Could not resume domain %s", vm->def->name);
|
|
|
3e5111 |
+ }
|
|
|
3e5111 |
}
|
|
|
3e5111 |
}
|
|
|
3e5111 |
+
|
|
|
3e5111 |
return 0;
|
|
|
3e5111 |
}
|
|
|
3e5111 |
|
|
|
3e5111 |
--
|
|
|
3e5111 |
2.12.2
|
|
|
3e5111 |
|