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(a)redhat.com>
---
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 5614f0d43e..400eb0710c 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2391,8 +2391,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,
@@ -2416,6 +2418,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)) {
@@ -3349,8 +3353,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)
&&
@@ -3386,6 +3392,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 a0a00d0fc7..bf95fb4f59 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 4350b14d6d..fac901e35c 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