[libvirt RFCv9 18/31] qemu: migration_params: add APIs to set Int and Cap

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

 



similarly to qemuMigrationParamsSetULL, we need to be able to
set fields from qemu_saveimage.

Signed-off-by: Claudio Fontana <cfontana@xxxxxxx>
---
 src/qemu/qemu_migration_params.c | 22 ++++++++++++++++++++++
 src/qemu/qemu_migration_params.h |  9 +++++++++
 2 files changed, 31 insertions(+)

diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index 95fd773645..079a9f844d 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -1109,6 +1109,28 @@ qemuMigrationParamsFetch(virQEMUDriver *driver,
 }
 
 
+void
+qemuMigrationParamsSetCap(qemuMigrationParams *migParams,
+                          virQEMUCapsFlags flag)
+{
+    ignore_value(virBitmapSetBit(migParams->caps, flag));
+}
+
+
+int
+qemuMigrationParamsSetInt(qemuMigrationParams *migParams,
+                          qemuMigrationParam param,
+                          int value)
+{
+    if (qemuMigrationParamsCheckType(param, QEMU_MIGRATION_PARAM_TYPE_INT) < 0)
+        return -1;
+
+    migParams->params[param].value.i = value;
+    migParams->params[param].set = true;
+    return 0;
+}
+
+
 int
 qemuMigrationParamsSetULL(qemuMigrationParams *migParams,
                           qemuMigrationParam param,
diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_params.h
index a0909b9f3d..271d65c338 100644
--- a/src/qemu/qemu_migration_params.h
+++ b/src/qemu/qemu_migration_params.h
@@ -123,6 +123,15 @@ qemuMigrationParamsFetch(virQEMUDriver *driver,
                          int asyncJob,
                          qemuMigrationParams **migParams);
 
+void
+qemuMigrationParamsSetCap(qemuMigrationParams *migParams,
+                          virQEMUCapsFlags flag);
+
+int
+qemuMigrationParamsSetInt(qemuMigrationParams *migParams,
+                          qemuMigrationParam param,
+                          int value);
+
 int
 qemuMigrationParamsSetULL(qemuMigrationParams *migParams,
                           qemuMigrationParam param,
-- 
2.35.3





[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