When return-path is enabled, QEMU on the source host won't report
completed migration until the destination QEMU sends a confirmation it
successfully loaded all data. Libvirt would detect such situation in the
Finish phase and report the error read from QEMU's stderr back to the
source, but using return-path could give use a bit better error
reporting with an earlier restart of vCPUs on the source.

The capability is only enabled when the connection between QEMU
processes on the source and destination hosts is bidirectional. In other
words, only when VIR_MIGRATE_TUNNELLED is not set, because our tunnel
only allows one-way communication from the source to the destination.

Signed-off-by: Jiri Denemark <jdene...@redhat.com>
---
 src/qemu/qemu_migration_params.c | 6 ++++++
 src/qemu/qemu_migration_params.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index dfe0253487..d2e9c372a1 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -95,6 +95,7 @@ VIR_ENUM_IMPL(qemuMigrationCapability,
               "late-block-activate",
               "multifd",
               "dirty-bitmaps",
+              "return-path",
 );
 
 
@@ -171,6 +172,11 @@ static const qemuMigrationParamsFlagMapItem 
qemuMigrationParamsFlagMap[] = {
      VIR_MIGRATE_PARALLEL,
      QEMU_MIGRATION_CAP_MULTIFD,
      QEMU_MIGRATION_SOURCE | QEMU_MIGRATION_DESTINATION},
+
+    {QEMU_MIGRATION_FLAG_FORBIDDEN,
+     VIR_MIGRATE_TUNNELLED,
+     QEMU_MIGRATION_CAP_RETURN_PATH,
+     QEMU_MIGRATION_SOURCE | QEMU_MIGRATION_DESTINATION},
 };
 
 /* Translation from VIR_MIGRATE_PARAM_* typed parameters to
diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_params.h
index f770bd2576..b4de8dda7b 100644
--- a/src/qemu/qemu_migration_params.h
+++ b/src/qemu/qemu_migration_params.h
@@ -40,6 +40,7 @@ typedef enum {
     QEMU_MIGRATION_CAP_LATE_BLOCK_ACTIVATE,
     QEMU_MIGRATION_CAP_MULTIFD,
     QEMU_MIGRATION_CAP_BLOCK_DIRTY_BITMAPS,
+    QEMU_MIGRATION_CAP_RETURN_PATH,
 
     QEMU_MIGRATION_CAP_LAST
 } qemuMigrationCapability;
-- 
2.34.1

Reply via email to