From nobody Mon Feb 2 07:31:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1769622726; cv=none; d=zohomail.com; s=zohoarc; b=KcxNiWLdpNMxgmet3lpfp5Ll9Se/T0hAB8ArQxmeOfPKSsaVAT3rlhEi0keElHlnT8hFrWoqdJMZsHQmO2Gx7LpLjvl6g2x1QG+i1JWHri7VxiWTPVSmqtgpwX7lVKY+vsmiMC8el8CzqZGxCQZEsF9kWCDhP/qBlnc4Np2zT5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769622726; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=xU/kpBIToajOUMG9MJL6BouLsafB+5z9KsoiXs8tvOE=; b=T6C/rddDFWzQbm6eecBQpEjz9bPfYX7MU751jyYP/1HeqOQ8A/5GkOqEp6xEt+Tw/n+p+Kwx4D7RSporpfZ5mM1OMFI9+MJ6fW/IpKE353tVXglcaPnt5JtvJ0Np8I5H5ub+eqIUH5Jx2Vauuo9P397FEghJAd8gwi9RhLRUZAc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1769622726096258.6721227687095; Wed, 28 Jan 2026 09:52:06 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 39FDA41BB0; Wed, 28 Jan 2026 12:52:05 -0500 (EST) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id D428C41911; Wed, 28 Jan 2026 12:50:16 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 2AFAF4190E; Wed, 28 Jan 2026 12:50:11 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 1B18F418E7 for ; Wed, 28 Jan 2026 12:49:42 -0500 (EST) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-260-zOPKaPePMwKK4zYF-y4VKA-1; Wed, 28 Jan 2026 12:49:40 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 72E881956054 for ; Wed, 28 Jan 2026 17:49:39 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.3]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BC75B1958DC0 for ; Wed, 28 Jan 2026 17:49:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769622581; h=from:from: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; bh=xU/kpBIToajOUMG9MJL6BouLsafB+5z9KsoiXs8tvOE=; b=XkKzN1eym3XfAmCUvmpO0t5IvmWBhMWpfk7nvOBwfH3Vq8+JX+FDtMNDdhhG06drt4kN4J yIKR55aa86V6R29/uo92Q3m4yjezc+xbo3KkleEcxc9Sb3lwLKoIUg8IrqXDbVFJidqYdm vC4XXyDzcFt1Slgj4vI2aReS4VDjLxE= X-MC-Unique: zOPKaPePMwKK4zYF-y4VKA-1 X-Mimecast-MFC-AGG-ID: zOPKaPePMwKK4zYF-y4VKA_1769622579 To: devel@lists.libvirt.org Subject: [PATCH 1/5] qemublocktest: Iterate all nodenames in 'testQemuDetectBitmaps' Date: Wed, 28 Jan 2026 18:49:32 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: E7fNn7O1_BwKlVSI1LrvMbL5Bz2igIf0sQT9lJ_CiZs_1769622579 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: M3M5MVBLEPVXZAQSQD2NNAOMOHUXQRDY X-Message-ID-Hash: M3M5MVBLEPVXZAQSQD2NNAOMOHUXQRDY X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1769622727765158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Rather than looking for 30 specific nodenames (via a loop) iterate everything in the hash table (in a sorted order). This simplifies the code and provides more test outputs on previously-ignored nodenames. The listing of internal snapshots in the output was also missing a newline, which would now cause problems with multiple images reproted. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 24 +++++++------------ tests/qemublocktestdata/bitmap/basic.out | 1 + tests/qemublocktestdata/bitmap/empty.out | 1 + .../bitmap/snapshots-internal.out | 7 ++++++ tests/qemublocktestdata/bitmap/snapshots.out | 5 ++++ tests/qemublocktestdata/bitmap/synthetic.out | 5 ++++ 6 files changed, 28 insertions(+), 15 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 47746207cc..51d9268cdd 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -575,17 +575,15 @@ testQemuImageCreate(const void *opaque) static const char *bitmapDetectPrefix =3D "qemublocktestdata/bitmap/"; -static void -testQemuDetectBitmapsWorker(GHashTable *nodedata, +static int +testQemuDetectBitmapsWorker(void *payload, const char *nodename, - virBuffer *buf) + void *opaque) { - qemuBlockNamedNodeData *data; + qemuBlockNamedNodeData *data =3D payload; + virBuffer *buf =3D opaque; size_t i; - if (!(data =3D virHashLookup(nodedata, nodename))) - return; - virBufferAsprintf(buf, "%s:\n", nodename); if (data->qcow2v2) virBufferAddLit(buf, " qcow2 v2\n"); @@ -617,9 +615,12 @@ testQemuDetectBitmapsWorker(GHashTable *nodedata, virBufferAsprintf(buf, " '%s'%s", (const char *) n->key, vms); } + + virBufferAddLit(buf, "\n"); } virBufferAdjustIndent(buf, -1); + return 0; } @@ -632,7 +633,6 @@ testQemuDetectBitmaps(const void *opaque) g_autofree char *actual =3D NULL; g_autofree char *expectpath =3D NULL; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - size_t i; expectpath =3D g_strdup_printf("%s/%s%s.out", abs_srcdir, bitmapDetectPrefix, name); @@ -646,13 +646,7 @@ testQemuDetectBitmaps(const void *opaque) return -1; } - /* we detect for the first 30 nodenames for simplicity */ - for (i =3D 0; i < 30; i++) { - g_autofree char *nodename =3D g_strdup_printf("libvirt-%zu-format"= , i); - - testQemuDetectBitmapsWorker(nodedata, nodename, &buf); - } - + virHashForEachSorted(nodedata, testQemuDetectBitmapsWorker, &buf); actual =3D virBufferContentAndReset(&buf); return virTestCompareToFile(actual, expectpath); diff --git a/tests/qemublocktestdata/bitmap/basic.out b/tests/qemublocktest= data/bitmap/basic.out index 5c4c35b3f0..b96ffe3d39 100644 --- a/tests/qemublocktestdata/bitmap/basic.out +++ b/tests/qemublocktestdata/bitmap/basic.out @@ -4,3 +4,4 @@ libvirt-1-format: c: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 b: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 +libvirt-1-storage: diff --git a/tests/qemublocktestdata/bitmap/empty.out b/tests/qemublocktest= data/bitmap/empty.out index 3787cbd354..c9a5be4f07 100644 --- a/tests/qemublocktestdata/bitmap/empty.out +++ b/tests/qemublocktestdata/bitmap/empty.out @@ -1 +1,2 @@ libvirt-1-format: +libvirt-1-storage: diff --git a/tests/qemublocktestdata/bitmap/snapshots-internal.out b/tests/= qemublocktestdata/bitmap/snapshots-internal.out index dbb3cfded4..cf7bde96a5 100644 --- a/tests/qemublocktestdata/bitmap/snapshots-internal.out +++ b/tests/qemublocktestdata/bitmap/snapshots-internal.out @@ -1,2 +1,9 @@ libvirt-1-format: internal snapshots: '1727868651'(*) '1727872064'(*) +libvirt-1-storage: +libvirt-2-storage: +libvirt-pflash0-format: +libvirt-pflash0-storage: +libvirt-pflash1-format: + internal snapshots: '1727868651' '1727872064' +libvirt-pflash1-storage: diff --git a/tests/qemublocktestdata/bitmap/snapshots.out b/tests/qemublock= testdata/bitmap/snapshots.out index 24ca27e4d8..29c586be7e 100644 --- a/tests/qemublocktestdata/bitmap/snapshots.out +++ b/tests/qemublocktestdata/bitmap/snapshots.out @@ -4,16 +4,21 @@ libvirt-1-format: b: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 c: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 current: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 +libvirt-1-storage: libvirt-2-format: c: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 b: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 d: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 +libvirt-2-storage: libvirt-3-format: a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 b: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 c: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 +libvirt-3-storage: libvirt-4-format: a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 +libvirt-4-storage: libvirt-5-format: a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 +libvirt-5-storage: diff --git a/tests/qemublocktestdata/bitmap/synthetic.out b/tests/qemublock= testdata/bitmap/synthetic.out index 45423903a0..2f4ae2b217 100644 --- a/tests/qemublocktestdata/bitmap/synthetic.out +++ b/tests/qemublocktestdata/bitmap/synthetic.out @@ -6,12 +6,17 @@ libvirt-1-format: top-inactive: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 top-transient: record:1 busy:0 persist:0 inconsist:0 gran:65536 dirty:0 top-transient-inactive: record:0 busy:0 persist:0 inconsist:0 gran:65536 = dirty:0 +libvirt-1-storage: libvirt-2-format: d: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 +libvirt-2-storage: libvirt-3-format: b: record:1 busy:0 persist:0 inconsist:0 gran:65536 dirty:0 c: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 d: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 +libvirt-3-storage: libvirt-4-format: +libvirt-4-storage: libvirt-5-format: a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0 +libvirt-5-storage: --=20 2.52.0