From nobody Sat Sep 26 23:03:39 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=openvz.org ARC-Seal: i=1; a=rsa-sha256; t=1789472654; cv=none; d=zohomail.com; s=zohoarc; b=ArAA89IBvMitMVghwF9yl58FxJFjsR6X5W8n7vlsdZF84esa30cv+8Wa0XKjjc/ZtpqY2vMjuZRB3eEYbTmlhLcRFuY+FZkQqEEsmskVRHBYYbt/nlAKyi3wfyWE/IUU7ZOTPelLQ5fOJZfBvt7WbUithuspA5KOyu1NYmxZ7Rk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789472654; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lDVXntjhSghPxLA6Cp0G7NQ6A+eniameEy7FZm2Hlnk=; b=cxOOkq2dm2/DNDMl9zj8NMTI/ihKwff5aaso7wUuAKCuTOwlBdRV/4vTKrVtH3dUZnutF4S6vOqVGksGX16d0s+RfuKEKhu5E0MdVzg7AQzh5Ik/BHkhXBMka/282gONFhmINFAo2QOj2qlWVAWZZcuxQB9un7osdFXuzDJ8wyo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789472654611605.1194605048195; Tue, 15 Sep 2026 04:44:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6RZy-0000kE-Ns; Tue, 15 Sep 2026 07:44:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6RZL-0000f8-O7 for qemu-devel@nongnu.org; Tue, 15 Sep 2026 07:43:24 -0400 Received: from mail-wr2-x10.google.com ([2a00:1450:4864:30::10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x6RZ5-0005PS-HZ for qemu-devel@nongnu.org; Tue, 15 Sep 2026 07:43:12 -0400 Received: by mail-wr2-x10.google.com with SMTP id ffacd0b85a97d-4843f22dc83so2212380f8f.1 for ; Tue, 15 Sep 2026 04:43:04 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:33e6:6107:4678:322f]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-486eb34e4b5sm33648081f8f.22.2026.09.15.04.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 04:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1789472583; x=1790077383; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=lDVXntjhSghPxLA6Cp0G7NQ6A+eniameEy7FZm2Hlnk=; b=mstC/ABLK2I0HYN1hNGJ0d+hG4/l5E4EThMNYfgSLbKQoly4vAzAtRM5jKBktLOIfR Ijj6gE3rYlEBVjcuFVE3WnoldZWMmxdSW8vV84AyuQ63KN0O9g9YwXe8nfEj1FNh5iHw u2+Ba9eFuHXCztNzHyqgPrH7uF7W2F8hDRRHmR0fuE5M8J1XM1Vm1aTbDtt4f8j7S8QL MwcxWUt0txXvK48sL1vVHMyuf8/o2o4zTyuYRltdpwA0G8PElM6nwRKbI38qAadlyLGM +fS2sig0jUtCjaXIQVny/DLw38y1NbmkcKvyuV8I+52SPuHoFVjEq15UvNvhe90O6ofA 5SOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789472583; x=1790077383; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=lDVXntjhSghPxLA6Cp0G7NQ6A+eniameEy7FZm2Hlnk=; b=UUIvC5OVI9jmMKbBzheiMY7xtLddLtrHtVl4hadCInHVN39n7C1ezjsomXrH7LIVsN PTGyxPxZpCxWDMtpEA6mUIes7uCVssm4cCUKmpzyaRchu1Iym69WNlRY3adTkqAvZYMp MGosuez6Bb0NonLMKEBxODRNVmOTIxEBAgfcb8OZsQvOsvtDmu966prF/39qwc3kI55d uNPyrtxkk4/EmRVgUqX4zQrDdMRpFPfi931ZAMGR5LXWL+c35qSJfxVBDVseSsoyOL6C SpUmner1OM+ntK08zEq2+UGmpNs++RW0FO1w83K6rgEuxIcbqSb7H19VUhSypM9+T3PY S3vQ== X-Gm-Message-State: AFuF++mupb/jH5rJTbS9ZecCOtoVyVlgjhyOy5jTg1s/xJaTa9gQxzZR QgdEwvIsARD5bqya82M6Z9QzH7EvS+ano5mKyqWMzMQ/TM0gqO0+8wPp6P1b3SWdNImTwBzbYho OAwGq X-Gm-Gg: AYBFou3ErV3QQtPJwQdGDg8m9APAdLd74oc2sxvSe6jK/SBVYvc8krE/AhViO+P9Y11 LGZPvVdSLPqJlxOqMcK+WoIMQ/Zgy48iAHjoEbNC6sXfQ6csOrv+iBfRSt0XQ7yIJnhEqnBI8NQ /bXhaBQ0J9HOvzAmLS0AYNVmVQHTi2O4xgnTZ/vcvrm7PqFygLCrRv1ljrOALxu900eHOxgezkM H3xQF0JPdrIXtCYkMMSDIaOxqZSZYgGjodYwgIA+Ma3Gv+kLk1iCQv2ERregS17otECLORActwz nz0uNUmW7hHOkF8g29y+ynZOqttMWrXvgkOgUYhKckB92orId+AL/66t7le4eC8e1YdVsojSY2H BjRqijzzUDXT3+BySCdWt/yqtoVKbdWuHC2nO+J4v9Yh6jWdgjQfK0XZkF8LeB4AdGFiBxW+Aed /kMA95LPb6kl6ICg9c0+cmZVecGUR6BRxjUr2kvj657w7sK6keSkoXoX9Y/W8fQX7QaPj6 X-Received: by 2002:a05:6000:2312:b0:485:8edf:8353 with SMTP id ffacd0b85a97d-48702b184b7mr8514877f8f.43.1789472582822; Tue, 15 Sep 2026 04:43:02 -0700 (PDT) From: "Denis V. Lunev" To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, "Denis V. Lunev" , Stefan Hajnoczi , Eric Blake , Markus Armbruster Subject: [PULL 1/3] parallels: report the stored dirty bitmaps in qemu-img info Date: Tue, 15 Sep 2026 13:42:56 +0200 Message-ID: <20260915114258.3862446-2-den@openvz.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260915114258.3862446-1-den@openvz.org> References: <20260915114258.3862446-1-den@openvz.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:30::10; envelope-from=den@openvz.org; helo=mail-wr2-x10.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @openvz.org) X-ZM-MESSAGEID: 1789472656597158500 Content-Type: text/plain; charset="utf-8" From: Denis V. Lunev Nothing tells which persistent bitmaps an image carries. qemu-img info says nothing about them, and the only other way to see one is to export the image over NBD and ask for a bitmap by name, which needs the name beforehand. Add ImageInfoSpecificParallels with the bitmaps and their granularity, in the same way as qcow2 reports the contents of its bitmap directory: Format specific information: bitmaps: [0]: name: b2c9e1a4-5d3f-4e8b-9a7c-6f0d1e2b3a45 granularity: 65536 For running VM process the list is built on the fly from in-memory list. This is the best we can do. FormatExtension could be dead in the image while VMs are running as all bitmaps are cleared on non-clean VM stop. A bitmap of an image which was not closed correctly is inconsistent and can not be used. Report that as well, the way qcow2 reports its in-use flag, so such a bitmap is not listed as a valid one. The section is left empty for an image with no persistent dirty bitmaps, and an empty section is not printed, so the human readable output of "qemu-img info" and "info block" is unchanged. Cc: Stefan Hajnoczi Cc: Eric Blake Cc: Markus Armbruster Signed-off-by: Denis V. Lunev Acked-by: Markus Armbruster --- block/parallels-ext.c | 26 +++++++++++ block/parallels.c | 20 +++++++++ block/parallels.h | 3 ++ qapi/block-core.json | 45 ++++++++++++++++++- tests/qemu-iotests/tests/parallels-checks | 6 +++ tests/qemu-iotests/tests/parallels-checks.out | 19 ++++++++ 6 files changed, 117 insertions(+), 2 deletions(-) diff --git a/block/parallels-ext.c b/block/parallels-ext.c index f687f2da7c..8b8035af91 100644 --- a/block/parallels-ext.c +++ b/block/parallels-ext.c @@ -736,3 +736,29 @@ parallels_co_remove_persistent_dirty_bitmap(BlockDrive= rState *bs, =20 return ret; } + +void parallels_get_bitmap_info_list(BlockDriverState *bs, + ParallelsBitmapInfoList **info_list) +{ + BdrvDirtyBitmap *bitmap; + ParallelsBitmapInfoList **tail =3D info_list; + + *info_list =3D NULL; + + FOR_EACH_DIRTY_BITMAP(bs, bitmap) { + ParallelsBitmapInfo *info; + + if (!bdrv_dirty_bitmap_get_persistence(bitmap)) { + continue; + } + + info =3D g_new0(ParallelsBitmapInfo, 1); + info->name =3D g_strdup(bdrv_dirty_bitmap_name(bitmap)); + info->granularity =3D bdrv_dirty_bitmap_granularity(bitmap); + if (bdrv_dirty_bitmap_inconsistent(bitmap)) { + info->has_inconsistent =3D true; + info->inconsistent =3D true; + } + QAPI_LIST_APPEND(tail, info); + } +} diff --git a/block/parallels.c b/block/parallels.c index 2a5ceb8978..e7d65d0458 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -1624,6 +1624,25 @@ static bool parallels_is_support_dirty_bitmaps(Block= DriverState *bs) return 1; } =20 +static ImageInfoSpecific * GRAPH_RDLOCK +parallels_get_specific_info(BlockDriverState *bs, Error **errp) +{ + ImageInfoSpecificParallels *parallels_info; + ImageInfoSpecific *spec_info; + + parallels_info =3D g_new0(ImageInfoSpecificParallels, 1); + parallels_get_bitmap_info_list(bs, ¶llels_info->bitmaps); + parallels_info->has_bitmaps =3D !!parallels_info->bitmaps; + + spec_info =3D g_new(ImageInfoSpecific, 1); + *spec_info =3D (ImageInfoSpecific){ + .type =3D IMAGE_INFO_SPECIFIC_KIND_PARALLELS, + .u.parallels.data =3D parallels_info, + }; + + return spec_info; +} + static BlockDriver bdrv_parallels =3D { .format_name =3D "parallels", .instance_size =3D sizeof(BDRVParallelsState), @@ -1653,6 +1672,7 @@ static BlockDriver bdrv_parallels =3D { parallels_co_can_store_new_dirty_bitmap, .bdrv_co_remove_persistent_dirty_bitmap =3D parallels_co_remove_persistent_dirty_bit= map, + .bdrv_get_specific_info =3D parallels_get_specific_info, }; =20 static void bdrv_parallels_init(void) diff --git a/block/parallels.h b/block/parallels.h index 27d8c3ac83..012f47320b 100644 --- a/block/parallels.h +++ b/block/parallels.h @@ -32,6 +32,7 @@ #ifndef BLOCK_PARALLELS_H #define BLOCK_PARALLELS_H #include "qemu/coroutine.h" +#include "qapi/qapi-types-block-core.h" =20 #define HEADS_NUMBER 16 #define SEC_IN_CYL 32 @@ -111,5 +112,7 @@ parallels_co_can_store_new_dirty_bitmap(BlockDriverStat= e *bs, const char *name, int coroutine_fn GRAPH_RDLOCK parallels_co_remove_persistent_dirty_bitmap(BlockDriverState *bs, const char *name, Error **errp= ); +void parallels_get_bitmap_info_list(BlockDriverState *bs, + ParallelsBitmapInfoList **info_list); =20 #endif diff --git a/qapi/block-core.json b/qapi/block-core.json index 199efc1e00..aed2888147 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -188,6 +188,16 @@ '*extent-size-hint': 'size' } } =20 +## +# @ImageInfoSpecificParallels: +# +# @bitmaps: A list of parallels bitmap details +# +# Since: 11.2 +## +{ 'struct': 'ImageInfoSpecificParallels', + 'data': { '*bitmaps': ['ParallelsBitmapInfo'] } } + ## # @ImageInfoSpecificKind: # @@ -197,10 +207,12 @@ # # @file: Since 8.0 # +# @parallels: Since 11.2 +# # Since: 1.7 ## { 'enum': 'ImageInfoSpecificKind', - 'data': [ 'qcow2', 'vmdk', 'luks', 'rbd', 'file' ] } + 'data': [ 'qcow2', 'vmdk', 'luks', 'rbd', 'file', 'parallels' ] } =20 ## # @ImageInfoSpecificQCow2Wrapper: @@ -255,6 +267,16 @@ { 'struct': 'ImageInfoSpecificFileWrapper', 'data': { 'data': 'ImageInfoSpecificFile' } } =20 +## +# @ImageInfoSpecificParallelsWrapper: +# +# @data: image information specific to Parallels +# +# Since: 11.2 +## +{ 'struct': 'ImageInfoSpecificParallelsWrapper', + 'data': { 'data': 'ImageInfoSpecificParallels' } } + ## # @ImageInfoSpecific: # @@ -273,7 +295,8 @@ 'vmdk': 'ImageInfoSpecificVmdkWrapper', 'luks': 'ImageInfoSpecificLUKSWrapper', 'rbd': 'ImageInfoSpecificRbdWrapper', - 'file': 'ImageInfoSpecificFileWrapper' + 'file': 'ImageInfoSpecificFileWrapper', + 'parallels': 'ImageInfoSpecificParallelsWrapper' } } =20 ## @@ -751,6 +774,24 @@ 'data': {'name': 'str', 'granularity': 'uint32', 'flags': ['Qcow2BitmapInfoFlags'] } } =20 +## +# @ParallelsBitmapInfo: +# +# Parallels bitmap information. +# +# @name: the name of the bitmap +# +# @granularity: granularity of the bitmap in bytes +# +# @inconsistent: true if the bitmap is in an inconsistent state and +# cannot be used +# +# Since: 11.2 +## +{ 'struct': 'ParallelsBitmapInfo', + 'data': { 'name': 'str', 'granularity': 'uint32', + '*inconsistent': 'bool' } } + ## # @BlockLatencyHistogramInfo: # diff --git a/tests/qemu-iotests/tests/parallels-checks b/tests/qemu-iotests= /tests/parallels-checks index 3e9928c9c3..ca89ed5d62 100755 --- a/tests/qemu-iotests/tests/parallels-checks +++ b/tests/qemu-iotests/tests/parallels-checks @@ -382,6 +382,9 @@ echo "=3D=3D dirty a single granule of the bitmap =3D= =3D" file_size=3D`stat --printf=3D"%s" "$TEST_IMG"` echo "file size: $file_size" =20 +echo "=3D=3D the bitmap is reported by qemu-img info =3D=3D" +_img_info --format-specific + echo "=3D=3D the extension and its bitmap data are not a leak =3D=3D" _check_test_img =20 @@ -425,6 +428,9 @@ $QEMU_IMG bitmap --add -f $IMGFMT "$TEST_IMG" $BITMAP 2= >&1 | _filter_testdir echo "=3D=3D pretend the image was not closed correctly =3D=3D" poke_file "$TEST_IMG" "$INUSE_OFFSET" "\x59\x6e\x6f\x74" =20 +echo "=3D=3D a read-only open still reports it, marked inconsistent =3D=3D" +_img_info --format-specific + echo "=3D=3D the bitmap is stale, so it can not be used and is dropped =3D= =3D" $QEMU_IMG bitmap --clear -f $IMGFMT "$TEST_IMG" $BITMAP 2>&1 | _filter_tes= tdir =20 diff --git a/tests/qemu-iotests/tests/parallels-checks.out b/tests/qemu-iot= ests/tests/parallels-checks.out index 871a88d924..f6806f82fa 100644 --- a/tests/qemu-iotests/tests/parallels-checks.out +++ b/tests/qemu-iotests/tests/parallels-checks.out @@ -241,6 +241,15 @@ qemu-img: Operation add on bitmap bitmap0 failed: Bitm= ap name must be a UUID to wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) file size: 4194304 +=3D=3D the bitmap is reported by qemu-img info =3D=3D +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 4 MiB (4194304 bytes) +Format specific information: + bitmaps: + [0]: + name: b2c9e1a4-5d3f-4e8b-9a7c-6f0d1e2b3a45 + granularity: 65536 =3D=3D the extension and its bitmap data are not a leak =3D=3D No errors were found on the image. =3D=3D extend image by 1 cluster =3D=3D @@ -273,6 +282,16 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D41= 94304 wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =3D=3D pretend the image was not closed correctly =3D=3D +=3D=3D a read-only open still reports it, marked inconsistent =3D=3D +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 4 MiB (4194304 bytes) +Format specific information: + bitmaps: + [0]: + name: b2c9e1a4-5d3f-4e8b-9a7c-6f0d1e2b3a45 + granularity: 65536 + inconsistent: true =3D=3D the bitmap is stale, so it can not be used and is dropped =3D=3D Repairing image was not closed correctly qemu-img: Operation clear on bitmap b2c9e1a4-5d3f-4e8b-9a7c-6f0d1e2b3a45 f= ailed: Bitmap 'b2c9e1a4-5d3f-4e8b-9a7c-6f0d1e2b3a45' is inconsistent and ca= nnot be used --=20 2.53.0 From nobody Sat Sep 26 23:03:39 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=openvz.org ARC-Seal: i=1; a=rsa-sha256; t=1789472647; cv=none; d=zohomail.com; s=zohoarc; b=IPpgwwJxFnmdDZbj1Bofyyt7cvorkTMUPH/8WVLG4Dxr8/fVcUm7KJAGL+Km9dI4RMaJvQCYwqN9jSXZiuZ83ol0ihHj2M+eqXO9IwNDA3Y5R/WYRX3sM6jlYpTv97TreBjyF2yiwUIotDgu0ytWNYSfELyqOrRLpGI7H71Y85c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1789472647; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CrNy0DGUAMNQACpRIKae6EFwhUPs4CrGUyns6CD/7LI=; b=E6JPgOdKmND/IQ4y8/6owiSHefDtwmH65ql6c1N/aKqqcbk3SD7Nd7nZJhN972UQXwrSNSzYOilHfVKxXouypM+vV0Lgv0P5inaCGWJspaiK+XnBQ7dfpe7NeqUtBmAwYv77szdSc9c9zdMfRwqGLk60CSrzs9ZzGJn69a7nv6Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789472647541959.1121558019811; Tue, 15 Sep 2026 04:44:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6RZu-0000ij-IP; Tue, 15 Sep 2026 07:43:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6RZM-0000fB-8t for qemu-devel@nongnu.org; Tue, 15 Sep 2026 07:43:26 -0400 Received: from mail-wm2-x11.google.com ([2a00:1450:4864:31::11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x6RZ3-0005Pp-N3 for qemu-devel@nongnu.org; Tue, 15 Sep 2026 07:43:11 -0400 Received: by mail-wm2-x11.google.com with SMTP id 5b1f17b1804b1-49d1fb0cf5eso24913655e9.3 for ; Tue, 15 Sep 2026 04:43:05 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:33e6:6107:4678:322f]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-486eb34e4b5sm33648081f8f.22.2026.09.15.04.43.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 04:43:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1789472584; x=1790077384; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=CrNy0DGUAMNQACpRIKae6EFwhUPs4CrGUyns6CD/7LI=; b=WcmrLTsA2KVXO4MiCxo48oY8g2AtQrqzKyzPK8OD0yW64xrzz315M7FxrmxSuXm0G+ GTWg8YlPdfN0m6AI3SSkKgwVp2r4tv7kzJnqoM1Xrl0xGknmXWBSkGOnV0vqDoqIVZmL fNCXzE63LsfH8RwNd+pJXXnrOAGTlpMzVdBHPEzKaEDRBtLCaVshcISE+B4xIzlfAuSX pjEpwGfaUPFWULdrVfT0bkT9hzIn3UcewyG4h7l+ISmf7i1Lay3pMQeZEY6iyDNN2EiQ svnfmOfx1BIvafx4SMnd/e0iB2u3LcnODY1Or0JJFW76/+NuCCB/1t4sRn+aCbLUNzkW A5PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789472584; x=1790077384; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=CrNy0DGUAMNQACpRIKae6EFwhUPs4CrGUyns6CD/7LI=; b=Bnb/nHqp8a6qA6iGfoJ31L10uQt5spKorWGCb0JVA2+7HeLRQDv/fURtt6tHEvqy+q u34DG+zFQxL6A9GFEuicStOFcG5szcDWQqMB3qpgbnr+qC38a/4QqweeF/T6EntBqczi GE3oWJx8qxmzq5RM4QSOgQENfkEuE5E6n+6/AE70mmjmKrMrX+MhZQPPaQL7cpyuIP9E 1XaoXZP0I3n+XOayRaLzM0wt93SFEzNAkFUgtUHpr4p91NfhRurytyplQ+69YLhFqP+O 9pjmGASLWPAvWlvGLXpgeG/gEw3MhGI72hCCvZuJnDVoafWITdBvw0UzwLkt9IeCDk+c YKzA== X-Gm-Message-State: AFuF++lEo1IA38NDEEkxao2irNd7zyvsO6uryIXiCF37asaQ0G3U4cKx 3RkuKG/oXGxsG3BaTWPYXNYK7qgwPVshJysZMe/scGLtOYuH3WOtOhr4TMML6rrKUdrk01tXcT0 7CvX+ X-Gm-Gg: AYBFou04r7jo42xY0Ems4WiU877JDtJvO3ELyIysADf7eq29On+fNICo0at764q3poX M54gjXOJyrPRZE+WBp2xpj9VrLEYh6TBRgSzG2+dYAs4k60LaLqieneR0N1ZJhs179ZGDmEImB/ N8w0s60xyOEI1sjsyqaClJnffTnXM4bg3H/jTZz25oHMpaHoD/NfVH1pfp98CwCbCrc3Nse9y97 FEURgC0JTQ5tQxF4XAvKQ6F+tiuPXsMd5YOSPkr6VQGNlmw+Ut0z/Dbd+BQL40O/bTmLkoGcgkL wHoETflAxPWsCxC5hm3Al9ajkFmvSgY/Yj0hwSBs57jqKsKylG5+pZGQa4p21Nc/POiNq0WUKPs qQZ3DY6PuOxtf/88pZAQQ5vem4HaS22ZcuVPq43Ne4HkMJRNRJAklBLAiD+8nDn0L/PzwTXOmYB byzP0lz9YYnmq0hMm2Zvi9t4xQaJCwtHDPYsW7M+mX+ZW0mdSEmb7d6YQpMMxW4NpSJgAqU0ZGz Kv93BU= X-Received: by 2002:a05:600c:4ecd:b0:49d:2450:68ac with SMTP id 5b1f17b1804b1-49e7a64ad0bmr157000595e9.5.1789472583777; Tue, 15 Sep 2026 04:43:03 -0700 (PDT) From: "Denis V. Lunev" To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, "Denis V. Lunev" , Stefan Hajnoczi Subject: [PULL 2/3] iotests: cover storing a parallels dirty bitmap Date: Tue, 15 Sep 2026 13:42:57 +0200 Message-ID: <20260915114258.3862446-3-den@openvz.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260915114258.3862446-1-den@openvz.org> References: <20260915114258.3862446-1-den@openvz.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:31::11; envelope-from=den@openvz.org; helo=mail-wm2-x11.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @openvz.org) X-ZM-MESSAGEID: 1789472648622158500 Content-Type: text/plain; charset="utf-8" From: Denis V. Lunev parallels-bitmap covers loading a bitmap and parsing the Format Extension. Storing one is the other direction and is not covered at all. Nothing compares a stored bitmap with the writes it describes: test 165 compares a hash across a VM restart, which the same code produces and consumes, so a serialization wrong in both directions passes it. Write known ranges and read the bitmap back over NBD, in the shapes the storage code decides between: short ranges, a chunk dirty as a whole, a dirty run shorter than the cluster which serializes it, and a dirty tail. A bitmap which does not fit is refused when it is created, as the L1 table shares the Format Extension cluster with the feature headers of the bitmaps already there. One which fits an empty cluster does not fit next to seven others, and those seven have to survive the refusal. The rest is read out of the image file, as that is what the next open will see: a removal has to reach it when the command is given rather than when the node is closed, and the in use flag has to go with an inactivation and come back when the node is activated again. A bitmap which can not be written used to be lost in silence, so blkdebug fails the write of its data cluster: the loss has to be reported while the guest data still goes through, and the flag has to survive the failed inactivation. Cc: Stefan Hajnoczi Signed-off-by: Denis V. Lunev --- tests/qemu-iotests/tests/parallels-bitmap | 178 +++++++++++++++++- tests/qemu-iotests/tests/parallels-bitmap.out | 45 +++++ 2 files changed, 222 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/tests/parallels-bitmap b/tests/qemu-iotests= /tests/parallels-bitmap index 814b56b32c..be0ba8185d 100755 --- a/tests/qemu-iotests/tests/parallels-bitmap +++ b/tests/qemu-iotests/tests/parallels-bitmap @@ -25,7 +25,8 @@ import uuid from qemu.utils import VerboseProcessError =20 import iotests -from iotests import qemu_nbd_popen, qemu_img, qemu_img_map, log, file_path +from iotests import qemu_nbd_popen, qemu_img, qemu_img_create, qemu_img_ma= p, \ + qemu_io, log, file_path, QemuStorageDaemon =20 iotests.script_initialize(supported_fmts=3D['parallels']) =20 @@ -258,3 +259,178 @@ def check_multi_l1(): =20 =20 check_multi_l1() + + +# Storing a bitmap. The driver has to produce the extension itself here, +# so the images are real ones rather than hand crafted clusters. + +INUSE_MAGIC =3D 0x746F6E59 +INUSE_OFF =3D 0x2c +EXT_OFF =3D 0x38 +TRACKS_OFF =3D 0x1c + +stored =3D file_path('stored') +copy =3D file_path('copy') +STORED =3D '9b7b8b2e-1c4a-4d3f-8e6a-1f2d3c4b5a69' +OTHER =3D '11111111-2222-3333-4444-555555555555' + + +def read_header(off, fmt): + with open(stored, 'rb') as f: + return struct.unpack_from(fmt, f.read(0x40), off)[0] + + +def in_use(): + return read_header(INUSE_OFF, ' (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1789472644733707.1276353345565; Tue, 15 Sep 2026 04:44:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x6RZb-0000hW-Ge; Tue, 15 Sep 2026 07:43:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x6RZL-0000fD-Qj for qemu-devel@nongnu.org; Tue, 15 Sep 2026 07:43:24 -0400 Received: from mail-wr2-x10.google.com ([2a00:1450:4864:30::10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x6RZ5-0005Q0-I6 for qemu-devel@nongnu.org; Tue, 15 Sep 2026 07:43:12 -0400 Received: by mail-wr2-x10.google.com with SMTP id ffacd0b85a97d-485b1d2874fso994231f8f.0 for ; Tue, 15 Sep 2026 04:43:05 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:33e6:6107:4678:322f]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-486eb34e4b5sm33648081f8f.22.2026.09.15.04.43.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 04:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1789472585; x=1790077385; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=0cFMp897/2LhAMY3XQX2UH5MPXIwRH5TBMsVmASGwDU=; b=koD5z8u+Fvb/aXoYJOmxzCMsqe48cKxHVazvkVepbvAi/0ObG1yhT1r0r5jIlhdWC7 xzYZYg8WYGql0Mqm/JcAf5B5W4jBSff52Yi2geaGRt/h33hBQ7sETMUtAp+DeI8bIkI1 wUGyUkqwRJYh7usWHGwQpR29iseif6sFoEpB3M2tqyG80GRDFpL7wOwWgP3X/zg3Z0/i S6LTklIbWMVvVzZWpQ0MAsaiwBA7OY0LZ95t42gn3TORlxTCAT5FAgHsK5zCuYSEpk6Y fpdqd2L7TIz2i389BBUAZHZNVKeZHtKAZ+e+bSSo5MnuHnSeXXN55tLVabGEhRFiygDI mwgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789472585; x=1790077385; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=0cFMp897/2LhAMY3XQX2UH5MPXIwRH5TBMsVmASGwDU=; b=bMvp/1iDIi99yjNZ+tuCvQ0nOm1hgma6BYAhCUzW2sK0EKVjlrhRm9of6GzGzUSO1l CDaHGthPGxKxSL0/KRg3lSzCxBYBF1hfqWfwbOTq2hg5oAgtYiwO5ktBoiUAUAxvORQ7 OQBad/2R/CshgE6J9irl7NlOVUG8LxQgU3TjfOfOWo7ngIOzjoYmKvPjXFiRwA8ShJZ/ RBl/gJuLak5YB0tFGFJNHiEUj4HrigStzZavwgFB/iDErk6xkyCKNw1Mi2YDhkKvW/v7 1MEjdEscPhw0V3ICj8nKHEUaGdykjLGiOSGGCbAfc2uwgUlpMK1WpvM7Na4cbMbucCi2 Vv1w== X-Gm-Message-State: AFuF++nkeKbGnGsXNWmrYoFWxoKeZjvLRHfioTi1uKd7CXelTLFvDYkE NTI3BwOM7iKRexR70xPQkklfzVu1Psg+RilaNdvsWfL3OUwf1cAIBFuwEVF+liJLMoXpzs2dIN6 yKByJ X-Gm-Gg: AYBFou0sbDbAaTYxsYexe4ZPRNg9dkNHHr3J6MYghRG0udfmovFv1fN5MLF+2xLAVqj dTq8nMrtjpzZcBwfzCdaWWqxtrJIWGjR4lSIUVR1p9yf/xQ3+F7DpyB6ZzlKX//5ervGwcR9MVF tBwoUBqnHeBxITIRduawT3vIcn/aC5SYZwYxzLRDPydEgP3ENBxSX7wQ99otq7d4pNkaGzcWE9R cBFxRtII6F/xGITg7ymvKxrQM//5n4hkwozK8+ELubbJmdrWQJX0Si/yAp5r5kVAg3cIRctMn1A ae9VMSzenyp9l/KpWwX4wCXYhxi/t1zCCEBkQtQnz8WVMHDDwQkh6p3reiJ1Qr7LP4iHq4A+twv 9AbmoXXuoR5s1UNSAI1f+EFUatJD7CLz5+5HXhhR7RzDsIb/YS3BJvQQuENvUM/yg7wH8Djdsu/ eOTztRNq548+chsRU+SI0QX8utvxSSZskzsDe8J0C5N4LCBGoC3rxztUlx508H1LZN5KXIy06IH nMC6uQ= X-Received: by 2002:a05:6000:41dc:b0:487:a87:24c9 with SMTP id ffacd0b85a97d-4870a87263fmr963470f8f.3.1789472584879; Tue, 15 Sep 2026 04:43:04 -0700 (PDT) From: "Denis V. Lunev" To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, "Denis V. Lunev" , Stefan Hajnoczi Subject: [PULL 3/3] iotests: cover the qemu-img bitmap operations on parallels Date: Tue, 15 Sep 2026 13:42:58 +0200 Message-ID: <20260915114258.3862446-4-den@openvz.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260915114258.3862446-1-den@openvz.org> References: <20260915114258.3862446-1-den@openvz.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:30::10; envelope-from=den@openvz.org; helo=mail-wr2-x10.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @openvz.org) X-ZM-MESSAGEID: 1789472646917158500 Content-Type: text/plain; charset="utf-8" From: Denis V. Lunev qemu-img-bitmaps drives convert --bitmaps and every qemu-img bitmap sub-command, but for qcow2 alone. It is built on a backing chain and a rebase, which parallels has neither of, so half of it could not run there and the format is left with no coverage of any of this. Cover what applies in the parallels test instead. A copy made with --bitmaps has to carry them, and raw has to refuse them. --merge and --clear leave the bitmap count alone, --remove-all sweeps it to zero, and --remove-all --add in one invocation leaves only the bitmap which was just added. An image which was not closed correctly is left out. parallels-checks covers that already, next to the code which drops the bitmaps. Cc: Stefan Hajnoczi Signed-off-by: Denis V. Lunev --- tests/qemu-iotests/tests/parallels-bitmap | 39 +++++++++++++++++++ tests/qemu-iotests/tests/parallels-bitmap.out | 12 ++++++ 2 files changed, 51 insertions(+) diff --git a/tests/qemu-iotests/tests/parallels-bitmap b/tests/qemu-iotests= /tests/parallels-bitmap index be0ba8185d..8ae9314114 100755 --- a/tests/qemu-iotests/tests/parallels-bitmap +++ b/tests/qemu-iotests/tests/parallels-bitmap @@ -273,6 +273,7 @@ stored =3D file_path('stored') copy =3D file_path('copy') STORED =3D '9b7b8b2e-1c4a-4d3f-8e6a-1f2d3c4b5a69' OTHER =3D '11111111-2222-3333-4444-555555555555' +MERGED =3D '22222222-3333-4444-5555-666666666666' =20 =20 def read_header(off, fmt): @@ -434,3 +435,41 @@ log('--- and the image is still readable') info_out =3D qemu_img('info', '-f', iotests.imgfmt, stored, check=3DFalse) log('image opened' if info_out.returncode =3D=3D 0 else iotests.filter_testfiles(info_out.stdout).strip()) + + +# qemu-img-bitmaps drives these for qcow2 alone, as it is built on a +# backing chain and a rebase, which parallels has neither of. + +log('--- bitmaps can not be preserved into raw') +make_image(STORED) +raw_out =3D qemu_img('convert', '--bitmaps', '-f', iotests.imgfmt, '-O', + 'raw', stored, copy, check=3DFalse) +log(' ' + iotests.filter_testfiles(raw_out.stdout).strip()) + +log('--- convert --bitmaps carries the bitmaps into the copy') +make_image(STORED, OTHER) +qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x11 1M 64k', stored) +qemu_img('convert', '--bitmaps', '-f', iotests.imgfmt, '-O', iotests.imgfm= t, + stored, copy) +copy_info =3D iotests.qemu_img_info('-f', iotests.imgfmt, copy) +copy_data =3D copy_info.get('format-specific', {}).get('data', {}) +log(' %d bitmaps in the copy' % len(copy_data.get('bitmaps', []))) + +log('--- merging one bitmap into a new one') +qemu_img('bitmap', '--add', '--merge', STORED, '-f', iotests.imgfmt, + stored, MERGED) +log(' %d bitmaps stored' % len(bitmaps_reported())) + +log('--- clearing a bitmap keeps it in the image') +qemu_img('bitmap', '--clear', '-f', iotests.imgfmt, stored, STORED) +log(' %d bitmaps stored' % len(bitmaps_reported())) + +log('--- remove-all sweeps every bitmap of the image') +qemu_img('bitmap', '--remove-all', '-f', iotests.imgfmt, stored) +log(' %d bitmaps after remove-all' % len(bitmaps_reported())) + +log('--- remove-all with --add leaves only the new bitmap') +make_image(STORED, OTHER) +qemu_img('bitmap', '--remove-all', '--add', '-f', iotests.imgfmt, + stored, MERGED) +log(' ' + ' '.join(bitmaps_reported())) diff --git a/tests/qemu-iotests/tests/parallels-bitmap.out b/tests/qemu-iot= ests/tests/parallels-bitmap.out index 994c67390e..df6f676106 100644 --- a/tests/qemu-iotests/tests/parallels-bitmap.out +++ b/tests/qemu-iotests/tests/parallels-bitmap.out @@ -92,3 +92,15 @@ read 65536/65536 bytes at offset 0 0 bitmaps stored --- and the image is still readable image opened +--- bitmaps can not be preserved into raw + qemu-img: Format driver 'raw' does not support bitmaps +--- convert --bitmaps carries the bitmaps into the copy + 2 bitmaps in the copy +--- merging one bitmap into a new one + 3 bitmaps stored +--- clearing a bitmap keeps it in the image + 3 bitmaps stored +--- remove-all sweeps every bitmap of the image + 0 bitmaps after remove-all +--- remove-all with --add leaves only the new bitmap + 22222222-3333-4444-5555-666666666666 --=20 2.53.0