[libvirt] [PATCH 4/8] qemu: Make migration params usable outside migration

Jiri Denemark posted 8 patches 32 weeks ago

[libvirt] [PATCH 4/8] qemu: Make migration params usable outside migration

Posted by Jiri Denemark 32 weeks ago
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 <jdenemar@redhat.com>
---
 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 c36bed5744..117ae0e998 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,
-- 
2.20.1

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

Re: [libvirt] [PATCH 4/8] qemu: Make migration params usable outside migration

Posted by Ján Tomko 32 weeks ago
On Tue, Feb 05, 2019 at 04:23:07PM +0100, Jiri Denemark wrote:
>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 <jdenemar@redhat.com>
>---
> src/qemu/qemu_migration_params.c | 16 +++++++++++++++-
> src/qemu/qemu_migration_params.h |  9 +++++++++
> 2 files changed, 24 insertions(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

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