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