1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-09 01:18:00 +03:00

util: Rename virBitmapDataToString to virBitmapDataFormat

It is literally only a wrapper around virBitmapNewData() and
virBitmapFormat(), only the naming was wrong since it was introduced.
And because we have virBitmap*String functions where the meaning of
the 'String' is constant, this might confuse someone.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Martin Kletzander 2017-08-23 09:05:41 +02:00
parent 68d7cc649c
commit 5d893ed6ad
6 changed files with 12 additions and 12 deletions

View File

@ -1350,7 +1350,7 @@ virBitmapClearBit;
virBitmapClearBitExpand; virBitmapClearBitExpand;
virBitmapCopy; virBitmapCopy;
virBitmapCountBits; virBitmapCountBits;
virBitmapDataToString; virBitmapDataFormat;
virBitmapEqual; virBitmapEqual;
virBitmapFormat; virBitmapFormat;
virBitmapFree; virBitmapFree;

View File

@ -1046,7 +1046,7 @@ virBitmapCountBits(virBitmapPtr bitmap)
} }
/** /**
* virBitmapDataToString: * virBitmapDataFormat:
* @data: the data * @data: the data
* @len: length of @data in bytes * @len: length of @data in bytes
* *
@ -1056,8 +1056,8 @@ virBitmapCountBits(virBitmapPtr bitmap)
* Returns: a string representation of the data, or NULL on error * Returns: a string representation of the data, or NULL on error
*/ */
char * char *
virBitmapDataToString(const void *data, virBitmapDataFormat(const void *data,
int len) int len)
{ {
virBitmapPtr map = NULL; virBitmapPtr map = NULL;
char *ret = NULL; char *ret = NULL;

View File

@ -136,8 +136,8 @@ ssize_t virBitmapNextClearBit(virBitmapPtr bitmap, ssize_t pos)
size_t virBitmapCountBits(virBitmapPtr bitmap) size_t virBitmapCountBits(virBitmapPtr bitmap)
ATTRIBUTE_NONNULL(1); ATTRIBUTE_NONNULL(1);
char *virBitmapDataToString(const void *data, char *virBitmapDataFormat(const void *data,
int len) int len)
ATTRIBUTE_NONNULL(1); ATTRIBUTE_NONNULL(1);
bool virBitmapOverlaps(virBitmapPtr b1, bool virBitmapOverlaps(virBitmapPtr b1,
virBitmapPtr b2) virBitmapPtr b2)

View File

@ -294,7 +294,7 @@ test4(const void *data ATTRIBUTE_UNUSED)
return -1; return -1;
} }
/* test for virBitmapNewData/ToData/DataToString */ /* test for virBitmapNewData/ToData/DataFormat */
static int static int
test5(const void *v ATTRIBUTE_UNUSED) test5(const void *v ATTRIBUTE_UNUSED)
{ {
@ -336,12 +336,12 @@ test5(const void *v ATTRIBUTE_UNUSED)
data2[4] != 0x04) data2[4] != 0x04)
goto error; goto error;
if (!(str = virBitmapDataToString(data, sizeof(data)))) if (!(str = virBitmapDataFormat(data, sizeof(data))))
goto error; goto error;
if (STRNEQ(str, "0,9,34")) if (STRNEQ(str, "0,9,34"))
goto error; goto error;
VIR_FREE(str); VIR_FREE(str);
if (!(str = virBitmapDataToString(data2, len2))) if (!(str = virBitmapDataFormat(data2, len2)))
goto error; goto error;
if (STRNEQ(str, "0,2,9,15,34")) if (STRNEQ(str, "0,2,9,15,34"))
goto error; goto error;

View File

@ -6527,7 +6527,7 @@ virshVcpuinfoPrintAffinity(vshControl *ctl,
vshPrint(ctl, "%-15s ", _("CPU Affinity:")); vshPrint(ctl, "%-15s ", _("CPU Affinity:"));
if (pretty) { if (pretty) {
if (!(str = virBitmapDataToString(cpumap, VIR_CPU_MAPLEN(maxcpu)))) if (!(str = virBitmapDataFormat(cpumap, VIR_CPU_MAPLEN(maxcpu))))
goto cleanup; goto cleanup;
vshPrint(ctl, _("%s (out of %d)"), str, maxcpu); vshPrint(ctl, _("%s (out of %d)"), str, maxcpu);
} else { } else {
@ -6781,7 +6781,7 @@ virshPrintPinInfo(vshControl *ctl,
{ {
char *str = NULL; char *str = NULL;
if (!(str = virBitmapDataToString(cpumap, cpumaplen))) if (!(str = virBitmapDataFormat(cpumap, cpumaplen)))
return false; return false;
vshPrint(ctl, "%s", str); vshPrint(ctl, "%s", str);

View File

@ -717,7 +717,7 @@ cmdNodeCpuMap(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
vshPrint(ctl, "%-15s ", _("CPU map:")); vshPrint(ctl, "%-15s ", _("CPU map:"));
if (pretty) { if (pretty) {
char *str = virBitmapDataToString(cpumap, VIR_CPU_MAPLEN(cpunum)); char *str = virBitmapDataFormat(cpumap, VIR_CPU_MAPLEN(cpunum));
if (!str) if (!str)
goto cleanup; goto cleanup;