From nobody Mon Feb 9 01:21:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601624628; cv=none; d=zohomail.com; s=zohoarc; b=NoUUXzRKgDktBZ5TdTKHvGZ0TQgXMkQnj/pT+VxVOXpjOKj03s23e3WPhIQrkOtKK03jnAds57eeSljeXpsTb6i2M/sq+TofLXrWqmyR9NZP1Gn+sYzvkNm1zBMNffMNpz3+C0BCBY/94wJnrkhjOoMFTPAzigwJoAWHjXm1oVw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601624628; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VfV3YmAqEwoll4QWaCVRaqu+wh3a9BX4fb5sPkBWGOs=; b=FNKBUl2yBi3hrM+uvb/yZ9IWa+fAeKi5NeKXMQ52uCaYZK/pWJcjuzS6JGnzG9/I5Husz2ww2hQqJqUXmuhuAep298WPCtET44rwWZj+8jkIYJZFCZngkrzlptQiMK0b6SBvUTmhUGvpDy0hdcGf1GWIJhk9ivFH5pM5eAapSEQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1601624628498564.1949856917695; Fri, 2 Oct 2020 00:43:48 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-146-2gObi4X3MSqWRkZKz5_wXQ-1; Fri, 02 Oct 2020 03:43:42 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 724AF6408C; Fri, 2 Oct 2020 07:43:37 +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 51FE45C1D0; Fri, 2 Oct 2020 07:43:37 +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 2240B180B791; Fri, 2 Oct 2020 07:43:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0927hIli004107 for ; Fri, 2 Oct 2020 03:43:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4EBC51992F; Fri, 2 Oct 2020 07:43:18 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF8A91A4D6 for ; Fri, 2 Oct 2020 07:43:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601624625; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=VfV3YmAqEwoll4QWaCVRaqu+wh3a9BX4fb5sPkBWGOs=; b=BPGIhTa28mM62ug/jqiO4CP5okJqJuu881Y8YM6Eu01JX+OZt3KhkXW2CDxPS3q4oeQOFq qm96+AbuRrgWbstAy/k432DpluybcA+LacNCzjQl7gTlb9eGTY4ehPMg6FN7T/buA+q/nz B2CZbcJ4ZELBbSL+/d0O5Q/J2R6drg0= X-MC-Unique: 2gObi4X3MSqWRkZKz5_wXQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/15] virBitmapToString|virBitmapNewString: Clarify semantics of the 'string' Date: Fri, 2 Oct 2020 09:42:57 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Clarify which bit is considered most significant in the bitmap and resulting string. Also be explicit that it's a hex string. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/util/virbitmap.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c index ad5213f216..fcb8e1101a 100644 --- a/src/util/virbitmap.c +++ b/src/util/virbitmap.c @@ -328,7 +328,9 @@ virBitmapGetBit(virBitmapPtr bitmap, * virBitmapToString: * @bitmap: Pointer to bitmap * - * Convert @bitmap to printable string. + * Convert @bitmap to printable hexadecimal string representation. Note th= at bit + * with highest position/index in @bitmap are considered as most significa= nt bit + * in the output string. * * Returns pointer to the string or NULL on error. */ @@ -1117,10 +1119,13 @@ virBitmapCountBits(virBitmapPtr bitmap) * virBitmapNewString: * @string: the string to be converted to a bitmap * - * Allocate a bitmap from a string of hexadecimal data. + * Allocate a bitmap and populate it from a string of hexadecimal data. No= te + * that leftmost character in the string will correspond to the highest + * index/position in the bitmap. The size of the returned bitmap correspon= ds to + * 4 * the length of @string. * - * Returns a pointer to the allocated bitmap or NULL if - * memory cannot be allocated. + * Returns a pointer to the allocated bitmap or NULL and reports an error = if + * @string can't be converted. */ virBitmapPtr virBitmapNewString(const char *string) --=20 2.26.2