[PATCH 41/68] qemu: Drop qemuMigrationParamsSetCapability

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

 



It's become only a tiny wrapper around virBitmapSetBit, which can easily
be called directly. We don't need to call virBitmapClearBit since
migParams->caps bitmap is initialized with zeros.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_migration_params.c | 35 +++++++-------------------------
 1 file changed, 7 insertions(+), 28 deletions(-)

diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index 2caf4dd1c9..b70229a156 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -226,21 +226,6 @@ qemuMigrationParamsApply(virQEMUDriverPtr driver,
 }
 
 
-static int
-qemuMigrationParamsSetCapability(virDomainObjPtr vm ATTRIBUTE_UNUSED,
-                                 qemuMonitorMigrationCaps capability,
-                                 bool state,
-                                 qemuMigrationParamsPtr migParams)
-{
-    if (state)
-        ignore_value(virBitmapSetBit(migParams->caps, capability));
-    else
-        ignore_value(virBitmapClearBit(migParams->caps, capability));
-
-    return 0;
-}
-
-
 /* qemuMigrationParamsEnableTLS
  * @driver: pointer to qemu driver
  * @vm: domain object
@@ -355,23 +340,17 @@ qemuMigrationParamsDisableTLS(virDomainObjPtr vm,
 
 
 int
-qemuMigrationParamsSetCompression(virDomainObjPtr vm,
+qemuMigrationParamsSetCompression(virDomainObjPtr vm ATTRIBUTE_UNUSED,
                                   qemuMigrationCompressionPtr compression,
                                   qemuMigrationParamsPtr migParams)
 {
-    if (qemuMigrationParamsSetCapability(vm,
-                                         QEMU_MONITOR_MIGRATION_CAPS_XBZRLE,
-                                         compression->methods &
-                                         (1ULL << QEMU_MIGRATION_COMPRESS_XBZRLE),
-                                         migParams) < 0)
-        return -1;
+    if (compression->methods & (1ULL << QEMU_MIGRATION_COMPRESS_XBZRLE))
+        ignore_value(virBitmapSetBit(migParams->caps,
+                                     QEMU_MONITOR_MIGRATION_CAPS_XBZRLE));
 
-    if (qemuMigrationParamsSetCapability(vm,
-                                         QEMU_MONITOR_MIGRATION_CAPS_COMPRESS,
-                                         compression->methods &
-                                         (1ULL << QEMU_MIGRATION_COMPRESS_MT),
-                                         migParams) < 0)
-        return -1;
+    if (compression->methods & (1ULL << QEMU_MIGRATION_COMPRESS_MT))
+        ignore_value(virBitmapSetBit(migParams->caps,
+                                     QEMU_MONITOR_MIGRATION_CAPS_COMPRESS));
 
     migParams->params.compressLevel_set = compression->level_set;
     migParams->params.compressLevel = compression->level;
-- 
2.17.0

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