From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465194; cv=none; d=zohomail.com; s=zohoarc; b=jcTnVGuhRTmb4wvfbTbkBbuOplyF7qfpMp4tT+vCiMv/rav3tujITD4Pxn/3sTRkMcv+svYmhAycmoRqdqAYChKjrG+RmMVTO8mp/V8y2fQx2Ao76Wv4D9qFh6IZk1I+tRAlXezr3PZTqY+VZXFMTORa7eaSdIgMY8hSnE4fZYg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465194; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dnnQ+x6ke5J4C/UZeNYoriCiAxRaxfgHTzEfrp90foM=; b=J7+e3OmOY0daFouyI7Gzp4n//hrXx1XJ8TH6dH10pXpP/BU0EFhTPGC4ce8J3A6AmmUwGDWlc9/fckhcx0ntJeEU/vE6dMIMIfi9nJyDBvCIiKyoldhUDmkI3+YdpX7mz3Y7nkPVnza+0vIoIgqDlC+UvAjdYygvHlNuRolgFsE= 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 1791465194349827.9862727436813; Thu, 8 Oct 2026 06:13:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnvK-0002eU-8H; Thu, 08 Oct 2026 09:12:38 -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 1xEnvG-0002e4-Bw for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:12:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnvC-0002Nz-TL for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:12:33 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-376-tHB4fjqWMLekxP4rSBKTZg-1; Thu, 08 Oct 2026 09:12:28 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EDA3E1809C9E for ; Thu, 8 Oct 2026 13:12:26 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9D5F830001BB; Thu, 8 Oct 2026 13:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dnnQ+x6ke5J4C/UZeNYoriCiAxRaxfgHTzEfrp90foM=; b=PfXVn/lP3pGDsHrSO/Wg2gHjBJVCfu7DnvFi3tJZkISk07ilpMDkzE9ADHyN2bOqqFHKsB gHnKN7swbm1dRvLN7/SIMFhE4b5wWZk+iSA+TSaSxA5SRfajH6xu7YUFztRJB0yJy7Kji0 +dQ8nHd4AcnXp9/iDNLAMc4LxYj8Hbo= X-MC-Unique: tHB4fjqWMLekxP4rSBKTZg-1 X-Mimecast-MFC-AGG-ID: tHB4fjqWMLekxP4rSBKTZg_1791465147 From: Eric Blake To: qemu-devel@nongnu.org Cc: Markus Armbruster Subject: [PULL 01/15] maint: Update eblake's staging repo Date: Thu, 8 Oct 2026 08:11:40 -0500 Message-ID: <20261008131216.2437896-18-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.133.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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 @redhat.com) X-ZM-MESSAGEID: 1791465197311158500 Content-Type: text/plain; charset="utf-8" repo.or.cz is struggling with geofencing restrictions and frequent service degredation from AI bot overloads; time to update my staging repo to something with a bit more accessibility and uptime. Signed-off-by: Eric Blake Message-ID: <20261007122951.1935165-2-eblake@redhat.com> Reviewed-by: Markus Armbruster --- MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 1312bbd1bd8..518f5ee6115 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3365,7 +3365,7 @@ F: migration/block-dirty-bitmap.c F: util/hbitmap.c F: tests/unit/test-hbitmap.c F: docs/interop/bitmaps.rst -T: git https://repo.or.cz/qemu/ericb.git bitmaps +T: git https://gitlab.com/ebblake/qemu.git bitmaps T: git https://gitlab.com/vsementsov/qemu.git block Character device backends @@ -4364,7 +4364,7 @@ F: blockdev-nbd.c F: docs/interop/nbd.rst F: docs/tools/qemu-nbd.rst F: tests/qemu-iotests/tests/*nbd* -T: git https://repo.or.cz/qemu/ericb.git nbd +T: git https://gitlab.com/ebblake/qemu.git nbd T: git https://gitlab.com/vsementsov/qemu.git block NFS --=20 2.56.0 From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465281; cv=none; d=zohomail.com; s=zohoarc; b=AEi4E0TfCnD1jiEboPAVXxHDGNfpYZIF0P552nC8j1CfNcMOpU5klsBE1xlD0gP1m585/P8HQDtKDyUnvuhfRc9Io2M9ZHaZBxOJpkmv2ol8qnYGcEcTf8HFobQVmIMqF7QomgcDgBvAgmj82bq3Hw8kuc92uqCOs0hEiFVV50k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465281; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DQUmTSuwib8xTZpBZ64RshGyPLSR/jxLkuINs9C+TzY=; b=XfgjKUdId1WaoNbKt4NYpud911UCeyVYml/UUfUfhms1n8P4cfX5DaoqZ2ibiJr6/ar/ilEuyInAjD+3QIMpajSMM917/8wTszWHZ0+uzlY5aWXDN808Lg90I9SHmFVw81o9lWcXsD0eaojYZVLfHSXlcBbEZNflH/mH/SeG2HQ= 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 1791465281212491.1039624880623; Thu, 8 Oct 2026 06:14:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnvP-0002fm-S5; Thu, 08 Oct 2026 09:12:43 -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 1xEnvM-0002ed-Cf for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:12:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnvJ-0002OY-Nc for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:12:39 -0400 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-Zt004lkCM4mtDIZCup2uyQ-1; Thu, 8 Oct 2026 13:12:32 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 221D91944ABF; Thu, 8 Oct 2026 13:12:31 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A1CB630000E8; Thu, 8 Oct 2026 13:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DQUmTSuwib8xTZpBZ64RshGyPLSR/jxLkuINs9C+TzY=; b=HQPKThmkiS8tADFIfw0dJqiJm6uDAvzVIpejfTRQioCRb4hfcvyp5GtsHOpY6+L+EHOOnY jAkS3HboUAhtWaqE5xdGjq5yy/orCzGyuqErAK1abI0XGhAz66FYfSCfpUuK1eqDgv31u0 M8mnHDephg6tndd0ryAYzHtmZRgppfk= X-MC-Unique: Zt004lkCM4mtDIZCup2uyQ-1 X-Mimecast-MFC-AGG-ID: Zt004lkCM4mtDIZCup2uyQ_1791465151 From: Eric Blake To: qemu-devel@nongnu.org Cc: Vladimir Sementsov-Ogievskiy , Pierrick Bouvier , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org (open list:Network Block Dev...) Subject: [PULL 02/15] qemu-nbd: Support -s and -l at the same time Date: Thu, 8 Oct 2026 08:11:41 -0500 Message-ID: <20261008131216.2437896-19-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.133.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 10 X-Spam_score: 1.0 X-Spam_bar: + X-Spam_report: (1.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1791465282681158500 Content-Type: text/plain; charset="utf-8" qemu-nbd already has the ability to wrap a read-write layer on top of the export of a read-only image (-s) and the ability to export an internal snapshot rather than the main image in a qcow2 file (-l SNAPID). But it gave a confusing error message when trying to mix the two, because the snapshot overlay created first no longer has access to the internal snapshots of the image being wrapped. WIth a bit of finesse, this useful scenario is now supported. https://gitlab.com/qemu-project/qemu/-/work_items/159 Signed-off-by: Eric Blake Message-ID: <20260408021636.794794-2-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy [eblake: improve test with Vladimir's suggestions] Signed-off-by: Eric Blake --- docs/tools/qemu-nbd.rst | 7 +- qemu-nbd.c | 20 ++++- tests/qemu-iotests/tests/qemu-nbd-snapshots | 81 +++++++++++++++++++ .../qemu-iotests/tests/qemu-nbd-snapshots.out | 39 +++++++++ 4 files changed, 141 insertions(+), 6 deletions(-) create mode 100755 tests/qemu-iotests/tests/qemu-nbd-snapshots create mode 100644 tests/qemu-iotests/tests/qemu-nbd-snapshots.out diff --git a/docs/tools/qemu-nbd.rst b/docs/tools/qemu-nbd.rst index f82ea5fd77b..336b4aa46e7 100644 --- a/docs/tools/qemu-nbd.rst +++ b/docs/tools/qemu-nbd.rst @@ -95,9 +95,10 @@ driver options if :option:`--image-opts` is specified. .. option:: -l, --load-snapshot=3DSNAPSHOT_PARAM - Load an internal snapshot inside *filename* and export it - as an read-only device, SNAPSHOT_PARAM format is - ``snapshot.id=3D[ID],snapshot.name=3D[NAME]`` or ``[ID_OR_NAME]`` + Load an internal snapshot inside *filename* and export it. + SNAPSHOT_PARAM format is ``snapshot.id=3D[ID],snapshot.name=3D[NAME]`` + or ``[ID_OR_NAME]``. The export is read-only unless ``-s`` is also + in use. .. option:: --cache=3DCACHE diff --git a/qemu-nbd.c b/qemu-nbd.c index ed5895861bb..128486a0ec2 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -534,6 +534,7 @@ int main(int argc, char **argv) { BlockBackend *blk; BlockDriverState *bs; + BlockDriverState *orig_bs; uint64_t dev_offset =3D 0; bool readonly =3D false; bool disconnect =3D false; @@ -716,7 +717,7 @@ int main(int argc, char **argv) } else { sn_id_or_name =3D optarg; } - /* fall through */ + break; case 'r': readonly =3D true; flags &=3D ~BDRV_O_RDWR; @@ -1110,6 +1111,15 @@ int main(int argc, char **argv) bdrv_init(); atexit(qemu_nbd_shutdown); + /* + * -s and -l can be used together to create read-write wrapper + * around an internal snapshot. Otherwise, -l in isolation implies + * read-only. + */ + if ((sn_opts || sn_id_or_name) && (flags & BDRV_O_SNAPSHOT) =3D=3D 0) { + readonly =3D true; + flags &=3D ~BDRV_O_RDWR; + } opts.srcpath =3D argv[optind]; if (imageOpts) { QemuOpts *o; @@ -1155,13 +1165,17 @@ int main(int argc, char **argv) blk_set_enable_write_cache(blk, !writethrough); + orig_bs =3D bs; + if (flags & BDRV_O_SNAPSHOT) { + orig_bs =3D bs->backing->bs; + } if (sn_opts) { - ret =3D bdrv_snapshot_load_tmp(bs, + ret =3D bdrv_snapshot_load_tmp(orig_bs, qemu_opt_get(sn_opts, SNAPSHOT_OPT_ID= ), qemu_opt_get(sn_opts, SNAPSHOT_OPT_NA= ME), &local_err); } else if (sn_id_or_name) { - ret =3D bdrv_snapshot_load_tmp_by_id_or_name(bs, sn_id_or_name, + ret =3D bdrv_snapshot_load_tmp_by_id_or_name(orig_bs, sn_id_or_nam= e, &local_err); } if (ret < 0) { diff --git a/tests/qemu-iotests/tests/qemu-nbd-snapshots b/tests/qemu-iotes= ts/tests/qemu-nbd-snapshots new file mode 100755 index 00000000000..ce62e97877b --- /dev/null +++ b/tests/qemu-iotests/tests/qemu-nbd-snapshots @@ -0,0 +1,81 @@ +#!/usr/bin/env bash +# group: rw quick +# +# Test qemu-nbd snapshot handling +# +# Copyright (C) Red Hat, Inc. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +seq=3D"$(basename $0)" +echo "QA output created by $seq" + +status=3D1 # failure is the default! + +_cleanup() +{ + _cleanup_test_img + nbd_server_stop +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +cd .. +. ./common.rc +. ./common.filter +. ./common.nbd + +_supported_fmt qcow2 +_supported_proto file +_supported_os Linux +_require_command QEMU_NBD + +echo +echo "=3D=3D=3D Initial image setup =3D=3D=3D" +echo + +# Create qcow2 image with one internal snapshot +_make_test_img 10M +$QEMU_IO -c 'w -P 1 3M 1M' -f $IMGFMT "$TEST_IMG" | _filter_qemu_io +$QEMU_IMG snapshot -c snap -f $IMGFMT "$TEST_IMG" | _filter_qemu_img +$QEMU_IO -c 'w -P 2 3M 1M' -f $IMGFMT "$TEST_IMG" | _filter_qemu_io + +echo +echo "=3D=3D=3D Main image in snapshot mode =3D=3D=3D" +echo + +nbd_server_start_unix_socket -s -f qcow2 "$TEST_IMG" +$QEMU_IO -c 'r -P 2 3M 1M' -c 'w -P 3 3M 1M' -c 'r -P 3 3M 1M' -f raw \ + nbd:unix:$nbd_unix_socket | _filter_qemu_io +nbd_server_stop + +echo +echo "=3D=3D=3D Read-only snapshot access =3D=3D=3D" +echo + +nbd_server_start_unix_socket -l snap -f qcow2 "$TEST_IMG" +$QEMU_IO -r -c 'r -P 1 3M 1M' -f raw \ + nbd:unix:$nbd_unix_socket | _filter_qemu_io +$QEMU_IO -c 'r -P 1 3M 1M' -f raw \ + nbd:unix:$nbd_unix_socket 2>&1 | _filter_qemu_io | _filter_testdir +nbd_server_stop + +echo +echo "=3D=3D=3D Combine -s and -l for read-write internal snapshot access = =3D=3D=3D" +echo + +nbd_server_start_unix_socket -s -l snap -f qcow2 "$TEST_IMG" +$QEMU_IO -c 'r -P 1 3M 1M' -c 'w -P 3 3M 1M' -c 'r -P 3 3M 1M' -f raw \ + nbd:unix:$nbd_unix_socket | _filter_qemu_io +nbd_server_stop + +echo +echo "=3D=3D=3D Check that original image is unchanged =3D=3D=3D" +echo + +$QEMU_IO -c 'r -P 2 3M 1M' -f $IMGFMT "$TEST_IMG" | _filter_qemu_io + +# success, all done +echo '*** done' +rm -f $seq.full +status=3D0 diff --git a/tests/qemu-iotests/tests/qemu-nbd-snapshots.out b/tests/qemu-i= otests/tests/qemu-nbd-snapshots.out new file mode 100644 index 00000000000..47289c30f1d --- /dev/null +++ b/tests/qemu-iotests/tests/qemu-nbd-snapshots.out @@ -0,0 +1,39 @@ +QA output created by qemu-nbd-snapshots + +=3D=3D=3D Initial image setup =3D=3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D10485760 +wrote 1048576/1048576 bytes at offset 3145728 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 1048576/1048576 bytes at offset 3145728 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D Main image in snapshot mode =3D=3D=3D + +read 1048576/1048576 bytes at offset 3145728 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 1048576/1048576 bytes at offset 3145728 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 1048576/1048576 bytes at offset 3145728 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D Read-only snapshot access =3D=3D=3D + +read 1048576/1048576 bytes at offset 3145728 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +qemu-io: can't open device nbd:unix:SOCK_DIR/qemu-nbd.sock: Could not open= image: Permission denied + +=3D=3D=3D Combine -s and -l for read-write internal snapshot access =3D=3D= =3D + +read 1048576/1048576 bytes at offset 3145728 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 1048576/1048576 bytes at offset 3145728 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 1048576/1048576 bytes at offset 3145728 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D Check that original image is unchanged =3D=3D=3D + +read 1048576/1048576 bytes at offset 3145728 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +*** done --=20 2.56.0 From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465194; cv=none; d=zohomail.com; s=zohoarc; b=J2nt5OI8aeKkbI0fWH+uKzVe44722DnKRC5ZYr8Eb0F9TYRc+6hiiWQMAPoUS8kL36T7Qe7BkDzwiH9cEO9rKBo8udXsNMkV9a81KlWR1ndgswO7dX2tiIA5zfkVcYe1GdPqdnOHAKRk3McpmmSv+Jil8ZyqBRsA4DxbwwMXppI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465194; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=s4pnkdq8uFn8PDlHCFA+JC4qDnFiswXUp1gwT6kKPzs=; b=iv6HtSkypDCRLSUSMb1jn4+DLIpZ83Wqt6tPRYzQuwelybE5eEk1BLYUkKUsG3cmBp9g0rTj3upcSo/kMra/HuGnF15SuhIIVSMPsh3ifeipm9do+w2lyznuesOOmiPh6WvR2AvoRQdTK8w1wodFMUKb0ftCET/Z3ga6Jbjeaiw= 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 1791465194349601.0152830030161; Thu, 8 Oct 2026 06:13:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnvS-0002hH-Ig; Thu, 08 Oct 2026 09:12:46 -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 1xEnvO-0002fB-Qc for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:12:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnvM-0002Ot-7b for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:12:42 -0400 Received: from mx-prod-mc-01.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-687-swzz7rytPo-n8s4RFhV01g-1; Thu, 08 Oct 2026 09:12:35 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7BA40195F154; Thu, 8 Oct 2026 13:12:33 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AAFAF30001BB; Thu, 8 Oct 2026 13:12:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s4pnkdq8uFn8PDlHCFA+JC4qDnFiswXUp1gwT6kKPzs=; b=Q+PWWuthui/Srrqipnbn3IaRSuHyNuGgsKCthw1hjOZ265v8Q81OIJb+vI1jS8lU6uwlEg 7iDtPxhK6Dyy6WMgDGVgV+CZgq26uDhOQLHe4cJWwuco1VqQhgLDgFrjRVPvOw2+/J96Bm SrN5BVO0jhsVBIwj3FS2CQ31O1XD/Ag= X-MC-Unique: swzz7rytPo-n8s4RFhV01g-1 X-Mimecast-MFC-AGG-ID: swzz7rytPo-n8s4RFhV01g_1791465153 From: Eric Blake To: qemu-devel@nongnu.org Cc: Fiona Ebner , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org (open list:Block layer core) Subject: [PULL 03/15] iotests: add test cases for failing flush after qemu-img convert Date: Thu, 8 Oct 2026 08:11:42 -0500 Message-ID: <20261008131216.2437896-20-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.129.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 10 X-Spam_score: 1.0 X-Spam_bar: + X-Spam_report: (1.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1791465197339158500 Content-Type: text/plain; charset="utf-8" From: Fiona Ebner In preparation to add more checks in the following commits and show how the behavior changes. Signed-off-by: Fiona Ebner Message-ID: <20260930132140.2342574-2-f.ebner@proxmox.com> Reviewed-by: Eric Blake Signed-off-by: Eric Blake --- tests/qemu-iotests/122 | 33 +++++++++++++++++++++++++++++++++ tests/qemu-iotests/122.out | 14 ++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122 index be0f6b79e5d..488649f1bd0 100755 --- a/tests/qemu-iotests/122 +++ b/tests/qemu-iotests/122 @@ -334,6 +334,39 @@ echo $QEMU_IMG convert -O $IMGFMT -o preallocation=3Dmetadata -n \ "$TEST_IMG" "$TEST_IMG".orig && echo "unexpected success" +echo +echo "=3D=3D=3D failing flush after convert with default ('unsafe') cache = mode =3D=3D=3D" +echo + +TEST_IMG=3D"$TEST_IMG".orig _make_test_img 1M +TEST_IMG=3D"$TEST_IMG" _make_test_img 1M + +$QEMU_IO -c "write -P 42 0 1M" "$TEST_IMG".orig | _filter_qemu_io + +target_fails_flush=3D"json:{ + 'driver': '$IMGFMT', + 'file': { + 'driver': 'blkdebug', + 'inject-error': [{ + 'event': 'flush_to_disk' + }], + 'image': { + 'driver': 'file', + 'filename': '$TEST_IMG' + } + } +}" + +$QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG".orig "$target_fails= _flush" +echo "qemu-img convert exited with status $?" + +echo +echo "=3D=3D=3D failing flush after convert with 'writeback' cache mode = =3D=3D=3D" +echo + +$QEMU_IMG convert -t writeback -f $IMGFMT -O $IMGFMT -n "$TEST_IMG".orig "= $target_fails_flush" +echo "qemu-img convert exited with status $?" + # success, all done echo '*** done' rm -f $seq.full diff --git a/tests/qemu-iotests/122.out b/tests/qemu-iotests/122.out index 6a1aa3fe2b9..f3e28f33bc2 100644 --- a/tests/qemu-iotests/122.out +++ b/tests/qemu-iotests/122.out @@ -256,4 +256,18 @@ Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=3DIMGFMT size= =3D67108864 =3D=3D=3D -n incompatible with -o =3D=3D=3D qemu-img: -o has no effect when skipping image creation + +=3D=3D=3D failing flush after convert with default ('unsafe') cache mode = =3D=3D=3D + +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=3DIMGFMT size=3D1048576 +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 +wrote 1048576/1048576 bytes at offset 0 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +qemu-img convert exited with status 0 + +=3D=3D=3D failing flush after convert with 'writeback' cache mode =3D=3D= =3D + +qemu-img: Failed to flush the L2 table cache: Input/output error +qemu-img: Failed to flush the refcount block cache: Input/output error +qemu-img convert exited with status 0 *** done --=20 2.56.0 From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465212; cv=none; d=zohomail.com; s=zohoarc; b=eNj0WvPUtAVEEICZAQJ3eLAvpPM23Ui1uc8GaIaKRaNRXsVK44PQR9PVXuZW6pQNq205LbgcbFTTOM227/+re4pdSyaz4AntTFFx9QYcKIexHj4rfggjndBg0KqqgzR89YPi4vChrbVfhTnQadcTMAI4lB5f1jWbAV4DeHyK7xk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465212; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XGRspb47ScP0bvVDjOdo4xAQdc4GTRCV2CVIMXPdt3M=; b=i5pz3O5ZyxVqy8d7egCkm+sD5+XuH/PBLnwJpNOEJo3ryaJPSWGBecPo5q22ukHTQCpM4990Xd/Yx7UDez13iSMOJQt3cgZMHqej8xbIN8uRiGg09Z83ze4DA5+rYBzgE9Wy/2zTmkgeaYidvFqYFcssgS4LUL4iPXy8tMc7hW8= 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 1791465212186812.6119057173216; Thu, 8 Oct 2026 06:13:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnvR-0002h1-Ho; Thu, 08 Oct 2026 09:12:45 -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 1xEnvP-0002fk-JH for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:12:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnvN-0002P5-EM for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:12:43 -0400 Received: from mx-prod-mc-05.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-354-SQ6bJOp1MD2ibQzZOymXSA-1; Thu, 08 Oct 2026 09:12:38 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 822B31944D2B; Thu, 8 Oct 2026 13:12:37 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E821D30001BB; Thu, 8 Oct 2026 13:12:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XGRspb47ScP0bvVDjOdo4xAQdc4GTRCV2CVIMXPdt3M=; b=HYw3XggqLfUOf0OaEcALPgWywMXEd4mNzavT+FaVeEzq3b//+UCuizps37q/dPCt8QvMQO VsMNvgMtU7a6tEBk5SS6giQ3c8dUQHkZzdqozKdIR3tvfc9qBf7FOmrOPYHr93csPQvvXn X2kj+kHcVU4YqATBuzGBZQkja8zVbvQ= X-MC-Unique: SQ6bJOp1MD2ibQzZOymXSA-1 X-Mimecast-MFC-AGG-ID: SQ6bJOp1MD2ibQzZOymXSA_1791465157 From: Eric Blake To: qemu-devel@nongnu.org Cc: Fiona Ebner , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org (open list:Block layer core) Subject: [PULL 04/15] iotests.py: add filter_qemu() Date: Thu, 8 Oct 2026 08:11:43 -0500 Message-ID: <20261008131216.2437896-21-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.133.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 10 X-Spam_score: 1.0 X-Spam_bar: + X-Spam_report: (1.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1791465213455158500 Content-Type: text/plain; charset="utf-8" From: Fiona Ebner Add a filter_qemu() helper function for replacing the QEMU program name with 'QEMU_PROG' in test's log messages. Signed-off-by: Fiona Ebner Message-ID: <20260930132140.2342574-3-f.ebner@proxmox.com> Reviewed-by: Eric Blake Signed-off-by: Eric Blake --- tests/qemu-iotests/iotests.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 7d5a77a85e5..642a160bb28 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -596,6 +596,10 @@ def filter_qemu_io(msg): return qemu_io_re.sub("X ops; XX:XX:XX.X " "(XXX YYY/sec and XXX ops/sec)", msg) +qemu_re =3D re.compile(r"%s" % os.path.basename(qemu_prog)) +def filter_qemu(msg): + return qemu_re.sub("QEMU_PROG", msg) + chown_re =3D re.compile(r"chown [0-9]+:[0-9]+") def filter_chown(msg): return chown_re.sub("chown UID:GID", msg) --=20 2.56.0 From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465236; cv=none; d=zohomail.com; s=zohoarc; b=L6oDoc9i4ahmvy67Qi3K/rywVq0fSCdVuIFZLk90kZTa+eBL0OaXWJ9gXKoGgusRW+U6d27BYYYhTymw/4ty8LzVUxOoAwYNAehmJkLgnQpkBQnp1YsVJJApsYbg2HsTKvyXWp8EKiwMA2qGVEkKOKxHsTuJmWpN+gKLYwya2BM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465236; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=P4Mw8VjSbZuEI+0L/GJMBMQHuhWM969NgdNmzsTmg30=; b=EBLSbCgIMqks60JlnL8x3ZXdcO/TF54aC2kO4D0E2EsIaR8ml2fpmixFRyTsyu+UEz1I8XRRycZKWOncI8KOziRcDNWl0h87m0uLbOYvZQbeI73Pe3At3devcsF+sNIIUvR2UEMZWEFsiucNk6Z+FDdIdUaAJzL28Ax+rDwGdu8= 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 1791465236670205.21434289575438; Thu, 8 Oct 2026 06:13:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnvd-0002iU-Sy; Thu, 08 Oct 2026 09:12: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 1xEnvc-0002hv-0Z for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:12:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnvX-0002Qz-LQ for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:12:55 -0400 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-439-Qpqnfu27OIK2pxjYZT8neQ-1; Thu, 08 Oct 2026 09:12:48 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 667301977305; Thu, 8 Oct 2026 13:12:47 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A4D7830001BB; Thu, 8 Oct 2026 13:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P4Mw8VjSbZuEI+0L/GJMBMQHuhWM969NgdNmzsTmg30=; b=AC2JnvyPez9JF4TI2jr/85/WIaau9iQrtleIASAFlfZZl5+IQUf3WFstDVBcFS/D9Y2FDF to9Ut2IkLYlATdevq3YxBpd+6tphNJ4eTXQaMFj9upBCo0Y7EfsrxBe1Q4XCPLkbJaX5h2 H9dH51CusOcJxN2OZfSFFDVMDIFECus= X-MC-Unique: Qpqnfu27OIK2pxjYZT8neQ-1 X-Mimecast-MFC-AGG-ID: Qpqnfu27OIK2pxjYZT8neQ_1791465167 From: Eric Blake To: qemu-devel@nongnu.org Cc: Fiona Ebner , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org (open list:Block layer core) Subject: [PULL 05/15] block: report flush error during bdrv_close() Date: Thu, 8 Oct 2026 08:11:44 -0500 Message-ID: <20261008131216.2437896-22-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.129.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 10 X-Spam_score: 1.0 X-Spam_bar: + X-Spam_report: (1.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1791465237822158500 Content-Type: text/plain; charset="utf-8" From: Fiona Ebner Flush during bdrv_close() was introduced back in 2012 in commit 80ccf93b88 ("qemu-img: let 'qemu-img convert' flush data"). However, a failing flush was quietly ignored [0]. Report the error instead, since this could mean that the image contents are not as expected. Adapt the iotests accordingly. For all tests except '080' and 'qsd-migrate' the failures come from blkdebug configurations. For '080', the failures are also directly expected, because of invalid L1 table size and offset. For the 'qsd-migrate' test, the error happens, because the QSD node which is attached via NBD to the source VM was inactivated. [0]: Note that the errors reported for qcow2 come from qcow2_inactivate() which is only called as part of bs->drv->bdrv_close() after bdrv_flush(). In particular, adding > 'once': 'on' to the blkdebug driver in the relevant test case in the 122 iotest shows that the failure can be silent in case of qcow2 too. Signed-off-by: Fiona Ebner Message-ID: <20260930132140.2342574-4-f.ebner@proxmox.com> Reviewed-by: Eric Blake Signed-off-by: Eric Blake --- block.c | 13 +++- tests/qemu-iotests/026 | 10 +-- tests/qemu-iotests/026.out | 84 ++++++++++++++++++++++ tests/qemu-iotests/071 | 2 +- tests/qemu-iotests/071.out | 2 + tests/qemu-iotests/080.out | 2 + tests/qemu-iotests/098.out | 4 ++ tests/qemu-iotests/122 | 8 +-- tests/qemu-iotests/122.out | 2 + tests/qemu-iotests/244 | 2 +- tests/qemu-iotests/244.out | 1 + tests/qemu-iotests/tests/file-io-error | 2 +- tests/qemu-iotests/tests/file-io-error.out | 2 + tests/qemu-iotests/tests/qsd-migrate | 5 +- tests/qemu-iotests/tests/qsd-migrate.out | 1 + 15 files changed, 125 insertions(+), 15 deletions(-) diff --git a/block.c b/block.c index f0a6042e616..c05ad01f25c 100644 --- a/block.c +++ b/block.c @@ -5162,12 +5162,23 @@ static void GRAPH_UNLOCKED bdrv_close(BlockDriverSt= ate *bs) { BdrvAioNotifier *ban, *ban_next; BdrvChild *child, *next; + int ret; GLOBAL_STATE_CODE(); assert(!bs->refcnt); bdrv_drained_begin(bs); /* complete I/O */ - bdrv_flush(bs); + ret =3D bdrv_flush(bs); + if (ret < 0) { + const char *name; + if (bs->filename[0]) { + name =3D bs->filename; + } else { + name =3D bdrv_get_node_name(bs); + } + error_report("Failed flush for '%s' during close: %s", name, + strerror(-ret)); + } bdrv_drain(bs); /* in case flush left pending I/O */ if (bs->drv) { diff --git a/tests/qemu-iotests/026 b/tests/qemu-iotests/026 index d37e266dade..88cb4dd934e 100755 --- a/tests/qemu-iotests/026 +++ b/tests/qemu-iotests/026 @@ -103,13 +103,13 @@ if [ "$event" =3D=3D "l2_update" ]; then $QEMU_IO -c "write $vmstate 0 512" "$TEST_IMG" > /dev/null 2>&1 fi -$QEMU_IO -c "write $vmstate 0 128k " "$BLKDBG_TEST_IMG" | _filter_qemu_io +$QEMU_IO -c "write $vmstate 0 128k " "$BLKDBG_TEST_IMG" 2>&1 | _filter_qem= u_io | _filter_testdir # l2_load is not called on allocation, so issue a second write # Reads are another path to trigger l2_load, so do a read, too if [ "$event" =3D=3D "l2_load" ]; then - $QEMU_IO -c "write $vmstate 0 128k " "$BLKDBG_TEST_IMG" | _filter_qemu= _io - $QEMU_IO -c "read $vmstate 0 128k " "$BLKDBG_TEST_IMG" | _filter_qemu_= io + $QEMU_IO -c "write $vmstate 0 128k " "$BLKDBG_TEST_IMG" 2>&1 | _filter= _qemu_io | _filter_testdir + $QEMU_IO -c "read $vmstate 0 128k " "$BLKDBG_TEST_IMG" 2>&1 | _filter_= qemu_io | _filter_testdir fi _check_test_img_ignore_leaks 2>&1 | grep -v "refcount=3D1 reference=3D0" @@ -155,7 +155,7 @@ _make_test_img 1G echo echo "Event: $event; errno: $errno; imm: $imm; once: $once; write $vmstate" -$QEMU_IO -c "write $vmstate 0 64M" "$BLKDBG_TEST_IMG" | _filter_qemu_io +$QEMU_IO -c "write $vmstate 0 64M" "$BLKDBG_TEST_IMG" 2>&1 | _filter_qemu_= io | _filter_testdir _check_test_img_ignore_leaks 2>&1 | grep -v "refcount=3D1 reference=3D0" @@ -194,7 +194,7 @@ _make_test_img 1G echo echo "Event: $event; errno: $errno; imm: $imm; once: $once" -$QEMU_IO -c "write -b 0 64k" "$BLKDBG_TEST_IMG" | _filter_qemu_io +$QEMU_IO -c "write -b 0 64k" "$BLKDBG_TEST_IMG" 2>&1 | _filter_qemu_io | _= filter_testdir _check_test_img_ignore_leaks 2>&1 | grep -v "refcount=3D1 reference=3D0" diff --git a/tests/qemu-iotests/026.out b/tests/qemu-iotests/026.out index b998a9ac83d..47bd88b1d3c 100644 --- a/tests/qemu-iotests/026.out +++ b/tests/qemu-iotests/026.out @@ -15,15 +15,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D107= 3741824 Event: l1_update; errno: 5; imm: off; once: off; write qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: l1_update; errno: 5; imm: off; once: off; write -b qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -39,15 +43,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D107= 3741824 Event: l1_update; errno: 28; imm: off; once: off; write qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: l1_update; errno: 28; imm: off; once: off; write -b qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -127,15 +135,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: l2_update; errno: 5; imm: off; once: off; write qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: l2_update; errno: 5; imm: off; once: off; write -b qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -151,15 +163,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: l2_update; errno: 28; imm: off; once: off; write qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: l2_update; errno: 28; imm: off; once: off; write -b qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -175,15 +191,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: l2_alloc_write; errno: 5; imm: off; once: off; write qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: l2_alloc_write; errno: 5; imm: off; once: off; write -b qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -199,15 +219,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: l2_alloc_write; errno: 28; imm: off; once: off; write qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: l2_alloc_write; errno: 28; imm: off; once: off; write -b qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -223,15 +247,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: write_aio; errno: 5; imm: off; once: off; write qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: write_aio; errno: 5; imm: off; once: off; write -b qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -247,15 +275,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: write_aio; errno: 28; imm: off; once: off; write qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: write_aio; errno: 28; imm: off; once: off; write -b qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -271,15 +303,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: refblock_load; errno: 5; imm: off; once: off; write qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: refblock_load; errno: 5; imm: off; once: off; write -b qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -295,15 +331,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: refblock_load; errno: 28; imm: off; once: off; write qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: refblock_load; errno: 28; imm: off; once: off; write -b qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -319,15 +359,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: refblock_update_part; errno: 5; imm: off; once: off; write qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: refblock_update_part; errno: 5; imm: off; once: off; write -b qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -343,15 +387,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: refblock_update_part; errno: 28; imm: off; once: off; write qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: refblock_update_part; errno: 28; imm: off; once: off; write -b qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -367,15 +415,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: refblock_alloc; errno: 5; imm: off; once: off; write qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: refblock_alloc; errno: 5; imm: off; once: off; write -b qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -391,15 +443,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: refblock_alloc; errno: 28; imm: off; once: off; write qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: refblock_alloc; errno: 28; imm: off; once: off; write -b qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -458,15 +514,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: refblock_alloc_hookup; errno: 28; imm: off; once: off; write qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: refblock_alloc_hookup; errno: 28; imm: off; once: off; write -b qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -482,15 +542,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: refblock_alloc_write; errno: 28; imm: off; once: off; write qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: refblock_alloc_write; errno: 28; imm: off; once: off; write -b qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -506,15 +570,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: refblock_alloc_write_blocks; errno: 28; imm: off; once: off; write qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: refblock_alloc_write_blocks; errno: 28; imm: off; once: off; write = -b qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -530,15 +598,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: refblock_alloc_write_table; errno: 28; imm: off; once: off; write qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: refblock_alloc_write_table; errno: 28; imm: off; once: off; write -b qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -554,15 +626,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 073741824 Event: refblock_alloc_switch_table; errno: 28; imm: off; once: off; write qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 Event: refblock_alloc_switch_table; errno: 28; imm: off; once: off; write = -b qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. =3D=3D=3D L1 growth tests =3D=3D=3D @@ -596,8 +672,10 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D10= 73741824 Event: l1_grow_write_table; errno: 5; imm: off; once: off qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -608,8 +686,10 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D10= 73741824 Event: l1_grow_write_table; errno: 28; imm: off; once: off qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -620,8 +700,10 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D10= 73741824 Event: l1_grow_activate_table; errno: 5; imm: off; once: off qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 @@ -632,8 +714,10 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D10= 73741824 Event: l1_grow_activate_table; errno: 28; imm: off; once: off qemu-io: write failed: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device +qemu-io: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.qcow= 2' during close: No space left on device No errors were found on the image. =3D=3D=3D Avoid cluster leaks after temporary failure =3D=3D=3D diff --git a/tests/qemu-iotests/071 b/tests/qemu-iotests/071 index 83c4ce6314c..8237b325ea5 100755 --- a/tests/qemu-iotests/071 +++ b/tests/qemu-iotests/071 @@ -54,7 +54,7 @@ do_run_qemu() run_qemu() { - do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_qmp |= _filter_qemu_io + do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_qmp |= _filter_qemu_io | _filter_json_filename } IMG_SIZE=3D64M diff --git a/tests/qemu-iotests/071.out b/tests/qemu-iotests/071.out index f2d015d8cca..a69e6f7e501 100644 --- a/tests/qemu-iotests/071.out +++ b/tests/qemu-iotests/071.out @@ -83,8 +83,10 @@ wrote 512/512 bytes at offset 0 {"return": ""} {"return": "Error: read failed: Input/output error\r\n"} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} +QEMU_PROG: Failed flush for 'json:{ /* filtered */ }' during close: Input/= output error QEMU_PROG: Failed to flush the L2 table cache: Input/output error QEMU_PROG: Failed to flush the refcount block cache: Input/output error +QEMU_PROG: Failed flush for 'json:{ /* filtered */ }' during close: Input/= output error {"return": {}} *** done diff --git a/tests/qemu-iotests/080.out b/tests/qemu-iotests/080.out index b20c21faf6a..3b2b27c5fec 100644 --- a/tests/qemu-iotests/080.out +++ b/tests/qemu-iotests/080.out @@ -67,6 +67,7 @@ qemu-img: Failed to load snapshot: Snapshot L1 table offs= et invalid qemu-img: Snapshot L1 table offset invalid qemu-img: Failed to turn zero into data clusters: Invalid argument qemu-io: write failed: Invalid argument +qemu-io: Failed flush for 'TEST_DIR/t.qcow2' during close: Invalid argument qemu-io: Failed to flush the refcount block cache: Invalid argument qemu-img: Snapshot L1 table offset invalid qemu-img: Could not apply snapshot 'test': Failed to load snapshot: Invali= d argument @@ -90,6 +91,7 @@ qemu-img: Failed to load snapshot: Snapshot L1 table too = large qemu-img: Snapshot L1 table too large qemu-img: Failed to turn zero into data clusters: File too large qemu-io: write failed: File too large +qemu-io: Failed flush for 'TEST_DIR/t.qcow2' during close: File too large qemu-io: Failed to flush the refcount block cache: File too large qemu-img: Snapshot L1 table too large qemu-img: Could not apply snapshot 'test': Failed to load snapshot: File t= oo large diff --git a/tests/qemu-iotests/098.out b/tests/qemu-iotests/098.out index 6c73dd0977f..912b0290af0 100644 --- a/tests/qemu-iotests/098.out +++ b/tests/qemu-iotests/098.out @@ -6,6 +6,7 @@ Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D67= 108864 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 backing_file= =3DTEST_DIR/t.IMGFMT.base backing_fmt=3DIMGFMT wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +qemu-img: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMG= FMT' during close: Input/output error qemu-img: Failed to empty blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFM= T: Input/output error No errors were found on the image. @@ -15,6 +16,7 @@ Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D= 67108864 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 backing_file= =3DTEST_DIR/t.IMGFMT.base backing_fmt=3DIMGFMT wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +qemu-img: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMG= FMT' during close: Input/output error qemu-img: Failed to empty blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFM= T: Input/output error Leaked cluster 4 refcount=3D1 reference=3D0 Leaked cluster 5 refcount=3D1 reference=3D0 @@ -28,6 +30,7 @@ Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D= 67108864 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 backing_file= =3DTEST_DIR/t.IMGFMT.base backing_fmt=3DIMGFMT wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +qemu-img: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMG= FMT' during close: Input/output error qemu-img: Failed to empty blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFM= T: Input/output error ERROR cluster 0 refcount=3D0 reference=3D1 ERROR cluster 1 refcount=3D0 reference=3D1 @@ -42,6 +45,7 @@ Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D= 67108864 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 backing_file= =3DTEST_DIR/t.IMGFMT.base backing_fmt=3DIMGFMT wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +qemu-img: Failed flush for 'blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMG= FMT' during close: Input/output error qemu-img: Failed to empty blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFM= T: Input/output error ERROR cluster 0 refcount=3D0 reference=3D1 ERROR cluster 1 refcount=3D0 reference=3D1 diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122 index 488649f1bd0..9da1246f097 100755 --- a/tests/qemu-iotests/122 +++ b/tests/qemu-iotests/122 @@ -357,15 +357,15 @@ target_fails_flush=3D"json:{ } }" -$QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG".orig "$target_fails= _flush" -echo "qemu-img convert exited with status $?" +$QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG".orig "$target_fails= _flush" 2>&1 | _filter_json_filename +echo "qemu-img convert exited with status ${PIPESTATUS[0]}" echo echo "=3D=3D=3D failing flush after convert with 'writeback' cache mode = =3D=3D=3D" echo -$QEMU_IMG convert -t writeback -f $IMGFMT -O $IMGFMT -n "$TEST_IMG".orig "= $target_fails_flush" -echo "qemu-img convert exited with status $?" +$QEMU_IMG convert -t writeback -f $IMGFMT -O $IMGFMT -n "$TEST_IMG".orig "= $target_fails_flush" 2>&1 | _filter_json_filename +echo "qemu-img convert exited with status ${PIPESTATUS[0]}" # success, all done echo '*** done' diff --git a/tests/qemu-iotests/122.out b/tests/qemu-iotests/122.out index f3e28f33bc2..84283f24343 100644 --- a/tests/qemu-iotests/122.out +++ b/tests/qemu-iotests/122.out @@ -267,7 +267,9 @@ qemu-img convert exited with status 0 =3D=3D=3D failing flush after convert with 'writeback' cache mode =3D=3D= =3D +qemu-img: Failed flush for 'json:{ /* filtered */ }' during close: Input/o= utput error qemu-img: Failed to flush the L2 table cache: Input/output error qemu-img: Failed to flush the refcount block cache: Input/output error +qemu-img: Failed flush for 'json:{ /* filtered */ }' during close: Input/o= utput error qemu-img convert exited with status 0 *** done diff --git a/tests/qemu-iotests/244 b/tests/qemu-iotests/244 index 2a98ad58f5d..ef32f8ec036 100755 --- a/tests/qemu-iotests/244 +++ b/tests/qemu-iotests/244 @@ -264,7 +264,7 @@ $QEMU_IO -c 'write 0 512' -c flush \ } } }" \ - | _filter_qemu_io + 2>&1 | _filter_qemu_io | _filter_generated_node_ids result=3D${PIPESTATUS[0]} echo diff --git a/tests/qemu-iotests/244.out b/tests/qemu-iotests/244.out index c5e62146c93..81463d6f0ec 100644 --- a/tests/qemu-iotests/244.out +++ b/tests/qemu-iotests/244.out @@ -134,6 +134,7 @@ Images are identical. =3D=3D=3D Flushing should flush the data file =3D=3D=3D +qemu-io: Failed flush for 'NODE_NAME' during close: Input/output error wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) diff --git a/tests/qemu-iotests/tests/file-io-error b/tests/qemu-iotests/te= sts/file-io-error index 0d970c102f6..3885b741d99 100755 --- a/tests/qemu-iotests/tests/file-io-error +++ b/tests/qemu-iotests/tests/file-io-error @@ -94,7 +94,7 @@ echo "$output" echo # This should fail, but gracefully, i.e. just print an I/O error, not cras= h. -$QEMU_IO -f file -c 'write 0 64M' "$TEST_DIR/fuse-export" | _filter_qemu_io +$QEMU_IO -f file -c 'write 0 64M' "$TEST_DIR/fuse-export" 2>&1 | _filter_q= emu_io | _filter_testdir echo capture_events=3DBLOCK_EXPORT_DELETED _send_qemu_cmd $QEMU_HANDLE \ diff --git a/tests/qemu-iotests/tests/file-io-error.out b/tests/qemu-iotest= s/tests/file-io-error.out index bf8c0018ba5..748ea3079c0 100644 --- a/tests/qemu-iotests/tests/file-io-error.out +++ b/tests/qemu-iotests/tests/file-io-error.out @@ -22,6 +22,7 @@ QA output created by file-io-error {"return": {}} qemu-io: write failed: Input/output error +qemu-io: Failed flush for 'TEST_DIR/fuse-export' during close: Input/outpu= t error {'execute': 'block-export-del', 'arguments': {'id': 'exp0'}} @@ -29,5 +30,6 @@ qemu-io: write failed: Input/output error {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_EXPORT_DELETED", "data": {"id": "exp0"}} {'execute': 'blockdev-del', 'arguments': {'node-name': 'node0'}} +QEMU_PROG: Failed flush for 'node0' during close: Input/output error {"return": {}} *** done diff --git a/tests/qemu-iotests/tests/qsd-migrate b/tests/qemu-iotests/test= s/qsd-migrate index d76278b576c..73583dec169 100755 --- a/tests/qemu-iotests/tests/qsd-migrate +++ b/tests/qemu-iotests/tests/qsd-migrate @@ -20,7 +20,7 @@ import iotests -from iotests import filter_qemu_io, filter_qtest +from iotests import filter_qemu, filter_qemu_io, filter_qtest iotests.script_initialize(supported_fmts=3D['qcow2', 'qed', 'raw'], supported_protocols=3D['file'], @@ -126,11 +126,12 @@ with iotests.FilePath('disk.img') as path, \ iotests.log('\nDone') + # NOTE: Flush during close fails here, since the QSD node was inactiva= ted. vm_src.shutdown() iotests.log('\n--- vm_src log ---') log =3D vm_src.get_log() if log: - iotests.log(log, [filter_qtest, filter_qemu_io]) + iotests.log(log, [filter_qtest, filter_qemu_io, filter_qemu]) qsd_src.stop() vm_dst.shutdown() diff --git a/tests/qemu-iotests/tests/qsd-migrate.out b/tests/qemu-iotests/= tests/qsd-migrate.out index 4a5241e5d40..894b232b4a4 100644 --- a/tests/qemu-iotests/tests/qsd-migrate.out +++ b/tests/qemu-iotests/tests/qsd-migrate.out @@ -47,6 +47,7 @@ read 4096/4096 bytes at offset 0 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) read 4096/4096 bytes at offset 0 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +QEMU_PROG: Failed flush for 'disk' during close: Operation not permitted --- vm_dst log --- read 4096/4096 bytes at offset 0 --=20 2.56.0 From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465216; cv=none; d=zohomail.com; s=zohoarc; b=eRx6samf7Y3DRzyEob9rCVRomHXg2f1shpVWRD7IW+ztpodB5Wvy9hsmeOvhM6pI86cqB7Dmw2Si469AsqbkGgepDj3r8MAfq5cwDTYI20PCWibrjWki1pD+vqaXVs00iblB4udvUAH2AYpSKIP+vN9AqMbeXYS+SEfEffzRt4o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465216; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7GY8TbHPUA3/mMHQSrnhZXAe64iIwMku44Rplyu2ng4=; b=PaNVig2VH6lnMZSpJvZpo8FHOR59jWy1h7df4WdwozOKt+7OxKVz526HrdNaDRGpwOsSh/ajHt6qof/eHS8E3QR1k5S3z9rBOD8dw/y/JsCK5NTJcrxibbkOqk5kcaU+DKhur640AIdeUuqvTOInZQ8A5tQ5P2YGcZrsHDf3wfk= 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 1791465216559670.7623034721042; Thu, 8 Oct 2026 06:13:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnvg-0002jC-1z; Thu, 08 Oct 2026 09:13:00 -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 1xEnvd-0002i9-E6 for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:12:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnvZ-0002R6-7D for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:12:57 -0400 Received: from mx-prod-mc-05.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-510-VF-i8YthNZWR7dRrwxtXzA-1; Thu, 08 Oct 2026 09:12:51 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1B571193EF6C; Thu, 8 Oct 2026 13:12:50 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1C06B30001BE; Thu, 8 Oct 2026 13:12:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7GY8TbHPUA3/mMHQSrnhZXAe64iIwMku44Rplyu2ng4=; b=cl+npJSs1THbkBTsDDjCDE37Try1qoh+pjkQ4TvgJKZqTXcH5Ag2uqDLH8OJm59dD8oPif te8yG0CVwuzr/NhN1WMTDZhU8wnuO5elJmPNizyy8TzpDKu0sw4s67sicPuGmtO8//uZrT S6VVKMHEup6I0N6PU7KsFIsPrRqX4LE= X-MC-Unique: VF-i8YthNZWR7dRrwxtXzA-1 X-Mimecast-MFC-AGG-ID: VF-i8YthNZWR7dRrwxtXzA_1791465170 From: Eric Blake To: qemu-devel@nongnu.org Cc: Fiona Ebner , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org (open list:Block layer core) Subject: [PULL 06/15] qemu-img: convert: flush target image after copying Date: Thu, 8 Oct 2026 08:11:45 -0500 Message-ID: <20261008131216.2437896-23-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.133.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 10 X-Spam_score: 1.0 X-Spam_bar: + X-Spam_report: (1.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1791465217393158500 Content-Type: text/plain; charset="utf-8" From: Fiona Ebner With 'qemu-img convert', when using a cache mode with 'cache.no-flush =3D off', the expectation is that the data is flushed to the disk, which happens since commit 80ccf93b88 ("qemu-img: let 'qemu-img convert' flush data"). This expectation also encompasses that failure to do so is properly reported, so ensure that 'qemu-img convert' exits with a non-zero status code when the target image cannot be flushed. In particular, the reproducer below [0], based on a report by Ing. Alfonso Kuen Arroyo [1], would result in > rc=3D0 > Content mismatch at offset XYZ! before this change, and in > rc=3D1 > Content mismatch at offset XYZ! after this change. Note that this change does not affect the (default) 'unsafe' cache mode, because bdrv_co_flush() still skips flush to disk for that cache mode. [0]: > #!/bin/bash -x > dd if=3D/dev/urandom of=3Dsrc.raw bs=3D1M count=3D500 > truncate -s 500M dst.img > LOOP=3D$(losetup --find --show dst.img) > SIZE=3D$(blockdev --getsz $LOOP) > dd if=3D/dev/zero of=3D$LOOP bs=3D1M count=3D500 conv=3Dfsync status=3Dno= ne > sync > echo 3 > /proc/sys/vm/drop_caches > dmsetup create flk --table "0 $SIZE flakey $LOOP 0 5 5" > qemu-img convert -t writeback -p -r 100M -f raw -O raw src.raw /dev/mappe= r/flk > echo rc=3D$? > sleep 5 > dmsetup remove flk > qemu-img compare src.raw $LOOP > losetup -d $LOOP > rm src.raw dst.img [1]: https://lore.proxmox.com/pve-devel/178961792132.43804.1717323393529790= 3311@idkmanager.com/ Signed-off-by: Fiona Ebner Message-ID: <20260930132140.2342574-5-f.ebner@proxmox.com> Reviewed-by: Eric Blake Signed-off-by: Eric Blake --- qemu-img.c | 8 +++++++- tests/qemu-iotests/122.out | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 2f63d311413..edf75e43aba 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2245,7 +2245,7 @@ static int img_convert(const img_cmd_t *ccmd, int arg= c, char **argv) Error *local_err =3D NULL; bool writethrough, src_writethrough, image_opts =3D false, skip_create =3D false, progress =3D false, tgt_image_opts =3D fal= se; - int64_t ret =3D -EINVAL; + int64_t ret =3D -EINVAL, ret2; bool force_share =3D false; bool explict_min_sparse =3D false; bool bitmaps =3D false; @@ -2872,6 +2872,12 @@ static int img_convert(const img_cmd_t *ccmd, int ar= gc, char **argv) ret =3D convert_copy_bitmaps(blk_bs(s.src[0]), out_bs, skip_broken= ); } + ret2 =3D blk_flush(s.target); + if (ret2 < 0) { + error_report("Failed to flush target image: %s", strerror(-ret2)); + ret =3D ret !=3D 0 ? ret : ret2; + } + out: if (!ret) { qemu_progress_print(100, 0); diff --git a/tests/qemu-iotests/122.out b/tests/qemu-iotests/122.out index 84283f24343..38794f96ac2 100644 --- a/tests/qemu-iotests/122.out +++ b/tests/qemu-iotests/122.out @@ -267,9 +267,10 @@ qemu-img convert exited with status 0 =3D=3D=3D failing flush after convert with 'writeback' cache mode =3D=3D= =3D +qemu-img: Failed to flush target image: Input/output error qemu-img: Failed flush for 'json:{ /* filtered */ }' during close: Input/o= utput error qemu-img: Failed to flush the L2 table cache: Input/output error qemu-img: Failed to flush the refcount block cache: Input/output error qemu-img: Failed flush for 'json:{ /* filtered */ }' during close: Input/o= utput error -qemu-img convert exited with status 0 +qemu-img convert exited with status 1 *** done --=20 2.56.0 From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465234; cv=none; d=zohomail.com; s=zohoarc; b=NjC0Nq48kggZv67LWpq7xVItMxiGCDev3MkLLDlwyzTZ47ConsVmcNYXnBV2FmxDvWzK61HMF1KeeWadEPdeew2p2EqmL062XH1YPJ7ofLM5GnuCy0dXSBwvN804/JE6SlWHtCFnlV1gbU9q5VUZcTwANrvCUlX8zjbu64xf90s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465234; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iFrlMC8yeBQt7DzcMZs87HsbIFlEIHwemI/smmRJrOs=; b=oIRtN7vSA+9dHYkBHoaB96YLMuhgHKICFEm3fThGLKp1fnK+sYtFGa//w39s+1f+vt7k5HFcUOjm6oR4hhdFtQHqNa4Ryu78hvC0IAzs2R2xD+rI0XsL0hHGJTIk/87SJfoLgoKafiLC24ygo0sEIN2pB6JQPSbAbHuIZGvqBA0= 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 1791465234215101.78434230120638; Thu, 8 Oct 2026 06:13:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnvh-0002k5-P5; Thu, 08 Oct 2026 09:13:01 -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 1xEnvf-0002jL-Sz for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:12:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnve-0002Rh-De for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:12:59 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-396-tAiGAsBCPHeWlzqmSbJHRw-1; Thu, 08 Oct 2026 09:12:54 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F017B18088B7; Thu, 8 Oct 2026 13:12:52 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 95E7330001BB; Thu, 8 Oct 2026 13:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iFrlMC8yeBQt7DzcMZs87HsbIFlEIHwemI/smmRJrOs=; b=WWyDr63VwRuzjATwEXJvd7QjngOFeOlWneuZ0xI66Wrp5CcoZcP84R2EosMiX+qVoRl98x FyckrCnf3mrw7qc4Do6WOdcrOTFIlS3GqWxqm3z0HfNwq/jq0Hjn64z1yLfTXaSRnUHw2C Sr+Kmd6pwzTjcpBNqWTNHfkVOMXFgzA= X-MC-Unique: tAiGAsBCPHeWlzqmSbJHRw-1 X-Mimecast-MFC-AGG-ID: tAiGAsBCPHeWlzqmSbJHRw_1791465173 From: Eric Blake To: qemu-devel@nongnu.org Cc: Guillaume Vincke , Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org (open list:Network Block Dev...) Subject: [PULL 07/15] nbd/client-connection: Fix client returning a closed channel Date: Thu, 8 Oct 2026 08:11:46 -0500 Message-ID: <20261008131216.2437896-24-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.133.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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 @redhat.com) X-ZM-MESSAGEID: 1791465235691158500 Content-Type: text/plain; charset="utf-8" From: Guillaume Vincke When a server closes the connection after a successful handshake but before running any operations, the channel returned by nbd_co_establish_connection() is the closed one and the connect thread is not started. When configured with reconnect-delay=3D0 (the default), this situation generates at least two IO errors. The first one happens when trying to issue an operation to the closed socket. The connect thread will be started on the next request, which may happen long after, and will create the second error as nbd_co_establish_connection() returns a NULL channel. Peeking the channel to detect FIN or RST avoids the first IO error and does not delay the starting of the connect thread. Signed-off-by: Guillaume Vincke Message-ID: <20260925155346.357703-2-guillaume.vincke@ovhcloud.com> Reviewed-by: Eric Blake [eblake: minor formatting changes] Signed-off-by: Eric Blake --- nbd/client-connection.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/nbd/client-connection.c b/nbd/client-connection.c index 6a4f0807170..aec62934d1a 100644 --- a/nbd/client-connection.c +++ b/nbd/client-connection.c @@ -274,6 +274,23 @@ void nbd_client_connection_release(NBDClientConnection= *conn) } } +/* Only true when the peer closed the channel. Does not detect if dead. */ +static bool nbd_channel_is_closed(QIOChannel *ioc) +{ + char data; + struct iovec iov =3D { .iov_base =3D &data, .iov_len =3D 1 }; + ssize_t len =3D -1; + + if (!qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_READ_MSG_PEEK)) { + return false; + } + + len =3D qio_channel_readv_full( + ioc, &iov, 1, NULL, NULL, QIO_CHANNEL_READ_FLAG_MSG_PEEK, NULL); + + return len =3D=3D 0 || (len < 0 && len !=3D QIO_CHANNEL_ERR_BLOCK); +} + /* * Get a new connection in context of @conn: * if the thread is running, wait for completion @@ -295,6 +312,7 @@ nbd_co_establish_connection(NBDClientConnection *conn, = NBDExportInfo *info, bool blocking, Error **errp) { QemuThread thread; + QIOChannel *ioc; if (conn->do_negotiation) { assert(info); @@ -308,6 +326,20 @@ nbd_co_establish_connection(NBDClientConnection *conn,= NBDExportInfo *info, assert(!conn->wait_co); if (!conn->running) { + if (conn->sioc) { + /* discard if the socket got closed by its peer */ + ioc =3D QIO_CHANNEL(conn->sioc); + if (!qio_channel_set_blocking(ioc, false, NULL) || + nbd_channel_is_closed(ioc)) { + + qio_channel_close(ioc, NULL); + object_unref(OBJECT(conn->sioc)); + conn->sioc =3D NULL; + object_unref(OBJECT(conn->ioc)); + conn->ioc =3D NULL; + } + } + if (conn->sioc) { /* Previous attempt finally succeeded in background */ if (conn->do_negotiation) { --=20 2.56.0 From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465237; cv=none; d=zohomail.com; s=zohoarc; b=OeMVK4N9kb+5rueFuOtVppTSZKAAfgs7WG9lkLWNNr2vGvUxk9fHc0PNc/wAG9a8YB7BRVmrjUmhS7Y9Ox4vymzg43pHIFbWeYaRaspoi2MmDgpI+oF/8lnNRJ3gMT9m8hAuXlvtHA2vJuvDYPFrYDey+Hf3BkG/MtF6z8wJTUQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465237; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lnrb2VuWv6uqSxWbwAw1mUTpcFrVpfMpcJ4CZVN5eBg=; b=a9VOYqAq4pKziDb4UlafCi0JR88zqC0KVr068exbpw8pP9E5C6D1qhgtLGTLWcGMnp4HMGTfQw5qg9oCDCiHwVZdDJFjMZHqfWSrKr/dCVLYDxK0NhVl0/fefupUNd7xQbuGI3mf1d56pGCkwMZDZIM11IbLABmcqX2PvNl8B3w= 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 1791465237309377.68854887525697; Thu, 8 Oct 2026 06:13:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnwN-00038l-AK; Thu, 08 Oct 2026 09:13:45 -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 1xEnvy-0002op-Uu for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnvq-0002S8-56 for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:18 -0400 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-580-x-EbMq6zMvakAZ8xkXHWDg-1; Thu, 08 Oct 2026 09:12:59 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 72B071944ABF; Thu, 8 Oct 2026 13:12:58 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A09D230001BB; Thu, 8 Oct 2026 13:12:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lnrb2VuWv6uqSxWbwAw1mUTpcFrVpfMpcJ4CZVN5eBg=; b=FNAg5DHObUrA1F1BkkWYgjKFW8EYwuRYaFxCNdENTgZ+q8BbrjWKQ8GxGLaShbMINGsMBJ 82vS1cXZz53zIjuWYmmgcn4HncZUlAMmFboI/sFuuVlXJi+GX3pNsKshwyuyJ52AqGrSW5 K+fMGs7tHwSNZn6jiVEr6xLMHL0W65Y= X-MC-Unique: x-EbMq6zMvakAZ8xkXHWDg-1 X-Mimecast-MFC-AGG-ID: x-EbMq6zMvakAZ8xkXHWDg_1791465178 From: Eric Blake To: qemu-devel@nongnu.org Cc: Guillaume Vincke , Vladimir Sementsov-Ogievskiy , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org (open list:Network Block Dev...) Subject: [PULL 08/15] iotests: Add coverage for NBD connect thread start delay Date: Thu, 8 Oct 2026 08:11:47 -0500 Message-ID: <20261008131216.2437896-25-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.133.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 10 X-Spam_score: 1.0 X-Spam_bar: + X-Spam_report: (1.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1791465239893158500 Content-Type: text/plain; charset="utf-8" From: Guillaume Vincke Test the connect thread starting condition with reconnect-delay=3D0 when the server disconnects after a successful handshake but before running operations. Prior to the change to nbd_co_establish_connection(), this test would demonstrate two I/O errors. The tests 264 and 277 covering reconnection do not use reconnect-delay=3D0 so this case is not exercised. Add a test that provokes multiple errors in order to put an NBD client in the above-mentioned situation and shows that the first operation starts the connect thread and leads to successful subsequent I/O. Signed-off-by: Guillaume Vincke Message-ID: <20260925155346.357703-3-guillaume.vincke@ovhcloud.com> Reviewed-by: Eric Blake Tested-by: Eric Blake Signed-off-by: Eric Blake --- tests/qemu-iotests/tests/nbd-stale-connection | 62 +++++++++++++++++++ .../tests/nbd-stale-connection.out | 17 +++++ 2 files changed, 79 insertions(+) create mode 100755 tests/qemu-iotests/tests/nbd-stale-connection create mode 100644 tests/qemu-iotests/tests/nbd-stale-connection.out diff --git a/tests/qemu-iotests/tests/nbd-stale-connection b/tests/qemu-iot= ests/tests/nbd-stale-connection new file mode 100755 index 00000000000..6f6fb6ef1b8 --- /dev/null +++ b/tests/qemu-iotests/tests/nbd-stale-connection @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 +# group: quick +# +# Test the NBD client stale channel discard +# +# Copyright (C) 2026 OVHcloud +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import time +import iotests +from iotests import qemu_nbd_popen, qemu_img_create, file_path, log + + +# estimated duration required by the connect thread to reach a running ser= ver +MAX_NBD_HANDSHAKE_DURATION =3D 0.5 +# sleep duration of the connection retry in nbd client +CONNECT_RETRY_DELAY =3D 1 + +iotests.script_initialize() +nbd_sock =3D file_path('nbd-sock', base_dir=3Diotests.sock_dir) +disk =3D file_path('disk') +qemu_img_create('-f', iotests.imgfmt, disk, '1M') + +with iotests.VM() as vm: + + vm.launch() + + with qemu_nbd_popen('-k', nbd_sock, '-f', iotests.imgfmt, disk): + vm.cmd('blockdev-add', { + 'driver': 'nbd', + 'node-name': 'nbd0', + 'server': {'type': 'unix', 'path': nbd_sock}, + }) + iotests.log('=3D=3D=3D NBD Device connected =3D=3D=3D') + log(vm.qmp('x-qemu-io', device=3D'nbd0', command=3D'write -P 0x5a = 0 64k')) + + iotests.log('=3D=3D=3D NBD server down. Detect the break and start the= connect ' + 'thread =3D=3D=3D') + # client was in CONNECTED state a new operation updates to CONNECTING + log(vm.qmp('x-qemu-io', device=3D'nbd0', command=3D'write -P 0x5a 0 64= k')) + # in CONNECTING, the operation starts the connect thread + log(vm.qmp('x-qemu-io', device=3D'nbd0', command=3D'write -P 0x5a 0 64= k')) + + with qemu_nbd_popen('-k', nbd_sock, '-f', iotests.imgfmt, disk): + iotests.log('=3D=3D=3D NBD server up. Wait for the connect thread = to park ' + 'the channel =3D=3D=3D') + # wait for the connect thread to get a new channel and stop + time.sleep(CONNECT_RETRY_DELAY + MAX_NBD_HANDSHAKE_DURATION) + + iotests.log('=3D=3D=3D NBD server down. The parked channel is closed = =3D=3D=3D') + + with qemu_nbd_popen('-k', nbd_sock, '-f', iotests.imgfmt, disk): + iotests.log('=3D=3D=3D NBD server up. Restart the connect thread = =3D=3D=3D') + # operation will determine that the channel got closed and restart= the + # connect thread + log(vm.qmp('x-qemu-io', device=3D'nbd0', command=3D'write -P 0x5a = 0 64k')) + # Wait for it to succeed + iotests.log('=3D=3D=3D Wait for the connect thread to park the new= channel. ' + 'Subsequent operations are successful =3D=3D=3D') + time.sleep(MAX_NBD_HANDSHAKE_DURATION) + log(vm.qmp('x-qemu-io', device=3D'nbd0', command=3D'write -P 0x5a = 0 64k')) diff --git a/tests/qemu-iotests/tests/nbd-stale-connection.out b/tests/qemu= -iotests/tests/nbd-stale-connection.out new file mode 100644 index 00000000000..50f80e23058 --- /dev/null +++ b/tests/qemu-iotests/tests/nbd-stale-connection.out @@ -0,0 +1,17 @@ +Start NBD server +=3D=3D=3D NBD Device connected =3D=3D=3D +{"return": {}} +Kill NBD server +=3D=3D=3D NBD server down. Detect the break and start the connect thread = =3D=3D=3D +{"error": {"class": "GenericError", "desc": "write failed: Input/output er= ror"}} +{"error": {"class": "GenericError", "desc": "write failed: Input/output er= ror"}} +Start NBD server +=3D=3D=3D NBD server up. Wait for the connect thread to park the channel = =3D=3D=3D +Kill NBD server +=3D=3D=3D NBD server down. The parked channel is closed =3D=3D=3D +Start NBD server +=3D=3D=3D NBD server up. Restart the connect thread =3D=3D=3D +{"error": {"class": "GenericError", "desc": "write failed: Input/output er= ror"}} +=3D=3D=3D Wait for the connect thread to park the new channel. Subsequent = operations are successful =3D=3D=3D +{"return": {}} +Kill NBD server --=20 2.56.0 From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465266; cv=none; d=zohomail.com; s=zohoarc; b=HuCvpsQAxFC54FjO/0F5EQmFm0alQC8Yl36XGiOn0DH+G3TO06Zz806YjclHylpsfnhWPdzDTPk6Mt6tBfz7yrzg5Gfz0UUNq6IDMz81mCAwWH0rYEWIg8kvRl4tje/RsEBSwC0eBpLfljA+i6CwUmzJz6/VCgS8Quxa8Im3Gvs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465266; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XaFh6F7o7jmYAvW8pN0oZibDz415CvO9xNihmiOpBqs=; b=cNWE0hbVCSP5o/Sztoy5DBtpSLC0YyzDx4NCKNHPyelW5ZnjXlCQJ8Cs9mD98sS20XGE2CIL+8KG3Xm1Jua9MZKyV7BnxZD9JTN8aAGx9z6K5O0bEKIw9LDl3tmjnQY7YDc4wKi1h1un6AXatsvpEVJ1ZMBUijCPqsq6bJAKfU8= 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 1791465266902458.88227991660597; Thu, 8 Oct 2026 06:14:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnwX-0003XT-IN; Thu, 08 Oct 2026 09:13:53 -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 1xEnw0-0002p6-Df for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnvy-0002SI-DK for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:20 -0400 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-613-KiKFqzTcN7KlAXpukC1yFg-1; Thu, 08 Oct 2026 09:13:03 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 EC88D1944D22; Thu, 8 Oct 2026 13:13:01 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EFF7D30000E8; Thu, 8 Oct 2026 13:12:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XaFh6F7o7jmYAvW8pN0oZibDz415CvO9xNihmiOpBqs=; b=Z6WPvbx0wGMBOfwyW/u8lxj7EuA4vO0dOxcxS6USiotY4m4lecm+LvEQ/cgHVPA+It5Ov4 p/Cf2kirj5sUh5GEcEDjAcw1ngtyHyirZa9dJDNf2ee1/9gBtJPvTVlrtUwi4yXiMcdk7i jAYVrvaDoUBpUTra1IvVv2QMQsJjwHY= X-MC-Unique: KiKFqzTcN7KlAXpukC1yFg-1 X-Mimecast-MFC-AGG-ID: KiKFqzTcN7KlAXpukC1yFg_1791465182 From: Eric Blake To: qemu-devel@nongnu.org Cc: "Denis V. Lunev" , Peter Xu , Fabiano Rosas , Vladimir Sementsov-Ogievskiy , qemu-stable@nongnu.org, John Snow , qemu-block@nongnu.org (open list:Dirty Bitmaps) Subject: [PULL 09/15] migration: add QEMU_COUNTED_STRING_SIZE for counted string buffers Date: Thu, 8 Oct 2026 08:11:48 -0500 Message-ID: <20261008131216.2437896-26-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.129.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 10 X-Spam_score: 1.0 X-Spam_bar: + X-Spam_report: (1.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1791465268497158500 Content-Type: text/plain; charset="utf-8" From: "Denis V. Lunev" A counted string carries its length in one byte, so the buffer that qemu_get_counted_string() fills must hold 256 bytes. The dirty bitmap load state spells that size as a bare 256 for both of its alias buffers. Name it next to the qemu_get_counted_string() prototype and use it there, in the length assert of qemu_put_counted_string() and in DBMLoadState. Suggested-by: Eric Blake Signed-off-by: Denis V. Lunev Cc: Peter Xu Cc: Fabiano Rosas Cc: Eric Blake Cc: Vladimir Sementsov-Ogievskiy Cc: qemu-stable@nongnu.org Message-ID: <20261006170738.453977-2-den@openvz.org> Reviewed-by: Eric Blake Signed-off-by: Eric Blake --- include/migration/qemu-file-types.h | 6 +++++- migration/block-dirty-bitmap.c | 4 ++-- migration/qemu-file.c | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/include/migration/qemu-file-types.h b/include/migration/qemu-f= ile-types.h index adec5abc071..2a073bed299 100644 --- a/include/migration/qemu-file-types.h +++ b/include/migration/qemu-file-types.h @@ -163,7 +163,11 @@ static inline void qemu_get_sbe64s(QEMUFile *f, int64_= t *pv) qemu_get_be64s(f, (uint64_t *)pv); } -size_t coroutine_mixed_fn qemu_get_counted_string(QEMUFile *f, char buf[25= 6]); +/* Buffer size for a string whose length is sent as a single byte */ +#define QEMU_COUNTED_STRING_SIZE 256 + +size_t coroutine_mixed_fn +qemu_get_counted_string(QEMUFile *f, char buf[QEMU_COUNTED_STRING_SIZE]); void qemu_put_counted_string(QEMUFile *f, const char *name); diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 1b8f39c12bb..1386f436355 100644 --- a/migration/block-dirty-bitmap.c +++ b/migration/block-dirty-bitmap.c @@ -145,8 +145,8 @@ typedef struct LoadBitmapState { /* State of the dirty bitmap migration (DBM) during load process */ typedef struct DBMLoadState { uint32_t flags; - char node_alias[256]; - char bitmap_alias[256]; + char node_alias[QEMU_COUNTED_STRING_SIZE]; + char bitmap_alias[QEMU_COUNTED_STRING_SIZE]; char bitmap_name[BDRV_BITMAP_MAX_NAME_SIZE + 1]; BlockDriverState *bs; BdrvDirtyBitmap *bitmap; diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 7735e618549..df3f96fb240 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -829,7 +829,8 @@ uint64_t qemu_get_be64(QEMUFile *f) * else 0 * (Note a 0 length string will return 0 either way) */ -size_t coroutine_mixed_fn qemu_get_counted_string(QEMUFile *f, char buf[25= 6]) +size_t coroutine_mixed_fn +qemu_get_counted_string(QEMUFile *f, char buf[QEMU_COUNTED_STRING_SIZE]) { size_t len =3D qemu_get_byte(f); size_t res =3D qemu_get_buffer(f, (uint8_t *)buf, len); @@ -847,7 +848,7 @@ void qemu_put_counted_string(QEMUFile *f, const char *s= tr) { size_t len =3D strlen(str); - assert(len < 256); + assert(len < QEMU_COUNTED_STRING_SIZE); qemu_put_byte(f, len); qemu_put_buffer(f, (const uint8_t *)str, len); } --=20 2.56.0 From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465340; cv=none; d=zohomail.com; s=zohoarc; b=KVuQaTIQoXqy+PM+tBTaSz6q/QhyXAnmLNeOT+1PUt/LSr7M5Gp4LCvFKLaOAdya2our1jmbZdGy2fEWx5IlJCaBQOlgDn4DNcFGY9K18W7KuhO5Ub8qHM7e+QgdGMHTrwr16CdZ2Wc50LcT2Pl34pSlA247dSXZOzDpjg9ruZM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465340; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kaZR0awm3Sd2PBkaZeT8OfUu61ZBTvBrXHEP0ij1Nyk=; b=YbBHvznfpHTre0fsjlKjGBADQ5KEcYpyw9XjRnCqThRzWBX/Kv86BMJE7hoo8CHSQXDcTyw/KSZREP0l04ujY4bHlAsyoe5KBaKwLxWP7+uP5hgjMRWLs/vpcvoOZwwEwznXMyEKTptxKNqygaYkpVN4F8qmunkfSqAhhxBmJfo= 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 1791465340890452.1949792635627; Thu, 8 Oct 2026 06:15:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnwT-0003Cv-Hc; Thu, 08 Oct 2026 09:13:49 -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 1xEnw2-0002qq-Ch for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnvy-0002Sb-Dp for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:21 -0400 Received: from mx-prod-mc-05.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-711-_fgnTygXPy-yl2MCY99IZA-1; Thu, 08 Oct 2026 09:13:09 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6DB1919772E6; Thu, 8 Oct 2026 13:13:08 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1D80730000E8; Thu, 8 Oct 2026 13:13:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kaZR0awm3Sd2PBkaZeT8OfUu61ZBTvBrXHEP0ij1Nyk=; b=YpM3/qeXlzZt4SZ2iIr/mvENM08cgCXcYRMDk+MrNVSQw1/ex+T8ToVeDoxO1kjrjeWMSA fbKrITVMTFPsz7AL2DRkXEfKvZtBEI1KqhLS15koeyenprr/+UszMepS01IQ6tmB5d8Wd6 RqaXKgp+Rb+QcdfAye2WHAwDnsNeuq4= X-MC-Unique: _fgnTygXPy-yl2MCY99IZA-1 X-Mimecast-MFC-AGG-ID: _fgnTygXPy-yl2MCY99IZA_1791465188 From: Eric Blake To: qemu-devel@nongnu.org Cc: "Denis V. Lunev" , Peter Xu , Fabiano Rosas , Vladimir Sementsov-Ogievskiy , qemu-stable@nongnu.org, John Snow , qemu-block@nongnu.org (open list:Dirty Bitmaps) Subject: [PULL 10/15] migration/block-dirty-bitmap: fix postcopy abort with bitmaps on several nodes Date: Thu, 8 Oct 2026 08:11:49 -0500 Message-ID: <20261008131216.2437896-27-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.129.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 10 X-Spam_score: 1.0 X-Spam_bar: + X-Spam_report: (1.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1791465343748158500 Content-Type: text/plain; charset="utf-8" From: "Denis V. Lunev" With dirty bitmaps on more than one node, the source switches nodes during the postcopy bulk phase and sends the node name again. The destination reads those chunks in the postcopy listen thread, which does not hold the BQL, and resolves the name through bdrv_lookup_bs(): qemu-system-x86_64: ../block.c:6400: bdrv_lookup_bs: Assertion `qemu_in_main_thread()' failed. The bdrv_find_dirty_bitmap() call right after it needs the BQL or the dirty bitmap lock as well. Taking the BQL there would deadlock: the listen thread holds s->lock, and dirty_bitmap_mig_before_vm_start() takes s->lock with the BQL held. Every node and bitmap that a non-START chunk refers to was set up by a START chunk, and those are loaded under the BQL during setup. Record the node alias there, and resolve all other chunks against s->bitmaps instead of the block graph. Bitmaps on a single node never resend the node name after setup, which is why migrate-bitmaps-postcopy-test does not catch this. Fixes: f791bf7f93f2 ("assertions for block global state API") Signed-off-by: Denis V. Lunev Cc: Peter Xu Cc: Fabiano Rosas Cc: Eric Blake Cc: Vladimir Sementsov-Ogievskiy Cc: qemu-stable@nongnu.org Message-ID: <20261006170738.453977-3-den@openvz.org> Reviewed-by: Eric Blake Signed-off-by: Eric Blake --- migration/block-dirty-bitmap.c | 58 +++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 1386f436355..35623379eb6 100644 --- a/migration/block-dirty-bitmap.c +++ b/migration/block-dirty-bitmap.c @@ -140,6 +140,7 @@ typedef struct LoadBitmapState { BdrvDirtyBitmap *bitmap; bool migrated; bool enabled; + char node_alias[QEMU_COUNTED_STRING_SIZE]; } LoadBitmapState; /* State of the dirty bitmap migration (DBM) during load process */ @@ -859,6 +860,7 @@ static int dirty_bitmap_load_start(QEMUFile *f, DBMLoad= State *s) } b =3D g_new(LoadBitmapState, 1); + g_strlcpy(b->node_alias, s->node_alias, sizeof(b->node_alias)); b->bs =3D s->bs; b->bitmap =3D s->bitmap; b->migrated =3D false; @@ -1056,6 +1058,53 @@ static int dirty_bitmap_load_bits(QEMUFile *f, DBMLo= adState *s) return 0; } +/* + * Only START chunks are guaranteed to be loaded under the BQL; the rest m= ay + * come from the postcopy listen thread and must not touch the block graph. + */ +static BlockDriverState *dirty_bitmap_load_find_bs(DBMLoadState *s, + const char *device, + const char *node_name, + Error **errp) +{ + GSList *item; + + if (s->flags & DIRTY_BITMAP_MIG_FLAG_START) { + return bdrv_lookup_bs(device, node_name, errp); + } + + for (item =3D s->bitmaps; item; item =3D g_slist_next(item)) { + LoadBitmapState *b =3D item->data; + + if (!strcmp(b->node_alias, s->node_alias)) { + return b->bs; + } + } + + error_setg(errp, "no migrated bitmaps on node alias '%s'", s->node_ali= as); + return NULL; +} + +static BdrvDirtyBitmap *dirty_bitmap_load_find_bitmap(DBMLoadState *s) +{ + GSList *item; + + if (s->flags & DIRTY_BITMAP_MIG_FLAG_START) { + return bdrv_find_dirty_bitmap(s->bs, s->bitmap_name); + } + + for (item =3D s->bitmaps; item; item =3D g_slist_next(item)) { + LoadBitmapState *b =3D item->data; + + if (b->bs =3D=3D s->bs && + !strcmp(bdrv_dirty_bitmap_name(b->bitmap), s->bitmap_name)) { + return b->bitmap; + } + } + + return NULL; +} + static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s, GHashTable *alias_map) { @@ -1084,11 +1133,12 @@ static int dirty_bitmap_load_header(QEMUFile *f, DB= MLoadState *s, s->bs =3D NULL; } else { bitmap_alias_map =3D amin->subtree; - s->bs =3D bdrv_lookup_bs(NULL, amin->string, &local_er= r); + s->bs =3D dirty_bitmap_load_find_bs(s, NULL, amin->str= ing, + &local_err); } } else { - s->bs =3D bdrv_lookup_bs(s->node_alias, s->node_alias, - &local_err); + s->bs =3D dirty_bitmap_load_find_bs(s, s->node_alias, + s->node_alias, &local_er= r); } if (!s->bs) { error_report_err(local_err); @@ -1139,7 +1189,7 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBML= oadState *s, if (!s->cancelled) { g_strlcpy(s->bitmap_name, bitmap_name, sizeof(s->bitmap_name)); - s->bitmap =3D bdrv_find_dirty_bitmap(s->bs, s->bitmap_name); + s->bitmap =3D dirty_bitmap_load_find_bitmap(s); /* * bitmap may be NULL here, it wouldn't be an error if it is t= he --=20 2.56.0 From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465322; cv=none; d=zohomail.com; s=zohoarc; b=Gd+lkz7sFGSAY4UiqVjoVf9v2ZMz+qZc6OVSFX2LGoOngzupU/P4lbuovns6KFEqpMo6mHedSkjKlZa/uaIVzgKy0JaqfAnCAf6hAe7nB4CJ01JQYKAlkN4hyQQcMLSgP91lI3SpFVGzWNa4RFwvMFnG9+TX9lMw/AyrFFxpRU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465322; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vcniZ+r21oEFsNQLZn4uZk7wpFbpN2XCUjL3vqHWTxQ=; b=EcJFO/dFWHlaLrIJtbxfT5AtcaUL3SqQdlCgRRVGvTrPBgaUvRc0pJYSYNyeKcnuAwqrXG1sBG3CfAcH5AwxUTpnSQ4eAofmDQuRxAdnaZBwGOOLQfxhR7SB5qMXQ1/DurY1BpyLlXrq+m10gtpG/0yadpMMLnK728X8p0P5ZA4= 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 1791465322847206.70129939278763; Thu, 8 Oct 2026 06:15:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnwZ-0003fS-Iz; Thu, 08 Oct 2026 09:13:55 -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 1xEnw2-0002qk-CU for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnvy-0002Sw-Oz for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:21 -0400 Received: from mx-prod-mc-05.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-84-3v3-3hrWNl6aEvL3dAhZIQ-1; Thu, 8 Oct 2026 13:13:14 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 54316193EF53; Thu, 8 Oct 2026 13:13:13 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 21C3A30000E8; Thu, 8 Oct 2026 13:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vcniZ+r21oEFsNQLZn4uZk7wpFbpN2XCUjL3vqHWTxQ=; b=OkqM8sOASSDwtirGV0aXReOTpK8GdWoBhn3uolksG+9Jfe5HawDChhWndhbChewkGUNXSN tRuWlfZArqXZeiL+eXVqYjbr2A0cg1wBZZdxmarj1wUiJt9eHUnGkQ/Kg3pBcUiCn53zFS E4S5S8dvBmLuTA9ZxvGQBWs+gBsQOOM= X-MC-Unique: 3v3-3hrWNl6aEvL3dAhZIQ-1 X-Mimecast-MFC-AGG-ID: 3v3-3hrWNl6aEvL3dAhZIQ_1791465193 From: Eric Blake To: qemu-devel@nongnu.org Cc: "Denis V. Lunev" , Peter Xu , Fabiano Rosas , Vladimir Sementsov-Ogievskiy , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org (open list:Block layer core) Subject: [PULL 11/15] iotests/migrate-bitmaps-postcopy-test: add a bitmap on a second node Date: Thu, 8 Oct 2026 08:11:50 -0500 Message-ID: <20261008131216.2437896-28-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.133.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 10 X-Spam_score: 1.0 X-Spam_bar: + X-Spam_report: (1.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1791465325217158500 Content-Type: text/plain; charset="utf-8" From: "Denis V. Lunev" All bitmaps in the test live on drive0, so the source never switches nodes after setup and the destination never resolves a node name from the postcopy listen thread. Add a second drive with one bitmap and check that it arrives intact. Signed-off-by: Denis V. Lunev Tested-by: Eric Blake Reviewed-by: Eric Blake Cc: Peter Xu Cc: Fabiano Rosas Cc: Vladimir Sementsov-Ogievskiy Message-ID: <20261006170738.453977-4-den@openvz.org> [eblake: squash in fix to pass even after aborted run left behind stale fif= o] Signed-off-by: Eric Blake --- .../tests/migrate-bitmaps-postcopy-test | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test b/tests= /qemu-iotests/tests/migrate-bitmaps-postcopy-test index b2b37ada4b2..bada325e017 100755 --- a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test +++ b/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test @@ -27,6 +27,8 @@ debug =3D False disk_a =3D os.path.join(iotests.test_dir, 'disk_a') disk_b =3D os.path.join(iotests.test_dir, 'disk_b') +disk_a1 =3D os.path.join(iotests.test_dir, 'disk_a1') +disk_b1 =3D os.path.join(iotests.test_dir, 'disk_b1') size =3D '256G' fifo =3D os.path.join(iotests.test_dir, 'mig_fifo') @@ -97,16 +99,25 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestC= ase): self.vm_b.shutdown() os.remove(disk_a) os.remove(disk_b) + os.remove(disk_a1) + os.remove(disk_b1) os.remove(fifo) def setUp(self): + if os.path.exists(fifo): + os.remove(fifo) os.mkfifo(fifo) qemu_img('create', '-f', iotests.imgfmt, disk_a, size) qemu_img('create', '-f', iotests.imgfmt, disk_b, size) + qemu_img('create', '-f', iotests.imgfmt, disk_a1, '1G') + qemu_img('create', '-f', iotests.imgfmt, disk_b1, '1G') self.vm_a =3D iotests.VM(path_suffix=3D'a').add_drive(disk_a, 'discard=3Dunmap= ') self.vm_b =3D iotests.VM(path_suffix=3D'b').add_drive(disk_b, 'discard=3Dunmap= ') + # A bitmap on a second node makes postcopy switch nodes after setup + self.vm_a.add_drive(disk_a1) + self.vm_b.add_drive(disk_b1) self.vm_b.add_incoming("exec: cat '" + fifo + "'") self.vm_a.launch() self.vm_b.launch() @@ -127,6 +138,13 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTest= Case): node=3D'drive0', name=3D'bitmap0') empty_sha256 =3D result['return']['sha256'] + self.vm_a.cmd('block-dirty-bitmap-add', node=3D'drive1', + name=3D'bitmap0', granularity=3Dgranularity) + self.vm_a.hmp_qemu_io('drive1', 'write 0 64k') + result =3D self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256', + node=3D'drive1', name=3D'bitmap0') + self.drive1_sha256 =3D result['return']['sha256'] + apply_discards(self.vm_a, discards1) result =3D self.vm_a.qmp('x-debug-block-dirty-bitmap-sha256', @@ -212,6 +230,9 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestC= ase): # check that bitmaps are migrated and persistence works check_bitmaps(self.vm_b, nb_bitmaps) + result =3D self.vm_b.qmp('x-debug-block-dirty-bitmap-sha256', + node=3D'drive1', name=3D'bitmap0') + self.assert_qmp(result, 'return/sha256', self.drive1_sha256) self.vm_b.shutdown() # recreate vm_b, so there is no incoming option, which prevents # loading bitmaps from disk --=20 2.56.0 From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465269; cv=none; d=zohomail.com; s=zohoarc; b=Lt61vx2i2j27xJltbQscwx0hc5VC5QF0KF+xFxtAOFHqkGZEpdDgOMf4AuAvwnbaPPPbNQaTCn5Tlqpq1A+/YjTVEYNhJxOs7r6ZXKkWR4bknYFlZazh6AK5bevbbz3UNS+CxplQCRYPkIxPjYPl3hokpHoYWZDSqj/FMsNvbK4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465269; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+K+VQ0bywcPXjhezNpcEDL+/U48k3KTNJ+RDfUZVcMo=; b=N6a3aXVpU+YU+7shZQ84klq7SsX8J2K3kcYnZ4aZYOZSekFeZyacifnriJiGOSn6IkrTlZABUIgnGg51yWF+LqALTfKhJq+djpABB2zlEa3V/FJp3kjPxU26ao33yqQ14k9+3pMgO0tMsHlK6pnP7iW8rOoaZidsc5lKGEKrFOQ= 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 1791465269332374.1062018919213; Thu, 8 Oct 2026 06:14:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnwV-0003FS-G7; Thu, 08 Oct 2026 09:13:51 -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 1xEnwB-0002ud-QU for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnw0-0002TN-RT for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:29 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-681-0WJscDCVMLiVWOdZZOggcg-1; Thu, 08 Oct 2026 09:13:18 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A5C34188307A; Thu, 8 Oct 2026 13:13:17 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 31F8B30000E8; Thu, 8 Oct 2026 13:13:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+K+VQ0bywcPXjhezNpcEDL+/U48k3KTNJ+RDfUZVcMo=; b=SsUEVUlyiLxeUbJoUH7YD8M/RnwkovVWPlG+4KzLK8OTTeBPrrIjDEUddboi8zOIDvAyC5 Kn+zhpUcj1nrq/jH9n/t1PmXrxAzv5/259j2nXDAdrBW3PyNEThPp+MrYG3eXlzKOABtUL /iiTTcyGosxLOJSWkO7FHP+RIjHx2Os= X-MC-Unique: 0WJscDCVMLiVWOdZZOggcg-1 X-Mimecast-MFC-AGG-ID: 0WJscDCVMLiVWOdZZOggcg_1791465197 From: Eric Blake To: qemu-devel@nongnu.org Cc: Eric Farman , Vladimir Sementsov-Ogievskiy , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org (open list:Network Block Dev...) Subject: [PULL 12/15] iotests/nbd-in-qcow2-chain: use default machine Date: Thu, 8 Oct 2026 08:11:51 -0500 Message-ID: <20261008131216.2437896-29-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.129.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, SPF_HELO_PASS=-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 @redhat.com) X-ZM-MESSAGEID: 1791465270544158500 Content-Type: text/plain; charset="utf-8" From: Eric Farman Some of the NBD tests explicitly specify `-machine q35` which won't work when running against, say, qemu-system-s390x. The nbd-in-qcow2-chain test runs fine with the default machine on a z16 host, so allow it to run in other configurations. Fixes: 24fd6d75b3 ("iotests: Add coverage of recent NBD qio deadlock fix") Signed-off-by: Eric Farman Message-ID: <20260925194409.716498-2-farman@linux.ibm.com> Reviewed-by: Eric Blake Signed-off-by: Eric Blake --- tests/qemu-iotests/tests/nbd-in-qcow2-chain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/tests/nbd-in-qcow2-chain b/tests/qemu-iotes= ts/tests/nbd-in-qcow2-chain index 455ddfa86fe..e35f072eba4 100755 --- a/tests/qemu-iotests/tests/nbd-in-qcow2-chain +++ b/tests/qemu-iotests/tests/nbd-in-qcow2-chain @@ -43,7 +43,7 @@ TEST_IMG=3D"$TEST_IMG.base" _make_test_img $size echo echo "=3D=3D=3D Starting QEMU and exposing base image =3D=3D=3D" -_launch_qemu -machine q35 +_launch_qemu h1=3D$QEMU_HANDLE _send_qemu_cmd $QEMU_HANDLE '{"execute": "qmp_capabilities"}' 'return' _send_qemu_cmd $QEMU_HANDLE '{"execute": "blockdev-add", --=20 2.56.0 From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465339; cv=none; d=zohomail.com; s=zohoarc; b=BPeE02P2LlzLLDGZAg/9LdE7ncZvsu7s4RptsusK1l1nByiXq7E7JDdS1bAwcEyjVh1SSANg1BWGuXcKdNwZ1SZJEwUUETC/+M3EtRGUxP9hnqwXAdp957N3HsyCxsFuCwNJ6vz/4mX8x/BaYTaJGmvGNyVElqc7CG+BCeP50Hc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465339; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wxlQlXpdup8NJ5Di0pLurWhv017GjKaEaXD9TVP2bFs=; b=bjer+pI9T4kpLjAH4r7iyR88Kzt9kQhA7ZFqGOE6rn+3peSfQcA+/fsmPeYOLLkOnIsZE/4r2SDWpSdbBJfudN0QgU53rOkOYd9AptVk+moC71q8ZmkLgxPYEg0Om6AqzvcL5kbGz2zHw459wGJeCa52QUAx382TVsnPWCtXmpw= 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 1791465339033448.4285501916888; Thu, 8 Oct 2026 06:15:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnwZ-0003eb-4M; Thu, 08 Oct 2026 09:13:55 -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 1xEnwD-0002uf-63 for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnw9-0002U4-Ju for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:32 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-635-VWLLuktPM5mUt13SFPWvxQ-1; Thu, 08 Oct 2026 09:13:22 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B2AFD180B5D7; Thu, 8 Oct 2026 13:13:20 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4832830001BE; Thu, 8 Oct 2026 13:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wxlQlXpdup8NJ5Di0pLurWhv017GjKaEaXD9TVP2bFs=; b=a0edoR/2dIhrq8ncgfVMXIRj6++pbtRLJ59P9m3sjLhiuquG357DwHrNzyvuhS55F/WepV /oMTWXlXSG9SRLRQksucpL3yD6VdbqyelB7J8AyHgj1InZ+VAvV8mJus8ZnjwPbZCu1czl xWdBPOpUyuPMootcoErHXG3zjtDL+S8= X-MC-Unique: VWLLuktPM5mUt13SFPWvxQ-1 X-Mimecast-MFC-AGG-ID: VWLLuktPM5mUt13SFPWvxQ_1791465200 From: Eric Blake To: qemu-devel@nongnu.org Cc: Eric Farman , Vladimir Sementsov-Ogievskiy , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org (open list:Network Block Dev...) Subject: [PULL 13/15] iotests/nbd-tls-iothread: skip on non-x86 hardware Date: Thu, 8 Oct 2026 08:11:52 -0500 Message-ID: <20261008131216.2437896-30-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.129.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, SPF_HELO_PASS=-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 @redhat.com) X-ZM-MESSAGEID: 1791465341532158500 Content-Type: text/plain; charset="utf-8" From: Eric Farman Like nbd-in-qcow2-chain, this test assumes a q35 machine is present, which might not be available on other hosts. Unlike that test, simply allowing it to run with the default machine still throws an errors. Fence this to PC-only machines for now. Signed-off-by: Eric Farman Message-ID: <20260925194409.716498-3-farman@linux.ibm.com> Reviewed-by: Eric Blake Signed-off-by: Eric Blake --- tests/qemu-iotests/tests/nbd-tls-iothread | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qemu-iotests/tests/nbd-tls-iothread b/tests/qemu-iotests= /tests/nbd-tls-iothread index a2fb07206e5..4326e2d3e5c 100755 --- a/tests/qemu-iotests/tests/nbd-tls-iothread +++ b/tests/qemu-iotests/tests/nbd-tls-iothread @@ -47,6 +47,10 @@ cd .. _supported_fmt qcow2 # Hardcoded to qcow2 command line and QMP below _supported_proto file +if [ "$QEMU_DEFAULT_MACHINE" !=3D "pc" ]; then + _notrun "Requires a PC machine" +fi + # pick_unused_port # # Picks and returns an "unused" port, setting the global variable --=20 2.56.0 From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465323; cv=none; d=zohomail.com; s=zohoarc; b=SkKh1wHQvNimolAa9XWrk/FIIa6DXdBbLcyUV2JhHmdXkL/SozBsQ5gjksnz5L8Fwrgt9fc++X1hdVgIJd+1jVD0YVzcbYGqM1cVcNuahY2nfjt7IfgkBuRLXzqDxDfk1v6MpggEAtkeIbandnu3RzNZYrU6iE2vMc9MHXNThlg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465323; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wWSZQp5nQmPyx1gHoMLg6wJkGz0DegAEjbwkDmsuaTc=; b=ICkF9CF9hiSMwd8s5umJSYnmIUFr10cXjfLywmlUxsMdvjGIBNbQQtfeiROfqfPurb2sW8nhm65hL5ERwwdstpMSFDit/NX2NRhejpc9oyH5d9MBlGjUskXdmw01hEo1XW96HacV6mbvJCQOi3LksOYJqintsmEJ4zl/igqqOaI= 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 179146532346795.09658327698344; Thu, 8 Oct 2026 06:15:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnwY-0003ct-Nh; Thu, 08 Oct 2026 09:13:54 -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 1xEnwF-00033g-FY for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnwB-0002UC-Ga for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:33 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-561-ShfAnWgXN7Wd27Xi8Bpi_Q-1; Thu, 08 Oct 2026 09:13:24 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5CBF61809C80; Thu, 8 Oct 2026 13:13:23 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5C01430000E8; Thu, 8 Oct 2026 13:13:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wWSZQp5nQmPyx1gHoMLg6wJkGz0DegAEjbwkDmsuaTc=; b=L7DK8Y3KzyTqPv9R5JkxCjBImZEt9InMudcvtvQtOqEITdqJcHTu/JqIRHNnEJjw2hhSg7 kCybRUJoGpqZtoDegCEbwR1wrpjL6ziKm5Qmct2FyEaWc0xizjJUi01Cr4+unqX4eBAGgV u+A3835PIRKumP+LTqKx2HfmYPZW9sI= X-MC-Unique: ShfAnWgXN7Wd27Xi8Bpi_Q-1 X-Mimecast-MFC-AGG-ID: ShfAnWgXN7Wd27Xi8Bpi_Q_1791465203 From: Eric Blake To: qemu-devel@nongnu.org Cc: Eric Farman , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org (open list:Block layer core) Subject: [PULL 14/15] iotests/fuse-truncate: skip if FUSE is not usable Date: Thu, 8 Oct 2026 08:11:53 -0500 Message-ID: <20261008131216.2437896-31-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.129.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, SPF_HELO_PASS=-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 @redhat.com) X-ZM-MESSAGEID: 1791465325223158500 Content-Type: text/plain; charset="utf-8" From: Eric Farman Commit 951227d3755 ("iotests: skip FUSE tests when FUSE is not usable") reworked some of the fuse-related tests to skip where needed, but the new test fuse-truncate raced with that and missed out on the same treatment. Add that same python-esque skip logic to this test. Fixes: 7d06bbb2d9 ("iotests: test O_TRUNC behavior for fuse exports") Signed-off-by: Eric Farman Message-ID: <20260925194409.716498-4-farman@linux.ibm.com> Reviewed-by: Eric Blake Signed-off-by: Eric Blake --- tests/qemu-iotests/tests/fuse-truncate | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/tests/fuse-truncate b/tests/qemu-iotests/te= sts/fuse-truncate index 7eee35111c8..f3d2f1866c8 100755 --- a/tests/qemu-iotests/tests/fuse-truncate +++ b/tests/qemu-iotests/tests/fuse-truncate @@ -32,9 +32,12 @@ def check_fuse_support(): test_qsd.stop() os.remove(fuse_mount_point) if 'error' in res: - assert (res['error']['desc'] =3D=3D - "Parameter 'type' does not accept value 'fuse'") - iotests.notrun('No FUSE support') + desc =3D res['error']['desc'] + if desc =3D=3D "Parameter 'type' does not accept value 'fuse'": + iotests.notrun('No FUSE support') + if 'Failed to mount FUSE session' in desc: + iotests.notrun('FUSE not usable in this environment') + assert False, desc def check_sudo_support(): try: --=20 2.56.0 From nobody Mon Nov 23 05:00:13 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1791465348; cv=none; d=zohomail.com; s=zohoarc; b=apTHKK8EJCMFlogOjbzFPUnBtFleKZOxal4Dei4cEEKL9zykjJPAgY4p3ufkPy/W2wek1otRWDHXmjUwZRCC4oUfBPN3Cx84XSKM+DaByD9cjuTH9xY0qNR4kwedT7v5cKR8wHgdHfwJohbAmgonf1EMW4EISNjT+w0S6nCNQ6M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791465348; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZMT9eini1AFVzQ5tLDCkJZu8yAlX1bYCDBnwSIMPXZA=; b=h0+9cP4Hbo5aik0HVWrBj9ekAAoEH4klhAAYYo7VeFb7kk1GuQxhl93Qta99o2jKkc8hacecbPYNqU6YHBTPDY6ZcEB6TsuS2Sub5TkqCcFIdLektgj81f7QhBGT/qYLZqevECOlCNpyd7wDewYGmrG/GQS3m3cHtiLolfWhSgM= 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 179146534884890.92520638600979; Thu, 8 Oct 2026 06:15:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xEnwa-0003m5-EQ; Thu, 08 Oct 2026 09:13:56 -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 1xEnwF-00033h-Ff for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xEnwB-0002UV-JM for qemu-devel@nongnu.org; Thu, 08 Oct 2026 09:13:34 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-690-ySaJJR5LNsyPvUDtnZzAiw-1; Thu, 08 Oct 2026 09:13:28 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 615A2183093A; Thu, 8 Oct 2026 13:13:27 +0000 (UTC) Received: from eblake.csb (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DB8EC30001BB; Thu, 8 Oct 2026 13:13:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1791465209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZMT9eini1AFVzQ5tLDCkJZu8yAlX1bYCDBnwSIMPXZA=; b=EL2g7hg4A4nfL4mBeWRYlbbn1Cp2n46HJXN2rea59QzpyNZGC8666qtubKGHEal7QnG9fU JsTu8JKDj0EqR34WTJFT1hF5VLqorYkVGWfC+HRJJ5SQcnAhoLFpR+y1sVcv4px0FLc8P/ xveVSU3YySsKxkwMiCwAd422aMMB4sg= X-MC-Unique: ySaJJR5LNsyPvUDtnZzAiw-1 X-Mimecast-MFC-AGG-ID: ySaJJR5LNsyPvUDtnZzAiw_1791465207 From: Eric Blake To: qemu-devel@nongnu.org Cc: Eric Farman , Vladimir Sementsov-Ogievskiy , Kevin Wolf , Hanna Reitz , Cornelia Huck , Matthew Rosato , qemu-block@nongnu.org (open list:Network Block Dev...), qemu-s390x@nongnu.org (open list:S390 general arch...) Subject: [PULL 15/15] iotests/iothreads-nbd-export: Skip on s390 Date: Thu, 8 Oct 2026 08:11:54 -0500 Message-ID: <20261008131216.2437896-32-eblake@redhat.com> In-Reply-To: <20261008131216.2437896-17-eblake@redhat.com> References: <20261008131216.2437896-17-eblake@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.133.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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 @redhat.com) X-ZM-MESSAGEID: 1791465349663158500 Content-Type: text/plain; charset="utf-8" From: Eric Farman Running this test on s390 causes long python exception tracebacks at the beginning of the system_reset loop. The problem appears to be the same one described by commit ad302b21aab6, in that QEMU will exit on s390 without any kernel or boot disk. In other tests, this is addressed by adding -no-shutdown to the command line, and that does create a clean failure instead of a long line of python exceptions: --- /home/farman/git/qemu/tests/qemu-iotests/tests/iothreads-nbd-export.o= ut +++ /home/farman/git/qemu/build/scratch/qcow2-file-iothreads-nbd-export/i= othreads-nbd-export.out.bad @@ -16,4 +16,4 @@ {"return": {}} {"return": {}} Checking that it is still alive... -{"return": {"running": true, "status": "running"}} +{"return": {"running": false, "status": "prelaunch"}} Failures: iothreads-nbd-export Failed 1 of 1 iotests ...but obviously this isn't still a successful test, since it is expected that the guest will be still be usable after the reset loop. So, barring a solution to that, just skip this test on s390. Signed-off-by: Eric Farman Message-ID: <20260925194409.716498-6-farman@linux.ibm.com> Reviewed-by: Eric Blake Signed-off-by: Eric Blake --- tests/qemu-iotests/tests/iothreads-nbd-export | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/qemu-iotests/tests/iothreads-nbd-export b/tests/qemu-iot= ests/tests/iothreads-nbd-export index 037260729c7..72493ad2279 100755 --- a/tests/qemu-iotests/tests/iothreads-nbd-export +++ b/tests/qemu-iotests/tests/iothreads-nbd-export @@ -25,6 +25,11 @@ import iotests iotests.script_initialize(supported_fmts=3D['qcow2'], supported_platforms=3D['linux']) +# QEMU on s390 will exit without any sort of backing disk, +# so the reset loop requested by this test will fail. +if iotests.qemu_default_machine =3D=3D 's390-ccw-virtio': + iotests.notrun('Cannot run test on s390') + with iotests.FilePath('disk1.img') as path, \ iotests.FilePath('nbd.sock', base_dir=3Diotests.sock_dir) as nbd_sock= , \ qemu.machine.QEMUMachine(iotests.qemu_prog) as vm: --=20 2.56.0