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

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

 



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@xxxxxxxxxx>
---
 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@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