On Tue, May 10, 2022 at 17:20:43 +0200, Jiri Denemark wrote:
When connection breaks during post-copy migration, QEMU enters
'postcopy-paused' state. We need to handle this state and make the
situation visible to upper layers.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/hypervisor/domain_job.c | 1 +
src/hypervisor/domain_job.h | 1 +
src/qemu/qemu_driver.c | 1 +
src/qemu/qemu_migration.c | 11 +++++++++++
src/qemu/qemu_monitor.c | 1 +
src/qemu/qemu_monitor.h | 1 +
src/qemu/qemu_monitor_json.c | 1 +
src/qemu/qemu_process.c | 33 ++++++++++++++++++++-------------
8 files changed, 37 insertions(+), 13 deletions(-)
[...]
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 72a2846d1f..e5e33556e3 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
[...]
@ -1883,6 +1887,12 @@ qemuMigrationJobCheckStatus(virQEMUDriver
*driver,
qemuMigrationJobName(vm), _("canceled by client"));
return -1;
+ case VIR_DOMAIN_JOB_STATUS_POSTCOPY_PAUSED:
+ virReportError(VIR_ERR_OPERATION_FAILED, _("%s: %s"),
+ qemuMigrationJobName(vm),
+ _("post-copy phase failed"));
This is very translation unfriendly:
https://www.libvirt.org/coding-style.html#error-message-format
I see it's a common theme in this function though ... bleah.
+ return -1;
+
case VIR_DOMAIN_JOB_STATUS_COMPLETED:
case VIR_DOMAIN_JOB_STATUS_ACTIVE:
case VIR_DOMAIN_JOB_STATUS_MIGRATING:
Reviewed-by: Peter Krempa <pkrempa(a)redhat.com>