Add new function qemuMigrationParamsCapEnabled() to check if a
capability is set in the caller-provided migration parameters.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
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