From nobody Thu May 15 06:42:09 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1510563066781125.10923459413004; Mon, 13 Nov 2017 00:51:06 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 577F81A4068; Mon, 13 Nov 2017 08:51:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 25F0D7A21D; Mon, 13 Nov 2017 08:51:05 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E01491802123; Mon, 13 Nov 2017 08:51:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAD8okRj016268 for ; Mon, 13 Nov 2017 03:50:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id 066F470399; Mon, 13 Nov 2017 08:50:46 +0000 (UTC) Received: from caroline.localdomain (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A5702703A7 for ; Mon, 13 Nov 2017 08:50:45 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.brq.redhat.com [127.0.0.1]) by caroline.localdomain (Postfix) with ESMTP id 54F49123A79 for ; Mon, 13 Nov 2017 09:50:41 +0100 (CET) From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 13 Nov 2017 09:50:20 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/21] util: Rename virBitmapDataToString to virBitmapDataFormat X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 13 Nov 2017 08:51:05 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: John Ferlan --- src/libvirt_private.syms | 2 +- src/util/virbitmap.c | 6 +++--- src/util/virbitmap.h | 4 ++-- tests/virbitmaptest.c | 4 ++-- tools/virsh-domain.c | 4 ++-- tools/virsh-host.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index c11dc9ab5672..e535167e28fc 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1344,7 +1344,7 @@ virBitmapClearBit; virBitmapClearBitExpand; virBitmapCopy; virBitmapCountBits; -virBitmapDataToString; +virBitmapDataFormat; virBitmapEqual; virBitmapFormat; virBitmapFree; diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c index 58ef1a2e299b..3d160aa4d50a 100644 --- a/src/util/virbitmap.c +++ b/src/util/virbitmap.c @@ -1044,7 +1044,7 @@ virBitmapCountBits(virBitmapPtr bitmap) } =20 /** - * virBitmapDataToString: + * virBitmapDataFormat: * @data: the data * @len: length of @data in bytes * @@ -1054,8 +1054,8 @@ virBitmapCountBits(virBitmapPtr bitmap) * Returns: a string representation of the data, or NULL on error */ char * -virBitmapDataToString(const void *data, - int len) +virBitmapDataFormat(const void *data, + int len) { virBitmapPtr map =3D NULL; char *ret =3D NULL; diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h index 99eb779d7188..720b389cfe52 100644 --- a/src/util/virbitmap.h +++ b/src/util/virbitmap.h @@ -136,8 +136,8 @@ ssize_t virBitmapNextClearBit(virBitmapPtr bitmap, ssiz= e_t pos) size_t virBitmapCountBits(virBitmapPtr bitmap) ATTRIBUTE_NONNULL(1); =20 -char *virBitmapDataToString(const void *data, - int len) +char *virBitmapDataFormat(const void *data, + int len) ATTRIBUTE_NONNULL(1); bool virBitmapOverlaps(virBitmapPtr b1, virBitmapPtr b2) diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c index c24d4a72f70a..488796719dd9 100644 --- a/tests/virbitmaptest.c +++ b/tests/virbitmaptest.c @@ -336,12 +336,12 @@ test5(const void *v ATTRIBUTE_UNUSED) data2[4] !=3D 0x04) goto error; =20 - if (!(str =3D virBitmapDataToString(data, sizeof(data)))) + if (!(str =3D virBitmapDataFormat(data, sizeof(data)))) goto error; if (STRNEQ(str, "0,9,34")) goto error; VIR_FREE(str); - if (!(str =3D virBitmapDataToString(data2, len2))) + if (!(str =3D virBitmapDataFormat(data2, len2))) goto error; if (STRNEQ(str, "0,2,9,15,34")) goto error; diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 42d5526374fc..adfde692993a 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6527,7 +6527,7 @@ virshVcpuinfoPrintAffinity(vshControl *ctl, =20 vshPrint(ctl, "%-15s ", _("CPU Affinity:")); if (pretty) { - if (!(str =3D virBitmapDataToString(cpumap, VIR_CPU_MAPLEN(maxcpu)= ))) + if (!(str =3D virBitmapDataFormat(cpumap, VIR_CPU_MAPLEN(maxcpu)))) goto cleanup; vshPrint(ctl, _("%s (out of %d)"), str, maxcpu); } else { @@ -6781,7 +6781,7 @@ virshPrintPinInfo(vshControl *ctl, { char *str =3D NULL; =20 - if (!(str =3D virBitmapDataToString(cpumap, cpumaplen))) + if (!(str =3D virBitmapDataFormat(cpumap, cpumaplen))) return false; =20 vshPrint(ctl, "%s", str); diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 5509065fd606..ecaf830e350d 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -717,7 +717,7 @@ cmdNodeCpuMap(vshControl *ctl, const vshCmd *cmd ATTRIB= UTE_UNUSED) =20 vshPrint(ctl, "%-15s ", _("CPU map:")); if (pretty) { - char *str =3D virBitmapDataToString(cpumap, VIR_CPU_MAPLEN(cpunum)= ); + char *str =3D virBitmapDataFormat(cpumap, VIR_CPU_MAPLEN(cpunum)); =20 if (!str) goto cleanup; --=20 2.15.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list