[PATCH 04/20] qemu: Add function to get bool value from migration params

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

 



Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
---
 src/qemu/qemu_migration_params.c | 18 ++++++++++++++++++
 src/qemu/qemu_migration_params.h |  5 +++++
 2 files changed, 23 insertions(+)

diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index c3c9120c22..daa52269f4 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -1303,6 +1303,24 @@ qemuMigrationParamsGetULL(qemuMigrationParams *migParams,
 }
 
 
+int
+qemuMigrationParamsGetBool(qemuMigrationParams *migParams,
+                           qemuMigrationParam param,
+                           bool *value)
+{
+    if (!migParams || !value)
+        return 0;
+
+    if (qemuMigrationParamsCheckType(param, QEMU_MIGRATION_PARAM_TYPE_BOOL) < 0)
+        return -1;
+
+    *value = migParams->params[param].set ?
+        migParams->params[param].value.b : false;
+
+    return 0;
+}
+
+
 /**
  * Returns true if @cap is enabled in @migParams, false otherwise.
  */
diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_params.h
index 020071e8ef..64b2dde59b 100644
--- a/src/qemu/qemu_migration_params.h
+++ b/src/qemu/qemu_migration_params.h
@@ -136,6 +136,11 @@ qemuMigrationParamsGetULL(qemuMigrationParams *migParams,
                           qemuMigrationParam param,
                           unsigned long long *value);
 
+int
+qemuMigrationParamsGetBool(qemuMigrationParams *migParams,
+                           qemuMigrationParam param,
+                           bool *value);
+
 bool
 qemuMigrationParamsCapEnabled(qemuMigrationParams *migParams,
                               qemuMigrationCapability cap);
-- 
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