mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 22:15:20 +00:00
qemu: Drop resume label in qemuProcessRecoverMigrationOut
Let's use a bool variable to create a single shared path returning 0. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
59b28ecab8
commit
3e803176a3
@ -2998,6 +2998,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
|
|||||||
bool postcopy = state == VIR_DOMAIN_PAUSED &&
|
bool postcopy = state == VIR_DOMAIN_PAUSED &&
|
||||||
(reason == VIR_DOMAIN_PAUSED_POSTCOPY ||
|
(reason == VIR_DOMAIN_PAUSED_POSTCOPY ||
|
||||||
reason == VIR_DOMAIN_PAUSED_POSTCOPY_FAILED);
|
reason == VIR_DOMAIN_PAUSED_POSTCOPY_FAILED);
|
||||||
|
bool resume = false;
|
||||||
|
|
||||||
switch (phase) {
|
switch (phase) {
|
||||||
case QEMU_MIGRATION_PHASE_NONE:
|
case QEMU_MIGRATION_PHASE_NONE:
|
||||||
@ -3028,7 +3029,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
|
|||||||
VIR_WARN("Could not cancel ongoing migration of domain %s",
|
VIR_WARN("Could not cancel ongoing migration of domain %s",
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
}
|
}
|
||||||
goto resume;
|
resume = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3051,7 +3052,7 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
|
|||||||
} else {
|
} else {
|
||||||
VIR_DEBUG("Resuming domain %s after failed migration",
|
VIR_DEBUG("Resuming domain %s after failed migration",
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
goto resume;
|
resume = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -3061,21 +3062,21 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
if (resume) {
|
||||||
|
/* resume the domain but only if it was paused as a result of
|
||||||
resume:
|
* migration
|
||||||
/* resume the domain but only if it was paused as a result of
|
*/
|
||||||
* migration
|
if (state == VIR_DOMAIN_PAUSED &&
|
||||||
*/
|
(reason == VIR_DOMAIN_PAUSED_MIGRATION ||
|
||||||
if (state == VIR_DOMAIN_PAUSED &&
|
reason == VIR_DOMAIN_PAUSED_UNKNOWN)) {
|
||||||
(reason == VIR_DOMAIN_PAUSED_MIGRATION ||
|
if (qemuProcessStartCPUs(driver, vm, conn,
|
||||||
reason == VIR_DOMAIN_PAUSED_UNKNOWN)) {
|
VIR_DOMAIN_RUNNING_UNPAUSED,
|
||||||
if (qemuProcessStartCPUs(driver, vm, conn,
|
QEMU_ASYNC_JOB_NONE) < 0) {
|
||||||
VIR_DOMAIN_RUNNING_UNPAUSED,
|
VIR_WARN("Could not resume domain %s", vm->def->name);
|
||||||
QEMU_ASYNC_JOB_NONE) < 0) {
|
}
|
||||||
VIR_WARN("Could not resume domain %s", vm->def->name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user