c1c534
From 41bc8c60fd726c0e7724f969796521bfc7a037f8 Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <41bc8c60fd726c0e7724f969796521bfc7a037f8@dist-git>
c1c534
From: Martin Kletzander <mkletzan@redhat.com>
c1c534
Date: Wed, 31 Jan 2018 16:32:12 +0100
c1c534
Subject: [PATCH] util: Rename virBitmapDataToString to virBitmapDataFormat
c1c534
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1289368
c1c534
c1c534
It is literally only a wrapper around virBitmapNewData() and
c1c534
virBitmapFormat(), only the naming was wrong since it was introduced.
c1c534
And because we have virBitmap*String functions where the meaning of
c1c534
the 'String' is constant, this might confuse someone.
c1c534
c1c534
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
c1c534
Reviewed-by: John Ferlan <jferlan@redhat.com>
c1c534
(cherry picked from commit 5d893ed6ad7f42fb9ae94c6150c9d8aedc5c512b)
c1c534
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
c1c534
---
c1c534
 src/libvirt_private.syms | 2 +-
c1c534
 src/util/virbitmap.c     | 6 +++---
c1c534
 src/util/virbitmap.h     | 4 ++--
c1c534
 tests/virbitmaptest.c    | 6 +++---
c1c534
 tools/virsh-domain.c     | 4 ++--
c1c534
 tools/virsh-host.c       | 2 +-
c1c534
 6 files changed, 12 insertions(+), 12 deletions(-)
c1c534
c1c534
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
c1c534
index d0f2c027fc..f1c6786ecf 100644
c1c534
--- a/src/libvirt_private.syms
c1c534
+++ b/src/libvirt_private.syms
c1c534
@@ -1357,7 +1357,7 @@ virBitmapClearBit;
c1c534
 virBitmapClearBitExpand;
c1c534
 virBitmapCopy;
c1c534
 virBitmapCountBits;
c1c534
-virBitmapDataToString;
c1c534
+virBitmapDataFormat;
c1c534
 virBitmapEqual;
c1c534
 virBitmapFormat;
c1c534
 virBitmapFree;
c1c534
diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
c1c534
index e7d04e8c8b..f5700a6424 100644
c1c534
--- a/src/util/virbitmap.c
c1c534
+++ b/src/util/virbitmap.c
c1c534
@@ -1046,7 +1046,7 @@ virBitmapCountBits(virBitmapPtr bitmap)
c1c534
 }
c1c534
 
c1c534
 /**
c1c534
- * virBitmapDataToString:
c1c534
+ * virBitmapDataFormat:
c1c534
  * @data: the data
c1c534
  * @len: length of @data in bytes
c1c534
  *
c1c534
@@ -1056,8 +1056,8 @@ virBitmapCountBits(virBitmapPtr bitmap)
c1c534
  * Returns: a string representation of the data, or NULL on error
c1c534
  */
c1c534
 char *
c1c534
-virBitmapDataToString(const void *data,
c1c534
-                      int len)
c1c534
+virBitmapDataFormat(const void *data,
c1c534
+                    int len)
c1c534
 {
c1c534
     virBitmapPtr map = NULL;
c1c534
     char *ret = NULL;
c1c534
diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h
c1c534
index 99eb779d71..720b389cfe 100644
c1c534
--- a/src/util/virbitmap.h
c1c534
+++ b/src/util/virbitmap.h
c1c534
@@ -136,8 +136,8 @@ ssize_t virBitmapNextClearBit(virBitmapPtr bitmap, ssize_t pos)
c1c534
 size_t virBitmapCountBits(virBitmapPtr bitmap)
c1c534
     ATTRIBUTE_NONNULL(1);
c1c534
 
c1c534
-char *virBitmapDataToString(const void *data,
c1c534
-                            int len)
c1c534
+char *virBitmapDataFormat(const void *data,
c1c534
+                          int len)
c1c534
     ATTRIBUTE_NONNULL(1);
c1c534
 bool virBitmapOverlaps(virBitmapPtr b1,
c1c534
                        virBitmapPtr b2)
c1c534
diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c
c1c534
index 76005117e7..75cdddf9a7 100644
c1c534
--- a/tests/virbitmaptest.c
c1c534
+++ b/tests/virbitmaptest.c
c1c534
@@ -294,7 +294,7 @@ test4(const void *data ATTRIBUTE_UNUSED)
c1c534
     return -1;
c1c534
 }
