[PATCH 03/20] qemu: Add function to check capability in migration params

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

 



Add new function qemuMigrationParamsCapEnabled() to check if a
capability is set in the caller-provided migration parameters.

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

diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index 98822012cc..c3c9120c22 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -1303,6 +1303,22 @@ qemuMigrationParamsGetULL(qemuMigrationParams *migParams,
 }
 
 
+/**
+ * Returns true if @cap is enabled in @migParams, false otherwise.
+ */
+bool
+qemuMigrationParamsCapEnabled(qemuMigrationParams *migParams,
+                              qemuMigrationCapability cap)
+{
+    bool enabled = false;
+
+    if (migParams)
+        ignore_value(virBitmapGetBit(migParams->caps, cap, &enabled));
+
+    return enabled;
+}
+
+
 /**
  * qemuMigrationParamsCheck:
  *
diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_params.h
index df67f1fb92..020071e8ef 100644
--- a/src/qemu/qemu_migration_params.h
+++ b/src/qemu/qemu_migration_params.h
@@ -136,6 +136,10 @@ qemuMigrationParamsGetULL(qemuMigrationParams *migParams,
                           qemuMigrationParam param,
                           unsigned long long *value);
 
+bool
+qemuMigrationParamsCapEnabled(qemuMigrationParams *migParams,
+                              qemuMigrationCapability cap);
+
 void
 qemuMigrationParamsSetBlockDirtyBitmapMapping(qemuMigrationParams *migParams,
                                               virJSONValue **params);
-- 
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