From 08d44263c81891f8064a90bda3bf8cb24d94e6a1 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Mon, 4 Feb 2019 17:11:42 +0100 Subject: [PATCH] qemu: Make migration params usable outside migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So far migration parameters were changed only at the beginning of migration mostly via an automatic translation from flags and typed parameters. We need to export a few more functions to support APIs which may set migration parameters while migration is already running. Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- src/qemu/qemu_migration_params.c | 16 +++++++++++++++- src/qemu/qemu_migration_params.h | 9 +++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c index 47daa35087..40dafcb226 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -216,7 +216,7 @@ qemuMigrationParamsGetAlwaysOnCaps(qemuMigrationParty party) } -static qemuMigrationParamsPtr +qemuMigrationParamsPtr qemuMigrationParamsNew(void) { qemuMigrationParamsPtr params; @@ -1039,6 +1039,20 @@ qemuMigrationParamsFetch(virQEMUDriverPtr driver, } +int +qemuMigrationParamsSetULL(qemuMigrationParamsPtr migParams, + qemuMigrationParam param, + unsigned long long value) +{ + if (qemuMigrationParamsCheckType(param, QEMU_MIGRATION_PARAM_TYPE_ULL) < 0) + return -1; + + migParams->params[param].value.ull = value; + migParams->params[param].set = true; + return 0; +} + + /** * Returns -1 on error, * 0 on success, diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_params.h index 709b818dcf..db0745ec28 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -84,8 +84,12 @@ qemuMigrationParamsDump(qemuMigrationParamsPtr migParams, int *maxparams, unsigned long *flags); +qemuMigrationParamsPtr +qemuMigrationParamsNew(void); + void qemuMigrationParamsFree(qemuMigrationParamsPtr migParams); +VIR_DEFINE_AUTOPTR_FUNC(qemuMigrationParams, qemuMigrationParamsFree) int qemuMigrationParamsApply(virQEMUDriverPtr driver, @@ -112,6 +116,11 @@ qemuMigrationParamsFetch(virQEMUDriverPtr driver, int asyncJob, qemuMigrationParamsPtr *migParams); +int +qemuMigrationParamsSetULL(qemuMigrationParamsPtr migParams, + qemuMigrationParam param, + unsigned long long value); + int qemuMigrationParamsGetULL(qemuMigrationParamsPtr migParams, qemuMigrationParam param, -- GitLab