Re: [PATCH V4 11/18] qemu: Apply migration parameters in qemuMigrationDstRun

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/19/25 09:45, Daniel P. Berrangé wrote:
On Wed, Mar 05, 2025 at 03:48:20PM -0700, Jim Fehlig via Devel wrote:
Similar to qemuMigrationSrcRun, apply migration parameters in
qemuMigrationDstRun. This allows callers to create customized
migration parameters, but delegates their application to the
function performing the migration.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
---
  src/qemu/qemu_migration.c | 16 ++++++++++------
  src/qemu/qemu_migration.h |  5 ++++-
  src/qemu/qemu_process.c   |  2 +-
  3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index f692986056..329b5f61d4 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2427,7 +2427,10 @@ qemuMigrationDstGetURI(const char *migrateFrom,
  int
  qemuMigrationDstRun(virDomainObj *vm,
                      const char *uri,
-                    virDomainAsyncJob asyncJob)
+                    virDomainAsyncJob asyncJob,
+                    qemuMigrationParams *migParams,
+                    unsigned int flags)
+
  {
      virTristateBool exitOnError = VIR_TRISTATE_BOOL_ABSENT;
      qemuDomainObjPrivate *priv = vm->privateData;
@@ -2435,6 +2438,10 @@ qemuMigrationDstRun(virDomainObj *vm,
VIR_DEBUG("Setting up incoming migration with URI %s", uri); + if (migParams && qemuMigrationParamsApply(vm, asyncJob,
+                                              migParams, flags) < 0)
+        return -1;
+
      /* Ask QEMU not to exit on failure during incoming migration (if supported)
       * so that we can properly check and report error during Finish phase.
       */
@@ -3368,10 +3375,6 @@ qemuMigrationDstPrepareActive(virQEMUDriver *driver,
              goto error;
      }
- if (qemuMigrationParamsApply(vm, VIR_ASYNC_JOB_MIGRATION_IN,
-                                 migParams, flags) < 0)
-        goto error;
-

So semantically, we now apply the dst migration parameters /after/
starting the NBD server, instead of before. This seems like it
ought to be safe, as migration is independent of the NBD block layer.

Good point. I took another look and agree it should be fine. The interesting scenario is failure to apply the migration params. Prior to this patch the NBD server would not have been started. After the patch it would be running. Shouldn't be a problem though, since the code already handles other misc failures after starting the NBD server.

Regards,
Jim




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux