[PATCH 36/68] qemu: Drop qemuMigrationParamsSetPostCopy

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

 



It's just a tiny wrapper around qemuMigrationParamsSetCapability and
setting priv->job.postcopyEnabled is not something qemuMigrationParams
code should be doing anyway so let the callers do it.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_migration.c        | 16 ++++++++++++----
 src/qemu/qemu_migration_params.c | 17 -----------------
 src/qemu/qemu_migration_params.h |  5 -----
 3 files changed, 12 insertions(+), 26 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index ceab035acf..f3006d8aa4 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2394,8 +2394,10 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
                                          migParams) < 0)
         goto stopjob;
 
-    if (qemuMigrationParamsSetPostCopy(vm, flags & VIR_MIGRATE_POSTCOPY,
-                                       migParams) < 0)
+    if (qemuMigrationParamsSetCapability(vm,
+                                         QEMU_MONITOR_MIGRATION_CAPS_POSTCOPY,
+                                         flags & VIR_MIGRATE_POSTCOPY,
+                                         migParams) < 0)
         goto stopjob;
 
     if (qemuMigrationParamsCheck(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
@@ -2419,6 +2421,8 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
                                  migParams) < 0)
         goto stopjob;
 
+    priv->job.postcopyEnabled = flags & VIR_MIGRATE_POSTCOPY;
+
     if (mig->nbd &&
         flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC) &&
         virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NBD_SERVER)) {
@@ -3352,8 +3356,10 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
                                          migParams) < 0)
         goto error;
 
-    if (qemuMigrationParamsSetPostCopy(vm, flags & VIR_MIGRATE_POSTCOPY,
-                                       migParams) < 0)
+    if (qemuMigrationParamsSetCapability(vm,
+                                         QEMU_MONITOR_MIGRATION_CAPS_POSTCOPY,
+                                         flags & VIR_MIGRATE_POSTCOPY,
+                                         migParams) < 0)
         goto error;
 
     if (qemuMigrationCapsGet(vm, QEMU_MONITOR_MIGRATION_CAPS_PAUSE_BEFORE_SWITCHOVER) &&
@@ -3389,6 +3395,8 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
                                  migParams) < 0)
         goto error;
 
+    priv->job.postcopyEnabled = flags & VIR_MIGRATE_POSTCOPY;
+
     if (migrate_flags & (QEMU_MONITOR_MIGRATE_NON_SHARED_DISK |
                          QEMU_MONITOR_MIGRATE_NON_SHARED_INC)) {
         if (mig->nbd) {
diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index c79ea4fa91..ac99fa29e1 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -199,23 +199,6 @@ qemuMigrationParamsSetCapability(virDomainObjPtr vm ATTRIBUTE_UNUSED,
 }
 
 
-int
-qemuMigrationParamsSetPostCopy(virDomainObjPtr vm,
-                               bool state,
-                               qemuMigrationParamsPtr migParams)
-{
-    qemuDomainObjPrivatePtr priv = vm->privateData;
-
-    if (qemuMigrationParamsSetCapability(vm,
-                                         QEMU_MONITOR_MIGRATION_CAPS_POSTCOPY,
-                                         state, migParams) < 0)
-        return -1;
-
-    priv->job.postcopyEnabled = state;
-    return 0;
-}
-
-
 /* qemuMigrationParamsEnableTLS
  * @driver: pointer to qemu driver
  * @vm: domain object
diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_params.h
index 3620a4e36e..a483211bdd 100644
--- a/src/qemu/qemu_migration_params.h
+++ b/src/qemu/qemu_migration_params.h
@@ -77,11 +77,6 @@ qemuMigrationParamsSetCapability(virDomainObjPtr vm,
                                  bool state,
                                  qemuMigrationParamsPtr migParams);
 
-int
-qemuMigrationParamsSetPostCopy(virDomainObjPtr vm,
-                               bool state,
-                               qemuMigrationParamsPtr migParams);
-
 int
 qemuMigrationParamsEnableTLS(virQEMUDriverPtr driver,
                              virDomainObjPtr vm,
-- 
2.17.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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