c1c534
 
c1c534
-/* test for virBitmapNewData/ToData/DataToString */
c1c534
+/* test for virBitmapNewData/ToData/DataFormat */
c1c534
 static int
c1c534
 test5(const void *v ATTRIBUTE_UNUSED)
c1c534
 {
c1c534
@@ -336,12 +336,12 @@ test5(const void *v ATTRIBUTE_UNUSED)
c1c534
         data2[4] != 0x04)
c1c534
         goto error;
c1c534
 
c1c534
-    if (!(str = virBitmapDataToString(data, sizeof(data))))
c1c534
+    if (!(str = virBitmapDataFormat(data, sizeof(data))))
c1c534
         goto error;
c1c534
     if (STRNEQ(str, "0,9,34"))
c1c534
         goto error;
c1c534
     VIR_FREE(str);
c1c534
-    if (!(str = virBitmapDataToString(data2, len2)))
c1c534
+    if (!(str = virBitmapDataFormat(data2, len2)))
c1c534
         goto error;
c1c534
     if (STRNEQ(str, "0,2,9,15,34"))
c1c534
         goto error;
c1c534
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
c1c534
index 1e33e82959..7547cf134f 100644
c1c534
--- a/tools/virsh-domain.c
c1c534
+++ b/tools/virsh-domain.c
c1c534
@@ -6527,7 +6527,7 @@ virshVcpuinfoPrintAffinity(vshControl *ctl,
c1c534
 
c1c534
     vshPrint(ctl, "%-15s ", _("CPU Affinity:"));
c1c534
     if (pretty) {
c1c534
-        if (!(str = virBitmapDataToString(cpumap, VIR_CPU_MAPLEN(maxcpu))))
c1c534
+        if (!(str = virBitmapDataFormat(cpumap, VIR_CPU_MAPLEN(maxcpu))))
c1c534
             goto cleanup;
c1c534
         vshPrint(ctl, _("%s (out of %d)"), str, maxcpu);
c1c534
     } else {
c1c534
@@ -6781,7 +6781,7 @@ virshPrintPinInfo(vshControl *ctl,
c1c534
 {
c1c534
     char *str = NULL;
c1c534
 
c1c534
-    if (!(str = virBitmapDataToString(cpumap, cpumaplen)))
c1c534
+    if (!(str = virBitmapDataFormat(cpumap, cpumaplen)))
c1c534
         return false;
c1c534
 
c1c534
     vshPrint(ctl, "%s", str);
c1c534
diff --git a/tools/virsh-host.c b/tools/virsh-host.c
c1c534
index 5509065fd6..ecaf830e35 100644
c1c534
--- a/tools/virsh-host.c
c1c534
+++ b/tools/virsh-host.c
c1c534
@@ -717,7 +717,7 @@ cmdNodeCpuMap(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
c1c534
 
c1c534
     vshPrint(ctl, "%-15s ", _("CPU map:"));
c1c534
     if (pretty) {
c1c534
-        char *str = virBitmapDataToString(cpumap, VIR_CPU_MAPLEN(cpunum));
c1c534
+        char *str = virBitmapDataFormat(cpumap, VIR_CPU_MAPLEN(cpunum));
c1c534
 
c1c534
         if (!str)
c1c534
             goto cleanup;
c1c534
-- 
c1c534
2.16.1
c1c534