From nobody Fri Nov 14 18:15:44 2025 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=1761740070; cv=none; d=zohomail.com; s=zohoarc; b=EdmTD9TmIPIYJGGdQ7fhko3oDUmuyvLSnuIowolpEttS+4OfDlO8Hcnbgo2SiuTSvCdz3ZyHsLy5Aeic0j5jICcNmaxoll4uCpkyGVSdzn9BMV8kcYDeuNDt4sdUMtNM9GdD/Zodp4AsPpIqaj+UJZpqWsx7x+byGsF8jG+5Hlc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761740070; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SBs4uvPOaZ7ZAWuf4GXT0iWzjygF2N+0Fo1lPKg09zQ=; b=mvxtnFT2iiGYHBE9j6hWALcgDhoZlHlGvkNx/P97OxeFR5QcA1U96iS60ZBuOfY72fakndRh6u28ZpwzGblAK9R0LOjOPDQcMgsa4B1GooPfaB58QlGxxVKITLcd2bpmo4moDqTgRBty//3lpi11ZSNzvAMLqJfhYqaK/ATbIZI= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761740070217236.9453752149543; Wed, 29 Oct 2025 05:14:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4yA-0003af-JN; Wed, 29 Oct 2025 08:08:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xG-00036Q-GC for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:09 -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 1vE4x1-0004vx-0F for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:06:58 -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-180-4mO_z6nrMgCiBAHzoFzMfQ-1; Wed, 29 Oct 2025 08:06:41 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 B71471954128; Wed, 29 Oct 2025 12:06:40 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 41324180057C; Wed, 29 Oct 2025 12:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739605; 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=SBs4uvPOaZ7ZAWuf4GXT0iWzjygF2N+0Fo1lPKg09zQ=; b=a8bL9VK7if5xRi2G5Qx8qIsZoQHAR4stV1CXskLlrJumHoEdC8tnYGAc+JIZ/Pag5Vwld+ hPJBVpS6r7D/wgI703tcbJEUruwNPBaVSmokqpZHAAXrz56YhFOiKTz4+NcDwiukwyISbf 2jIDE4SmxKhiMM0WfYH58RsjIwqEV28= X-MC-Unique: 4mO_z6nrMgCiBAHzoFzMfQ-1 X-Mimecast-MFC-AGG-ID: 4mO_z6nrMgCiBAHzoFzMfQ_1761739600 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 01/18] tests/qemu-iotests: Mark the 'inactive-node-nbd' as unsupported with -luks Date: Wed, 29 Oct 2025 13:06:17 +0100 Message-ID: <20251029120634.288467-2-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761740081945158500 From: Thomas Huth When running "./check -luks inactive-node-nbd", the test currently fails because QEMU terminates immediately. The reason can be seen with the "-p" parameter of the "check" script: qemu-system-x86_64: -blockdev luks,file=3Ddisk-file,node-name=3Ddisk-fmt,a= ctive=3Doff: Parameter 'key-secret' is required for cipher Quoting Kevin: "The test case just isn't made for luks. iotests.py has special code for luks in VM.add_drive(), but not in VM.add_blockdev()." Thus let's mark it as unsupported on luks to avoid the failure. Suggested-by: Kevin Wolf Signed-off-by: Thomas Huth Message-ID: <20250911142922.222365-1-thuth@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/tests/inactive-node-nbd | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/tests/inactive-node-nbd b/tests/qemu-iotest= s/tests/inactive-node-nbd index a95b37e796..664157bfd0 100755 --- a/tests/qemu-iotests/tests/inactive-node-nbd +++ b/tests/qemu-iotests/tests/inactive-node-nbd @@ -24,6 +24,7 @@ from iotests import QemuIoInteractive from iotests import filter_qemu_io, filter_qtest, filter_qmp_testfiles =20 iotests.script_initialize(supported_fmts=3D['generic'], + unsupported_fmts=3D['luks'], supported_protocols=3D['file'], supported_platforms=3D['linux']) =20 --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761739721; cv=none; d=zohomail.com; s=zohoarc; b=TWr6JPJnJ9pWpifqyJCx7Zd3Kxj2aiQK3QaVEIf9Y+vpSaKsLbMjAYYVxKvpm/oeQPQKyjxbz26Dr+hNyetpDhkkcbPiWdFVz1tJOdFhe3SsJRvQ13ZAnHpbO7nQ8td1D5LEw/Osnk89QvVcbebcbbvNPGXC/qjmGn1atmnjT6k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761739721; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KKITr5gA2FHzlfnuTzxnhBOq+A020dUORWKLOiqpqQ4=; b=GrYxDyEJBk5zq4QZFsswT1AMqWJqa9OnyzsIPfxN5QFIiYETfxA0s6wrJeGnlq1Y3NQNTcognBpNPmjEY3MtgDuly29atSdQpEK6dQd4RU2NKuw9y+Dhlqmb2XBgXn9fq6HZIw7mRb+UmIlda2H3/LbXQh+kzkN7TVnLWNzk02Y= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761739721663284.4826147153791; Wed, 29 Oct 2025 05:08:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4xV-0003F0-SN; Wed, 29 Oct 2025 08:07:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xG-00036P-Fw for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:09 -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 1vE4wz-0004vz-31 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:06:57 -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-318--NO20msOMXSaIUnbIICCeg-1; Wed, 29 Oct 2025 08:06:43 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 A480D19540DF; Wed, 29 Oct 2025 12:06:42 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 37F2A180044F; Wed, 29 Oct 2025 12:06:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739605; 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=KKITr5gA2FHzlfnuTzxnhBOq+A020dUORWKLOiqpqQ4=; b=Oib+zh7+Qwaf7p06BWcfxJT2VVjYiG2l44S24k8PvIIat+y9RsmKuIqJrnkNs236OgUoM0 K7YDFLKSL7Bb34/kEor4iHfUvDoyN9SZE9ZsVXfLJ9e/+CPIFYbx6SQRDdXA6smXbq/GqX Cf7bbO1mUMJ6lHeFJIawjYA6JL0FD8c= X-MC-Unique: -NO20msOMXSaIUnbIICCeg-1 X-Mimecast-MFC-AGG-ID: -NO20msOMXSaIUnbIICCeg_1761739602 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 02/18] block: remove 'detached-header' option from opts after use Date: Wed, 29 Oct 2025 13:06:18 +0100 Message-ID: <20251029120634.288467-3-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1761739723153154100 From: Daniel P. Berrang=C3=A9 The code for creating LUKS devices references a 'detached-header' option in the QemuOpts data, but does not consume (remove) the option. Thus when the code later tries to convert the remaining unused QemuOpts into a QCryptoBlockCreateOptions struct, an error is reported by the QAPI code that 'detached-header' is not a valid field. This fixes a regression caused by commit e818c01ae6e7c54c7019baaf307be59d99ce80b9 Author: Daniel P. Berrang=C3=A9 Date: Mon Feb 19 15:12:59 2024 +0000 qapi: drop unused QCryptoBlockCreateOptionsLUKS.detached-header which identified that the QAPI field was unused, but failed to realize the QemuOpts -> QCryptoBlockCreateOptions conversion was seeing the left-over 'detached-header' option which had not been removed from QemuOpts. This problem was identified by the 'luks-detached-header' I/O test, but unfortunately I/O tests are not run regularly for the LUKS format. Fixes: e818c01ae6e7c54c7019baaf307be59d99ce80b9 Reported-by: Thomas Huth Signed-off-by: Daniel P. Berrang=C3=A9 Message-ID: <20250919103810.1513109-1-berrange@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/crypto.c b/block/crypto.c index d4226cc68a..17b4749a1e 100644 --- a/block/crypto.c +++ b/block/crypto.c @@ -792,7 +792,7 @@ block_crypto_co_create_opts_luks(BlockDriver *drv, cons= t char *filename, char *buf =3D NULL; int64_t size; bool detached_hdr =3D - qemu_opt_get_bool(opts, "detached-header", false); + qemu_opt_get_bool_del(opts, "detached-header", false); unsigned int cflags =3D 0; int ret; Error *local_err =3D NULL; --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761739721; cv=none; d=zohomail.com; s=zohoarc; b=XL/f/3cOG96y7j09I0lBBUvT7NvnJAz8cXKtgf5EbKWo8M6s88JqVgE2B057A9Amly/pu1sej0kAIhwOhDyn3KwSWL/XKfM6R7TLN6tl/07siO4On2OiqimIZi/mwgZQndXjmkdvlo6xRxKLrARLCxi0/FG44Z2IrTobas5QPN4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761739721; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AmT8x+qOHL11jqdaDCEcFKPTxt0bXUDzwKkXxr+i52Q=; b=T2fftasxzLmYFFX8PRxVrGDpXGpct9rt7hz8N3RkAtWf/aiq2rTwm7H9E4vK7GCibJ2pI54GUGMjPfY7EY7EXLkIgaXvf+7fRPQ1rIlr41xL0b3DFYJLHcPiSXpnOqvxxjG4tSzyf+dR7OIzDquzrH7ETCzTHKWoJpv2pDMSf/w= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761739721670312.3602902582335; Wed, 29 Oct 2025 05:08:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4xQ-0003AV-JO; Wed, 29 Oct 2025 08:07:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xB-000360-J4 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:05 -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 1vE4wy-0004wB-OZ for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:06:55 -0400 Received: from mx-prod-mc-02.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-344-GMz57SsDM66Kp7t76EsEnw-1; Wed, 29 Oct 2025 08:06:45 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 70F64195608D; Wed, 29 Oct 2025 12:06:44 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 25473180057E; Wed, 29 Oct 2025 12:06:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739606; 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=AmT8x+qOHL11jqdaDCEcFKPTxt0bXUDzwKkXxr+i52Q=; b=Q9RscTb2v9pViEClX7PP/7Yc2zej5OsbRRUI2iwcvckvgnPb/wbMS5DqzWL+V0hOA5UJbZ P9tYq6pBALLFUwvGIcmn6QS0cABO5vVEfXnAva1GNyUIBM8FCMHae1CF+VQZhPNUkkhsAf GcHoef5asvCo5Vlj7dY3qlXR+xp9D/c= X-MC-Unique: GMz57SsDM66Kp7t76EsEnw-1 X-Mimecast-MFC-AGG-ID: GMz57SsDM66Kp7t76EsEnw_1761739604 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 03/18] block: fix luks 'amend' when run in coroutine Date: Wed, 29 Oct 2025 13:06:19 +0100 Message-ID: <20251029120634.288467-4-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1761739723203154100 From: Daniel P. Berrang=C3=A9 Launch QEMU with $ qemu-img create \ --object secret,id=3Dsec0,data=3D123456 \ -f luks -o key-secret=3Dsec0 demo.luks 1g $ qemu-system-x86_64 \ --object secret,id=3Dsec0,data=3D123456 \ -blockdev driver=3Dluks,key-secret=3Dsec0,file.filename=3Ddemo.luks,= file.driver=3Dfile,node-name=3Dluks Then in QMP shell attempt x-blockdev-amend job-id=3Dfish node-name=3Dluks options=3D{'state':'activ= e','new-secret':'sec0','driver':'luks'} It will result in an assertion #0 __pthread_kill_implementation (threadid=3D, signo=3Dsi= gno@entry=3D6, no_tid=3Dno_tid@entry=3D0) at pthread_kill.c:44 #1 0x00007fad18b73f63 in __pthread_kill_internal (threadid=3D, signo=3D6) at pthread_kill.c:89 #2 0x00007fad18b19f3e in __GI_raise (sig=3Dsig@entry=3D6) at ../sysdeps/= posix/raise.c:26 #3 0x00007fad18b016d0 in __GI_abort () at abort.c:77 #4 0x00007fad18b01639 in __assert_fail_base (fmt=3D, assertion=3D, file=3D, line=3D, function=3D) at assert.c:118 #5 0x00007fad18b120af in __assert_fail (assertion=3D, fil= e=3D, line=3D, function=3D) at assert.c:127 #6 0x000055ff74fdbd46 in bdrv_graph_rdlock_main_loop () at ../block/grap= h-lock.c:260 #7 0x000055ff7548521b in graph_lockable_auto_lock_mainloop (x=3D) at /usr/src/debug/qemu-9.2.4-1.fc42.x86_64/include/block/graph-lock.h= :266 #8 block_crypto_read_func (block=3D, offset=3D4096, buf= =3D0x55ffb6d66ef0 "", buflen=3D256000, opaque=3D0x55ffb5edcc30, errp=3D0x55= ffb6f00700) at ../block/crypto.c:71 #9 0x000055ff75439f8b in qcrypto_block_luks_load_key (block=3Dblock@entry=3D0x55ffb5edbe90, slot_idx=3Dslot_idx@entry=3D0,= password=3Dpassword@entry=3D0x55ffb67dc260 "123456", masterkey=3Dmasterkey= @entry=3D0x55ffb5fb0c40 "", readfunc=3Dreadfunc@entry=3D0x55ff754851e0 , opaque=3Dopaque@entry=3D0x55ffb5edcc30, errp=3D0x55ff= b6f00700) at ../crypto/block-luks.c:927 #10 0x000055ff7543b90f in qcrypto_block_luks_find_key (block=3D, password=3D, masterkey=3D, readfunc=3D, opaque=3D, errp=3D= ) at ../crypto/block-luks.c:1045 #11 qcrypto_block_luks_amend_add_keyslot (block=3D0x55ffb5edbe90, readfunc=3D0x55ff754851e0 , writefunc=3D0x55ff75485100 , opaque=3D0x55= ffb5edcc3, opts_luks=3D0x7fad1715aef8, force=3D, errp=3D0x55= ffb6f00700) at ../crypto/block-luks.c:1673 #12 qcrypto_block_luks_amend_options (block=3D0x55ffb5edbe90, readfunc=3D0x55ff754851e0 , writefunc=3D0x55ff75485100 , opaque=3D0x55= ffb5edcc30, options=3D0x7fad1715aef0, force=3D, errp=3D0x55f= fb6f00700) at ../crypto/block-luks.c:1865 #13 0x000055ff75485b95 in block_crypto_amend_options_generic_luks (bs=3D, amend_options=3D, force=3D, errp=3D) at ../block/crypto.c:949 #14 0x000055ff75485c28 in block_crypto_co_amend_luks (bs=3D, opts=3D, force=3D, errp=3D) at ../block/crypto.c:1008 #15 0x000055ff754778e5 in blockdev_amend_run (job=3D0x55ffb6f00640, errp= =3D0x55ffb6f00700) at ../block/amend.c:52 #16 0x000055ff75468b90 in job_co_entry (opaque=3D0x55ffb6f00640) at ../jo= b.c:1106 #17 0x000055ff755a0fc2 in coroutine_trampoline (i0=3D, i1= =3D) at ../util/coroutine-ucontext.c:175 This changes the read/write callbacks to not assert that they are run in mainloop context if already in a coroutine. This is also reproduced by qemu-iotests cases 295 and 296. Fixes: 1f051dcbdf2e4b6f518db731c84e304b2b9d15ce Signed-off-by: Daniel P. Berrang=C3=A9 Message-ID: <20250919112213.1530079-1-berrange@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/crypto.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/block/crypto.c b/block/crypto.c index 17b4749a1e..7c37b23e36 100644 --- a/block/crypto.c +++ b/block/crypto.c @@ -67,11 +67,18 @@ static int block_crypto_read_func(QCryptoBlock *block, BlockCrypto *crypto =3D bs->opaque; ssize_t ret; =20 - GLOBAL_STATE_CODE(); - GRAPH_RDLOCK_GUARD_MAINLOOP(); + if (qemu_in_coroutine()) { + GRAPH_RDLOCK_GUARD(); =20 - ret =3D bdrv_pread(crypto->header ? crypto->header : bs->file, - offset, buflen, buf, 0); + ret =3D bdrv_co_pread(crypto->header ? crypto->header : bs->file, + offset, buflen, buf, 0); + } else { + GLOBAL_STATE_CODE(); + GRAPH_RDLOCK_GUARD_MAINLOOP(); + + ret =3D bdrv_pread(crypto->header ? crypto->header : bs->file, + offset, buflen, buf, 0); + } if (ret < 0) { error_setg_errno(errp, -ret, "Could not read encryption header"); return ret; @@ -90,11 +97,18 @@ static int block_crypto_write_func(QCryptoBlock *block, BlockCrypto *crypto =3D bs->opaque; ssize_t ret; =20 - GLOBAL_STATE_CODE(); - GRAPH_RDLOCK_GUARD_MAINLOOP(); + if (qemu_in_coroutine()) { + GRAPH_RDLOCK_GUARD(); =20 - ret =3D bdrv_pwrite(crypto->header ? crypto->header : bs->file, - offset, buflen, buf, 0); + ret =3D bdrv_co_pwrite(crypto->header ? crypto->header : bs->file, + offset, buflen, buf, 0); + } else { + GLOBAL_STATE_CODE(); + GRAPH_RDLOCK_GUARD_MAINLOOP(); + + ret =3D bdrv_pwrite(crypto->header ? crypto->header : bs->file, + offset, buflen, buf, 0); + } if (ret < 0) { error_setg_errno(errp, -ret, "Could not write encryption header"); return ret; --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761739732; cv=none; d=zohomail.com; s=zohoarc; b=kKYSLKvPVCgeUZVS/4fAbBxJorzXu5B6Nnj/VvtNNK+xN3fPbdmb/LFnRV2qs7xtokvFxD+Y73ykDWXFTFFbX7yAR3BcFZFeE7K9vnWXBKrOMZICM59ldEsb7b1ks6G1y1xfpgVyNim9w+U7qD5U5KqjwIP23EJbt8pu5SLrc14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761739732; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DJ9Mv3zheL8yiMMy+qv9PakzcarQeBzCNL8821e9Hug=; b=JCudlz0JiV3JHhia7+Z/bW2kuqhueqescuLX5pWQxC7m1p2yq3wcjfO0XpczRjRtQwaPpFtr0ifzAgXOlKNAnNu/7Dvx36kUuboS5VF393azzrlmS56HpiwOtsiRM7KHP+9jh0DScQgEmZVEhYDM56ngxPtmdhHekoNOSuyom6g= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761739732421278.02999154166673; Wed, 29 Oct 2025 05:08:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4xU-0003Da-Ph; Wed, 29 Oct 2025 08:07:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xG-00036X-If for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:09 -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 1vE4x3-0004xb-AE for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:00 -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-615-79B5HBJONfGDXQKdZqEr8w-1; Wed, 29 Oct 2025 08:06:47 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 69AEB180136E; Wed, 29 Oct 2025 12:06:46 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E60B0180057C; Wed, 29 Oct 2025 12:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DJ9Mv3zheL8yiMMy+qv9PakzcarQeBzCNL8821e9Hug=; b=MaT/P9+PJ5YwWn0e+7x1f5HFYzsDPF4AF4X1nd5jUmDoO7VL+c6Qpsv12LOzteLfqcu1oC lXYzUQq7avkSP8278CIVceuTqw4UK2f3c672NK76SAlfLaUbDvxL3cx9KYOkFLpdUVmriY 4ktTJR6ifRvp0sjPxoblbwAL1fXJ+CU= X-MC-Unique: 79B5HBJONfGDXQKdZqEr8w-1 X-Mimecast-MFC-AGG-ID: 79B5HBJONfGDXQKdZqEr8w_1761739606 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 04/18] block/monitor: Use hmp_handle_error to report error Date: Wed, 29 Oct 2025 13:06:20 +0100 Message-ID: <20251029120634.288467-5-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1761739746366158500 Content-Type: text/plain; charset="utf-8" From: Bin Guo According to writing-monitor-commands.rst, best practice is to use the 'hmp_handle_error' function, which ensures that the message gets an 'Error: ' prefix. Signed-off-by: Bin Guo Message-ID: <20250916054850.40963-1-guobin@linux.alibaba.com> Reviewed-by: Kevin Wolf [kwolf: Fixed up iotests reference output] Signed-off-by: Kevin Wolf --- block/monitor/block-hmp-cmds.c | 45 +++++++++++++++++----------------- tests/qemu-iotests/267.out | 8 +++--- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c index 282d1c386e..3640d1f3dc 100644 --- a/block/monitor/block-hmp-cmds.c +++ b/block/monitor/block-hmp-cmds.c @@ -62,7 +62,7 @@ static void hmp_drive_add_node(Monitor *mon, const char *= optstr) { QemuOpts *opts; QDict *qdict; - Error *local_err =3D NULL; + Error *err =3D NULL; =20 opts =3D qemu_opts_parse_noisily(&qemu_drive_opts, optstr, false); if (!opts) { @@ -73,19 +73,19 @@ static void hmp_drive_add_node(Monitor *mon, const char= *optstr) =20 if (!qdict_get_try_str(qdict, "node-name")) { qobject_unref(qdict); - error_report("'node-name' needs to be specified"); + error_setg(&err, "'node-name' needs to be specified"); goto out; } =20 - BlockDriverState *bs =3D bds_tree_init(qdict, &local_err); + BlockDriverState *bs =3D bds_tree_init(qdict, &err); if (!bs) { - error_report_err(local_err); goto out; } =20 bdrv_set_monitor_owned(bs); out: qemu_opts_del(opts); + hmp_handle_error(mon, err); } =20 void hmp_drive_add(Monitor *mon, const QDict *qdict) @@ -109,7 +109,6 @@ void hmp_drive_add(Monitor *mon, const QDict *qdict) mc =3D MACHINE_GET_CLASS(current_machine); dinfo =3D drive_new(opts, mc->block_default_type, &err); if (err) { - error_report_err(err); qemu_opts_del(opts); goto err; } @@ -123,7 +122,7 @@ void hmp_drive_add(Monitor *mon, const QDict *qdict) monitor_printf(mon, "OK\n"); break; default: - monitor_printf(mon, "Can't hot-add drive to type %d\n", dinfo->typ= e); + error_setg(&err, "Can't hot-add drive to type %d", dinfo->type); goto err; } return; @@ -134,6 +133,7 @@ err: monitor_remove_blk(blk); blk_unref(blk); } + hmp_handle_error(mon, err); } =20 void hmp_drive_del(Monitor *mon, const QDict *qdict) @@ -141,36 +141,32 @@ void hmp_drive_del(Monitor *mon, const QDict *qdict) const char *id =3D qdict_get_str(qdict, "id"); BlockBackend *blk; BlockDriverState *bs; - Error *local_err =3D NULL; + Error *err =3D NULL; =20 GLOBAL_STATE_CODE(); bdrv_graph_rdlock_main_loop(); =20 bs =3D bdrv_find_node(id); if (bs) { - qmp_blockdev_del(id, &local_err); - if (local_err) { - error_report_err(local_err); - } + qmp_blockdev_del(id, &err); goto unlock; } =20 blk =3D blk_by_name(id); if (!blk) { - error_report("Device '%s' not found", id); + error_setg(&err, "Device '%s' not found", id); goto unlock; } =20 if (!blk_legacy_dinfo(blk)) { - error_report("Deleting device added with blockdev-add" - " is not supported"); + error_setg(&err, "Deleting device added with blockdev-add" + " is not supported"); goto unlock; } =20 bs =3D blk_bs(blk); if (bs) { - if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_DRIVE_DEL, &local_err)) { - error_report_err(local_err); + if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_DRIVE_DEL, &err)) { goto unlock; } =20 @@ -196,6 +192,7 @@ void hmp_drive_del(Monitor *mon, const QDict *qdict) =20 unlock: bdrv_graph_rdunlock_main_loop(); + hmp_handle_error(mon, err); } =20 void hmp_commit(Monitor *mon, const QDict *qdict) @@ -203,6 +200,7 @@ void hmp_commit(Monitor *mon, const QDict *qdict) const char *device =3D qdict_get_str(qdict, "device"); BlockBackend *blk; int ret; + Error *err =3D NULL; =20 GLOBAL_STATE_CODE(); GRAPH_RDLOCK_GUARD_MAINLOOP(); @@ -214,22 +212,25 @@ void hmp_commit(Monitor *mon, const QDict *qdict) =20 blk =3D blk_by_name(device); if (!blk) { - error_report("Device '%s' not found", device); - return; + error_setg(&err, "Device '%s' not found", device); + goto end; } =20 bs =3D bdrv_skip_implicit_filters(blk_bs(blk)); =20 if (!blk_is_available(blk)) { - error_report("Device '%s' has no medium", device); - return; + error_setg(&err, "Device '%s' has no medium", device); + goto end; } =20 ret =3D bdrv_commit(bs); } if (ret < 0) { - error_report("'commit' error for '%s': %s", device, strerror(-ret)= ); + error_setg(&err, "'commit' error for '%s': %s", device, strerror(-= ret)); } + +end: + hmp_handle_error(mon, err); } =20 void hmp_drive_mirror(Monitor *mon, const QDict *qdict) @@ -890,7 +891,7 @@ void hmp_info_snapshots(Monitor *mon, const QDict *qdic= t) =20 bs =3D bdrv_all_find_vmstate_bs(NULL, false, NULL, &err); if (!bs) { - error_report_err(err); + hmp_handle_error(mon, err); return; } =20 diff --git a/tests/qemu-iotests/267.out b/tests/qemu-iotests/267.out index f6f5d8715a..37b7ebd280 100644 --- a/tests/qemu-iotests/267.out +++ b/tests/qemu-iotests/267.out @@ -8,7 +8,7 @@ QEMU X.Y.Z monitor - type 'help' for more information (qemu) savevm snap0 Error: no block device can store vmstate for snapshot (qemu) info snapshots -no block device can store vmstate for snapshot +Error: no block device can store vmstate for snapshot (qemu) loadvm snap0 Error: no block device can store vmstate for snapshot (qemu) quit @@ -22,7 +22,7 @@ QEMU X.Y.Z monitor - type 'help' for more information (qemu) savevm snap0 Error: Device 'none0' is writable but does not support snapshots (qemu) info snapshots -no block device can store vmstate for snapshot +Error: no block device can store vmstate for snapshot (qemu) loadvm snap0 Error: Device 'none0' is writable but does not support snapshots (qemu) quit @@ -58,7 +58,7 @@ QEMU X.Y.Z monitor - type 'help' for more information (qemu) savevm snap0 Error: Device 'virtio0' is writable but does not support snapshots (qemu) info snapshots -no block device can store vmstate for snapshot +Error: no block device can store vmstate for snapshot (qemu) loadvm snap0 Error: Device 'virtio0' is writable but does not support snapshots (qemu) quit @@ -83,7 +83,7 @@ QEMU X.Y.Z monitor - type 'help' for more information (qemu) savevm snap0 Error: Device 'file' is writable but does not support snapshots (qemu) info snapshots -no block device can store vmstate for snapshot +Error: no block device can store vmstate for snapshot (qemu) loadvm snap0 Error: Device 'file' is writable but does not support snapshots (qemu) quit --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761739771; cv=none; d=zohomail.com; s=zohoarc; b=OtBgJssaJpVE+RKZzLQE+KMgS/MGNyPAEffDUeyZaCGXpRyULVKnppBi9XXoTiiAfHBQuYXl4fjIiwD98tjiIHlgOKz3GsOTmamFflUE4jU9Z7SBm58jHJB7jCi1h7Rd8UtLZqVrvahBBI/JTJJHOx4avvozriuF4wG2i3/SkpQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761739771; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Mtk7orbZ+/0SGdJlnprrUwTXuTaF9y0Knu3erU+SuHI=; b=EffeWxtT61HUeS/ZqvqdGmNDvYGCzU0iAK6Ml8dJ8d7wTgi/wj7pkI4Cc29I1EwbbGMz2NlBOn65TeXXVz7/8Z72kWAcj7H59eEeyl+Fs5YoD893pfR0zK2KPqw7IGCQ/yUHiV+pVNAJpinwH9U9BUtD1p7UEoTg+5cpC6jp+cQ= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761739771928848.5586278525424; Wed, 29 Oct 2025 05:09:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4xj-0003P0-ID; Wed, 29 Oct 2025 08:07:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xH-00036V-It for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:09 -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 1vE4x5-0004zh-8s for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:06 -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-25-foB2aJUtOvuTgVCTNpXlwQ-1; Wed, 29 Oct 2025 08:06:50 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 356F719540E8; Wed, 29 Oct 2025 12:06:48 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DF4C4180044F; Wed, 29 Oct 2025 12:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mtk7orbZ+/0SGdJlnprrUwTXuTaF9y0Knu3erU+SuHI=; b=GphMxxxyL3UXX/YjJnnz0d23Tf8frFFXn68JSgqkkT4vqrAZZdGBoAn9P2KHzfWmBiNdyx te3piBgH/LWSAkSyqyLbhPxcMWYw7x0xhbhKuLHY0lHOuY/CxJYZvKIitvLqdQ3MJXkg0l 50Ifaak9vFJjGuIHmAMhXt8amXrRj7k= X-MC-Unique: foB2aJUtOvuTgVCTNpXlwQ-1 X-Mimecast-MFC-AGG-ID: foB2aJUtOvuTgVCTNpXlwQ_1761739608 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 05/18] block/curl.c: Fix CURLOPT_VERBOSE parameter type Date: Wed, 29 Oct 2025 13:06:21 +0100 Message-ID: <20251029120634.288467-6-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1761739777645154100 Content-Type: text/plain; charset="utf-8" From: "Richard W.M. Jones" In commit ed26056d90 ("block/curl.c: Use explicit long constants in curl_easy_setopt calls") we missed a further call that takes a long parameter. Reported-by: Kevin Wolf Signed-off-by: Richard W.M. Jones Message-ID: <20251013124127.604401-1-rjones@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/curl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/curl.c b/block/curl.c index 68cf83ce55..d7d93d967f 100644 --- a/block/curl.c +++ b/block/curl.c @@ -524,7 +524,7 @@ static int curl_init_state(BDRVCURLState *s, CURLState = *state) #endif =20 #ifdef DEBUG_VERBOSE - if (curl_easy_setopt(state->curl, CURLOPT_VERBOSE, 1)) { + if (curl_easy_setopt(state->curl, CURLOPT_VERBOSE, 1L)) { goto err; } #endif --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761740105; cv=none; d=zohomail.com; s=zohoarc; b=OM1RymoCXMKuAX0ND15IlfV15IC4eR71BabDzD+LJMGfjVu6cgwqZf7nEoEHjn11J63dF5UOxRob8nIeWat5dcMZJqn8Wy/No4eMEz/bapJAelNJiBjIt7/Y3cdnMKNtEiDThv5NAfQpUCDJ5Sw9LW19X24VQHG1/HnY+COr/6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761740105; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gRvYHHCROCtAqIn6dCl6PSPyw62CJBs+/oirAHeLJCw=; b=hGOPWaFAU6Xx6Otap3+ROsoJa6A0c3KEHdJMDaxKKVGJX9aJxRHoTUXLDtqqeiUtu7AbeMtZfLJr5q+shwgv1vyzPSwJTnstz/7kEnK5U276vzyM/AMIyG6rzFUeluWwq4kCA3xOTf9sJVpSCrUt+RmMSt/7liAur6GNslrYgFY= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761740105073239.20553625976822; Wed, 29 Oct 2025 05:15:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4y8-0003Vx-4h; Wed, 29 Oct 2025 08:08:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xG-00036T-Gr for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:09 -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 1vE4x4-0004zX-FE for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:03 -0400 Received: from mx-prod-mc-02.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-14-yzHmBEa_PhOcIj7bUJK6bQ-1; Wed, 29 Oct 2025 08:06:50 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 035021956086; Wed, 29 Oct 2025 12:06:50 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ABB1A180057C; Wed, 29 Oct 2025 12:06:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739612; 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=gRvYHHCROCtAqIn6dCl6PSPyw62CJBs+/oirAHeLJCw=; b=f30SPW0lbipUc0Q2Njf0Xh622fIuP7ofB4IcF2yeOhgZ1uWUC6Aa6KYzQwcH4IqqV6iZ8w wzewISf8XQQbBCfQiYFYnh6EujHuBzDYkl4R2NUntkWmAXNi7uzoOui9DadUB961wRCEj1 oTmk8hfWsoILKRzppI2ykJLrzwdcDTM= X-MC-Unique: yzHmBEa_PhOcIj7bUJK6bQ-1 X-Mimecast-MFC-AGG-ID: yzHmBEa_PhOcIj7bUJK6bQ_1761739610 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 06/18] iotests: Adjust nbd expected outputs to match current behavior Date: Wed, 29 Oct 2025 13:06:22 +0100 Message-ID: <20251029120634.288467-7-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1761740108206158500 From: Eric Blake 'git bisect' confirms that the NBD iotests 94 and 119 have been broken since commit effd60c8 in v9.0.0; but as Dan Berrange's efforts to improve CI have proven, we haven't been reliably running them to notice. The change was good (moving coroutine commands to run in the right context), but it meant that "execute":"quit" now waits to complete until the coroutines tearing down NBD have first reported the SHUTDOWN event, in the opposite order of what happened pre-patch. Signed-off-by: Eric Blake Fixes: effd60c8 ("monitor: only run coroutine commands in qemu_aio_context"= , v9.0.0) Reported-by: Daniel P. Berrang=C3=A9 Message-ID: <20251013213638.494193-2-eblake@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/094.out | 2 +- tests/qemu-iotests/119.out | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/094.out b/tests/qemu-iotests/094.out index 97f894cf8f..9178474e79 100644 --- a/tests/qemu-iotests/094.out +++ b/tests/qemu-iotests/094.out @@ -23,6 +23,6 @@ Formatting 'TEST_DIR/source.IMGFMT', fmt=3DIMGFMT size=3D= 67108864 {'execute': 'quit'} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "src"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "src"}} -{"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} +{"return": {}} *** done diff --git a/tests/qemu-iotests/119.out b/tests/qemu-iotests/119.out index 7b7f0f4bcc..45f82a4faa 100644 --- a/tests/qemu-iotests/119.out +++ b/tests/qemu-iotests/119.out @@ -5,7 +5,7 @@ QMP_VERSION read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": ""} -{"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} +{"return": {}} =20 *** done --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761739722; cv=none; d=zohomail.com; s=zohoarc; b=fCI+PyOrEMndpmqJ6c38ubFjEE2/kSmPzQye3yt4VoN8qKadoMj23WOzfZl0ra5yEdfHxBfIZlLaioMquig1RXderRSKVEncieekp/dAgyqsMAF9VX6eV3goB4PLcDlf4lOARrjJbOsVgQd8NHNYT4ls509ddfLOfYO20zU8Ifs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761739722; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nUxKI9ns8Nrn0orRcTM3BhllWySnqVTo3lPyM2Y42S8=; b=USAWT37j+FoFFSMiGRVSKjS6aj050B1ZFbvOoik1nUaEsJ2i8QJ7hSysLCAnFp9ZOIm7HO1jdZgnTLU0tUiqPucNfDDd2XNysds2ul3RT6Liw/A3FpVTY6m9D4u/XcCy7UL07GY6VWtAygYenGPnVIDTFPJS+DbivgNznWGp+cw= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761739722048775.8045377479389; Wed, 29 Oct 2025 05:08:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4xT-0003DL-Mw; Wed, 29 Oct 2025 08:07:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xK-00039G-PJ for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:11 -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 1vE4x9-00050f-7o for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:10 -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-212-7K41TIr5P6OEsU2S0XbAYg-1; Wed, 29 Oct 2025 08:06:52 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 B5FA81801231; Wed, 29 Oct 2025 12:06:51 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 77FBB180057C; Wed, 29 Oct 2025 12:06:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739616; 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=nUxKI9ns8Nrn0orRcTM3BhllWySnqVTo3lPyM2Y42S8=; b=RsZf1NnaBacOEsSu08CY4WZLcDwiVpyAfXrUDLcbw52xNfKhLywLUEJSLnnDBqneMTGUJW bhg9Jb7eu3dqlMr3MhCl3VI9MzBOue4Th+q355Jk6Pjh+uUyRMnLWFwM6XD9tjSs+ZLSSW Gkw/YppF+56PJg2OaVQX4PZv6Y6waaI= X-MC-Unique: 7K41TIr5P6OEsU2S0XbAYg-1 X-Mimecast-MFC-AGG-ID: 7K41TIr5P6OEsU2S0XbAYg_1761739611 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 07/18] iotests: Adjust fuse-allow-other expected output Date: Wed, 29 Oct 2025 13:06:23 +0100 Message-ID: <20251029120634.288467-8-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1761739738666158500 From: Eric Blake The iotest fuse-allow-other has been broken since commit effd60c8 in v9.0.0; but as Dan Berrange's efforts to improve CI have proven, we haven't been reliably running it to notice. The change in that commit was good (moving coroutine commands to run in the right context), but it meant that "execute":"quit" now waits to complete until the coroutines tearing down fuse have first reported the SHUTDOWN event, in the opposite order of what happened pre-patch. Signed-off-by: Eric Blake Fixes: effd60c8 ("monitor: only run coroutine commands in qemu_aio_context", Reported-by: Daniel P. Berrang=C3=A9 Message-ID: <20251021205843.2585624-2-eblake@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/tests/fuse-allow-other.out | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/tests/fuse-allow-other.out b/tests/qemu-iot= ests/tests/fuse-allow-other.out index 543fa52a06..3219fc35e0 100644 --- a/tests/qemu-iotests/tests/fuse-allow-other.out +++ b/tests/qemu-iotests/tests/fuse-allow-other.out @@ -28,9 +28,9 @@ stat: cannot statx 'fuse-export': Permission denied cat: fuse-export: Permission denied stat: cannot statx 'fuse-export': Permission denied {'execute': 'quit'} -{"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_EXPORT_DELETED", "data": {"id": "export"}} +{"return": {}} =20 --- allow-other=3Don --- {'execute': 'qmp_capabilities'} @@ -55,9 +55,9 @@ Permissions seen by nobody: 444 cat: fuse-export: Permission denied Permissions seen by nobody: 440 {'execute': 'quit'} -{"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_EXPORT_DELETED", "data": {"id": "export"}} +{"return": {}} =20 --- allow-other=3Dauto --- {'execute': 'qmp_capabilities'} @@ -82,7 +82,7 @@ Permissions seen by nobody: 444 cat: fuse-export: Permission denied Permissions seen by nobody: 440 {'execute': 'quit'} -{"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_EXPORT_DELETED", "data": {"id": "export"}} +{"return": {}} *** done --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761739723; cv=none; d=zohomail.com; s=zohoarc; b=PzDXxEaTWLq3WxHdoMQ7zMWwBLxwHeUF9vfhLk8Qj4F5LjkiEAvzWGuYfGfKqVSMXrsj+1rAEji6iIL2xIcbmHcdciiSmtJnlxBhyaZ+RLQmxI022UVmIif7d8qOuwl2150id+PAyL+8Ia/ecB1VM1cS/hnGxpTC5qXzzjyrhWk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761739723; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=o2nLVnIMpd1SN7HGH5Ve6xUlTg+yyzNFQi5ephwI5Ls=; b=RMfhh0hwBJGfcnKjE0DKKjDnMV2qCTIn5GOOP3fHwOjQ83i3QfsXrnRCG247UVXXDR9ZLDvRDM9cxHjXKF+2I1WzBQ4MVD75l+hgPDWp2WWWE0lZv5bq3XC+24lqgeEPkBwZRMzzYhx7eyxZygE4R/eaVL+kbycWd1jiHY9xzvg= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761739723348425.78848385882225; Wed, 29 Oct 2025 05:08:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4y2-0003Tq-PI; Wed, 29 Oct 2025 08:07:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xR-0003DY-Mr for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:19 -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 1vE4xE-00050l-Oh for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:17 -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-364-XwDIVz7xMgeaZY5vYF60qw-1; Wed, 29 Oct 2025 08:06:54 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 B433F180A200; Wed, 29 Oct 2025 12:06:53 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 39103180057C; Wed, 29 Oct 2025 12:06:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o2nLVnIMpd1SN7HGH5Ve6xUlTg+yyzNFQi5ephwI5Ls=; b=LdfOvCYb/1M2bpDRMQu5NOjBdyAEB8pZczC+qhRDTd+TkPxTqIMuoZq/OtDqzR+c/j8Gl+ Xjz4F+vk1fAavpNeb34UsDQ1yU6ZEWvCZtA5v4SxEkH6r09rESbtQ/R0/dttp7hXCTJGAr YRzzPX0YF/HDF2J8/vIgMtjAJO4+/zE= X-MC-Unique: XwDIVz7xMgeaZY5vYF60qw-1 X-Mimecast-MFC-AGG-ID: XwDIVz7xMgeaZY5vYF60qw_1761739613 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 08/18] block: enable stats-intervals for storage devices Date: Wed, 29 Oct 2025 13:06:24 +0100 Message-ID: <20251029120634.288467-9-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761739725190154100 Content-Type: text/plain; charset="utf-8" From: Chandan Somani This patch allows stats-intervals to be used for storage devices with the -device option. It accepts a list of interval lengths in JSON format. It configures and collects the stats in the BlockBackend layer through the storage device that consumes the BlockBackend. Signed-off-by: Chandan Somani Message-ID: <20251003220039.1336663-1-csomani@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/accounting.h | 5 +++-- include/hw/block/block.h | 7 ++++++- block/accounting.c | 17 +++++++++++++++-- blockdev.c | 3 ++- hw/block/block.c | 7 +++++-- tests/qemu-iotests/172.out | 38 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 69 insertions(+), 8 deletions(-) diff --git a/include/block/accounting.h b/include/block/accounting.h index a59e39f49d..b1cf417b57 100644 --- a/include/block/accounting.h +++ b/include/block/accounting.h @@ -101,8 +101,9 @@ typedef struct BlockAcctCookie { } BlockAcctCookie; =20 void block_acct_init(BlockAcctStats *stats); -void block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invali= d, - enum OnOffAuto account_failed); +bool block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invali= d, + enum OnOffAuto account_failed, uint32_t *stats_inter= vals, + uint32_t num_stats_intervals, Error **errp); void block_acct_cleanup(BlockAcctStats *stats); void block_acct_add_interval(BlockAcctStats *stats, unsigned interval_leng= th); BlockAcctTimedStats *block_acct_interval_next(BlockAcctStats *stats, diff --git a/include/hw/block/block.h b/include/hw/block/block.h index de3946a5f1..b4d914624e 100644 --- a/include/hw/block/block.h +++ b/include/hw/block/block.h @@ -34,6 +34,8 @@ typedef struct BlockConf { OnOffAuto account_invalid, account_failed; BlockdevOnError rerror; BlockdevOnError werror; + uint32_t num_stats_intervals; + uint32_t *stats_intervals; } BlockConf; =20 static inline unsigned int get_physical_block_exp(BlockConf *conf) @@ -66,7 +68,10 @@ static inline unsigned int get_physical_block_exp(BlockC= onf *conf) DEFINE_PROP_ON_OFF_AUTO("account-invalid", _state, \ _conf.account_invalid, ON_OFF_AUTO_AUTO), \ DEFINE_PROP_ON_OFF_AUTO("account-failed", _state, \ - _conf.account_failed, ON_OFF_AUTO_AUTO) + _conf.account_failed, ON_OFF_AUTO_AUTO), \ + DEFINE_PROP_ARRAY("stats-intervals", _state, \ + _conf.num_stats_intervals, _conf.stats_intervals, \ + qdev_prop_uint32, uint32_t) =20 #define DEFINE_BLOCK_PROPERTIES(_state, _conf) \ DEFINE_PROP_DRIVE("drive", _state, _conf.blk), \ diff --git a/block/accounting.c b/block/accounting.c index 3e46159569..0933c61f3a 100644 --- a/block/accounting.c +++ b/block/accounting.c @@ -28,6 +28,7 @@ #include "block/block_int.h" #include "qemu/timer.h" #include "system/qtest.h" +#include "qapi/error.h" =20 static QEMUClockType clock_type =3D QEMU_CLOCK_REALTIME; static const int qtest_latency_ns =3D NANOSECONDS_PER_SECOND / 1000; @@ -56,13 +57,25 @@ static bool bool_from_onoffauto(OnOffAuto val, bool def) } } =20 -void block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invali= d, - enum OnOffAuto account_failed) +bool block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invali= d, + enum OnOffAuto account_failed, uint32_t *stats_inter= vals, + uint32_t num_stats_intervals, Error **errp) { stats->account_invalid =3D bool_from_onoffauto(account_invalid, stats->account_invalid); stats->account_failed =3D bool_from_onoffauto(account_failed, stats->account_failed); + if (stats_intervals) { + for (int i =3D 0; i < num_stats_intervals; i++) { + if (stats_intervals[i] <=3D 0) { + error_setg(errp, "Invalid interval length: %u", stats_inte= rvals[i]); + return false; + } + block_acct_add_interval(stats, stats_intervals[i]); + } + g_free(stats_intervals); + } + return true; } =20 void block_acct_cleanup(BlockAcctStats *stats) diff --git a/blockdev.c b/blockdev.c index b451fee6e1..dbd1d4d3e8 100644 --- a/blockdev.c +++ b/blockdev.c @@ -617,7 +617,8 @@ static BlockBackend *blockdev_init(const char *file, QD= ict *bs_opts, =20 bs->detect_zeroes =3D detect_zeroes; =20 - block_acct_setup(blk_get_stats(blk), account_invalid, account_fail= ed); + block_acct_setup(blk_get_stats(blk), account_invalid, account_fail= ed, + NULL, 0, NULL); =20 if (!parse_stats_intervals(blk_get_stats(blk), interval_list, errp= )) { blk_unref(blk); diff --git a/hw/block/block.c b/hw/block/block.c index 2e10611d95..f187fa025d 100644 --- a/hw/block/block.c +++ b/hw/block/block.c @@ -249,8 +249,11 @@ bool blkconf_apply_backend_options(BlockConf *conf, bo= ol readonly, blk_set_enable_write_cache(blk, wce); blk_set_on_error(blk, rerror, werror); =20 - block_acct_setup(blk_get_stats(blk), conf->account_invalid, - conf->account_failed); + if (!block_acct_setup(blk_get_stats(blk), conf->account_invalid, + conf->account_failed, conf->stats_intervals, + conf->num_stats_intervals, errp)) { + return false; + } return true; } =20 diff --git a/tests/qemu-iotests/172.out b/tests/qemu-iotests/172.out index 146fc72388..a023cd407d 100644 --- a/tests/qemu-iotests/172.out +++ b/tests/qemu-iotests/172.out @@ -30,6 +30,7 @@ Testing: share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "288" =20 =20 @@ -59,6 +60,7 @@ Testing: -fda TEST_DIR/t.qcow2 share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/unattached/device[N] @@ -95,6 +97,7 @@ Testing: -fdb TEST_DIR/t.qcow2 share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" dev: floppy, id "" unit =3D 0 (0x0) @@ -109,6 +112,7 @@ Testing: -fdb TEST_DIR/t.qcow2 share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "288" floppy1 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/unattached/device[N] @@ -149,6 +153,7 @@ Testing: -fda TEST_DIR/t.qcow2 -fdb TEST_DIR/t.qcow2.2 share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" dev: floppy, id "" unit =3D 0 (0x0) @@ -163,6 +168,7 @@ Testing: -fda TEST_DIR/t.qcow2 -fdb TEST_DIR/t.qcow2.2 share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/unattached/device[N] @@ -204,6 +210,7 @@ Testing: -fdb share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "288" dev: floppy, id "" unit =3D 0 (0x0) @@ -218,6 +225,7 @@ Testing: -fdb share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "288" =20 =20 @@ -247,6 +255,7 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2 share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/unattached/device[N] @@ -283,6 +292,7 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2,ind= ex=3D1 share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" dev: floppy, id "" unit =3D 0 (0x0) @@ -297,6 +307,7 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2,ind= ex=3D1 share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "288" floppy1 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/unattached/device[N] @@ -337,6 +348,7 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2 -dr= ive if=3Dfloppy,file=3DTEST_DIR/t share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" dev: floppy, id "" unit =3D 0 (0x0) @@ -351,6 +363,7 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2 -dr= ive if=3Dfloppy,file=3DTEST_DIR/t share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/unattached/device[N] @@ -395,6 +408,7 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -devi= ce floppy,drive=3Dnone0 share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/peripheral-anon/device[N] @@ -431,6 +445,7 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -devi= ce floppy,drive=3Dnone0,unit=3D1 share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/peripheral-anon/device[N] @@ -467,6 +482,7 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -driv= e if=3Dnone,file=3DTEST_DIR/t.qco share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" dev: floppy, id "" unit =3D 0 (0x0) @@ -481,6 +497,7 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -driv= e if=3Dnone,file=3DTEST_DIR/t.qco share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/peripheral-anon/device[N] @@ -531,6 +548,7 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=3Dnone,file=3D= TEST_DIR/t.qcow2.2 -device fl share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" dev: floppy, id "" unit =3D 0 (0x0) @@ -545,6 +563,7 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=3Dnone,file=3D= TEST_DIR/t.qcow2.2 -device fl share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/unattached/device[N] @@ -586,6 +605,7 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=3Dnone,file=3D= TEST_DIR/t.qcow2.2 -device fl share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" dev: floppy, id "" unit =3D 0 (0x0) @@ -600,6 +620,7 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=3Dnone,file=3D= TEST_DIR/t.qcow2.2 -device fl share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/unattached/device[N] @@ -641,6 +662,7 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=3Dnone,file=3D= TEST_DIR/t.qcow2.2 -device fl share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" dev: floppy, id "" unit =3D 1 (0x1) @@ -655,6 +677,7 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=3Dnone,file=3D= TEST_DIR/t.qcow2.2 -device fl share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" floppy1 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/unattached/device[N] @@ -696,6 +719,7 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=3Dnone,file=3D= TEST_DIR/t.qcow2.2 -device fl share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" dev: floppy, id "" unit =3D 1 (0x1) @@ -710,6 +734,7 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=3Dnone,file=3D= TEST_DIR/t.qcow2.2 -device fl share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" floppy1 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/unattached/device[N] @@ -760,6 +785,7 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2 -dr= ive if=3Dnone,file=3DTEST_DIR/t.q share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" dev: floppy, id "" unit =3D 0 (0x0) @@ -774,6 +800,7 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2 -dr= ive if=3Dnone,file=3DTEST_DIR/t.q share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/unattached/device[N] @@ -815,6 +842,7 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2 -dr= ive if=3Dnone,file=3DTEST_DIR/t.q share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" dev: floppy, id "" unit =3D 0 (0x0) @@ -829,6 +857,7 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2 -dr= ive if=3Dnone,file=3DTEST_DIR/t.q share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/unattached/device[N] @@ -876,6 +905,7 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -glob= al floppy.drive=3Dnone0 -device share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/peripheral-anon/device[N] @@ -942,6 +972,7 @@ Testing: -device floppy share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "288" =20 Testing: -device floppy,drive-type=3D120 @@ -968,6 +999,7 @@ Testing: -device floppy,drive-type=3D120 share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "120" =20 Testing: -device floppy,drive-type=3D144 @@ -994,6 +1026,7 @@ Testing: -device floppy,drive-type=3D144 share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" =20 Testing: -device floppy,drive-type=3D288 @@ -1020,6 +1053,7 @@ Testing: -device floppy,drive-type=3D288 share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "288" =20 =20 @@ -1049,6 +1083,7 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -de= vice floppy,drive=3Dnone0,drive-t share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "120" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/peripheral-anon/device[N] @@ -1085,6 +1120,7 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -de= vice floppy,drive=3Dnone0,drive-t share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "288" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/peripheral-anon/device[N] @@ -1124,6 +1160,7 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -de= vice floppy,drive=3Dnone0,logical share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/peripheral-anon/device[N] @@ -1160,6 +1197,7 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -de= vice floppy,drive=3Dnone0,physica share-rw =3D false account-invalid =3D "auto" account-failed =3D "auto" + stats-intervals =3D drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) Attached to: /machine/peripheral-anon/device[N] --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761739747; cv=none; d=zohomail.com; s=zohoarc; b=oGkMVtGrOc59d7ZwofqhoLpURe4jRbkf3A1P2ov4ApzzZK11LChfkqjV0ON0dA8m6y6TDXLqR0clJXBcXY/cnvrAIb7zKurBRrYF5Iwh/SCnOiwpPxvp7Erl4fR+OpuL5A2PjaflramJ7Njlk0Kr7KIkbTp0bES5ePUMWwke/eA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761739747; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1ob1mZP10conViV2ZR2n8/iCp29dtRS7dycILfLsui8=; b=EJeQ4Eay6UM3judB+IxGJlhlHUZq75I6cPrm/V5rCw1GOudP0uelTwtuNr5DlooYtJ5Wl/rzBg9Nz2u2IjNeKvEFPxLLUy0Gg5Fa17lW7FGsix0vrJi/krlFUVGPV+Slv+CbTR8Id8gwUPNhFZyquSlROQt0RXv08AhzPYQBUnI= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761739747353509.67832455512485; Wed, 29 Oct 2025 05:09:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4xY-0003Ij-QC; Wed, 29 Oct 2025 08:07:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xN-0003Bc-8C for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:14 -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 1vE4xG-00051a-HE for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:12 -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-86-aCVWDLygMh2sgLaFfJXR7g-1; Wed, 29 Oct 2025 08:06:56 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 77B3C196F75C; Wed, 29 Oct 2025 12:06:55 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 37100180044F; Wed, 29 Oct 2025 12:06:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1ob1mZP10conViV2ZR2n8/iCp29dtRS7dycILfLsui8=; b=M0gSpFBuOMtEj3IFpIM8nsD3N3P3zBwds9+YZSbmBjgx2QX3J48mEuLAkEhJ/mUB+49P9z qm0jK7PtMxFMxHft/wE5M1NLUNxrLl70lTIY1pi6TTo9z+n3s94fugsDADI6yXYmm5Fqrm H89cHVSH0uN/Fn2KIH1q/fuG8ezFhEc= X-MC-Unique: aCVWDLygMh2sgLaFfJXR7g-1 X-Mimecast-MFC-AGG-ID: aCVWDLygMh2sgLaFfJXR7g_1761739615 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 09/18] MAINTAINERS: Mark VHDX block driver as "Odd Fixes" Date: Wed, 29 Oct 2025 13:06:25 +0100 Message-ID: <20251029120634.288467-10-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, T_SPF_TEMPERROR=0.01 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: 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: 1761739749455154100 Content-Type: text/plain; charset="utf-8" From: Peter Maydell In 2018 (in commit 5f5246b6b) Jeff Cody stepped down as block maintainer, but left himself as maintainer for VHDX and with a status of "Supported", with the rationale: For VHDX, added my personal email address as a maintainer, as I can answer questions or send the occassional bug fix. Leaving it as 'Supported', instead of 'Odd Fixes', because I think the rest of the block layer maintainers and developers will upkeep it as well, if needed. However, today the way we treat subsystems which are only maintained under the general umbrella of a wider system is usually to mark them as "Odd Fixes". The vhdx.c code has had no commits which aren't a part of more general refactoring changes since 2020, and Jeff himself hasn't been active on qemu-devel since 2018, so this seems also to be how we've handled the code in practice. Signed-off-by: Peter Maydell Message-ID: <20251002125446.2500179-1-peter.maydell@linaro.org> Signed-off-by: Kevin Wolf --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 64491c800c..fd78a563a2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4081,7 +4081,7 @@ F: block/rbd.c VHDX M: Jeff Cody L: qemu-block@nongnu.org -S: Supported +S: Odd Fixes F: block/vhdx* =20 VDI --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761740053; cv=none; d=zohomail.com; s=zohoarc; b=DqXObTArbjH6+2K+AqpOtcIbB3FmDqAbaeqY01Y7wduUA3aM6puOAMTIiaAFeQ8lYIsUB95q2AcpE2lszjAsKB0KiRiqXmdis7Rw3pTpuiuULsrZVidUHcjgMtUlPrK4GAnDxZYTce9YLwVB/evhjYZRDqPXsb9IZDZI8YkinQM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761740053; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ySx3IYsfTdTsqDODfD7tI2MyX05kjk8/vUHV3hCo/6A=; b=YtVDAY2h/evNSF2u0z9SsSzIUZeXvQqwI85zPY/2B2SediXs9eBD7Y+Uq0NxhdKXy3/XdWdOHdIV0ODCPcv3rjPZv9yJGdpFkRPwoKifTLKIMymuVRaA2rgUk4+Tkyf12NaQO7jM6ljiO86QgkMykwgoVyNcZnHGRrkM9eEmcg0= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761740053777101.70609911267456; Wed, 29 Oct 2025 05:14:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4y8-0003Wx-Ol; Wed, 29 Oct 2025 08:08:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xT-0003Dr-Oq for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:20 -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 1vE4xH-00051X-Jl for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:19 -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-18-xyuobfQ_ND6Bk0vqrZC_lA-1; Wed, 29 Oct 2025 08:06:58 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 403D31800744; Wed, 29 Oct 2025 12:06:57 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EB7B0180057F; Wed, 29 Oct 2025 12:06:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ySx3IYsfTdTsqDODfD7tI2MyX05kjk8/vUHV3hCo/6A=; b=hQO8Yf/QO8QwK0YL6F9wUMk6xFgGFeCIly7jSLQf8sJmNH3DIJlsakHKb4+t7VxGGRVCrz T/eKDWrKzELGNZjEWjm1Mm0ZHfc/IF8suvB3nsgz+tnGEJ7dirRUjvNRWB+86pqKq85c5B 8oi5tOmbrDhY1/Oz6eeXE0zvqjx/5HI= X-MC-Unique: xyuobfQ_ND6Bk0vqrZC_lA-1 X-Mimecast-MFC-AGG-ID: xyuobfQ_ND6Bk0vqrZC_lA_1761739617 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 10/18] include/block/block_int-common: document when resize callback is used Date: Wed, 29 Oct 2025 13:06:26 +0100 Message-ID: <20251029120634.288467-11-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761740061789158500 Content-Type: text/plain; charset="utf-8" From: Fiona Ebner The 'resize' callback is only called by bdrv_parent_cb_resize() which is only called by bdrv_co_write_req_finish() to notify the parent(s) that the child was resized. Signed-off-by: Fiona Ebner Reviewed-by: Hanna Czenczek Message-ID: <20250917115509.401015-2-f.ebner@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/block_int-common.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/block/block_int-common.h b/include/block/block_int-com= mon.h index 034c0634c8..8a3d427356 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -1020,6 +1020,9 @@ struct BdrvChildClass { * the I/O API. */ =20 + /* + * Notifies the parent that the child was resized. + */ void (*resize)(BdrvChild *child); =20 /* --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761739983; cv=none; d=zohomail.com; s=zohoarc; b=FetqvTLywWlMojtSGI0iDpNZn0jzt8ue5fe/4P4fqqGweUXxQ2FkmxCBe/L9/oN2prTqlDQWkCTy4j4DqLEr79mIkraLUVJbQV5HZ0jR4lzTURW0foMmTdDUlMUUoy1e3LuYmj1MSGOWOSCMWPxGvlxo5hyfIfF9bMTw1uKT7mQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761739983; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/FijhaPtVn+njHJagYWTs4WzK2Cj2l6bRC57/vMRMrY=; b=jrSDMWnriDxUS0oabasT1R8w7ntgBbrcDZIMH2PGuPtMwRXwUMboaJQdqws/RPdyne2HqOStgnPZCC2c47vl/28XF9mqikEnsOorDD1RhT2xYdDhuUiqEueNZmPro+LsQWlE8ipTVunQcKifD+935BiAvqHLrJMbSkEb2DqkNKU= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761739983316607.0290180388128; Wed, 29 Oct 2025 05:13:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4zy-00055m-3z; Wed, 29 Oct 2025 08:09:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xb-0003Mf-5x for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:27 -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 1vE4xI-00054C-M4 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:26 -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-342-0CfD0bBjPxm63R2WDDvGog-1; Wed, 29 Oct 2025 08:06:59 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 0191218009C0; Wed, 29 Oct 2025 12:06:59 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B64E1180044F; Wed, 29 Oct 2025 12:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/FijhaPtVn+njHJagYWTs4WzK2Cj2l6bRC57/vMRMrY=; b=CwnKRC91IDT9K9UGIy1JSvQWaFVISerlB780d/vR5Tqo/9MuOfgAyg7vBdWd171Iq48OCd xJBcxNa51dT7j+2k2nE5pgqDoa+CxOtjO7g55LohrUarb7uu+Pah5r+eWz7qFn25Axk6lR HHK+iekbh097Umi/n9h/gXT+pOjd5uA= X-MC-Unique: 0CfD0bBjPxm63R2WDDvGog-1 X-Mimecast-MFC-AGG-ID: 0CfD0bBjPxm63R2WDDvGog_1761739619 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 11/18] block: make bdrv_co_parent_cb_resize() a proper IO API function Date: Wed, 29 Oct 2025 13:06:27 +0100 Message-ID: <20251029120634.288467-12-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761739986013154100 Content-Type: text/plain; charset="utf-8" From: Fiona Ebner In preparation for calling it via the bdrv_child_cb_resize() callback that will be added by the next commit. Rename it to include the "_co_" part while at it. Signed-off-by: Fiona Ebner Reviewed-by: Hanna Czenczek Message-ID: <20250917115509.401015-3-f.ebner@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/block_int-io.h | 6 ++++++ block/io.c | 9 +++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/block/block_int-io.h b/include/block/block_int-io.h index 4f94eb3c5a..ed8b5657d6 100644 --- a/include/block/block_int-io.h +++ b/include/block/block_int-io.h @@ -191,4 +191,10 @@ void bdrv_bsc_invalidate_range(BlockDriverState *bs, */ void bdrv_bsc_fill(BlockDriverState *bs, int64_t offset, int64_t bytes); =20 +/* + * Notify all parents that the size of the child changed. + */ +void coroutine_fn GRAPH_RDLOCK +bdrv_co_parent_cb_resize(BlockDriverState *bs); + #endif /* BLOCK_INT_IO_H */ diff --git a/block/io.c b/block/io.c index 9bd8ba8431..928c02d1ad 100644 --- a/block/io.c +++ b/block/io.c @@ -46,9 +46,6 @@ /* Maximum read size for checking if data reads as zero, in bytes */ #define MAX_ZERO_CHECK_BUFFER (128 * KiB) =20 -static void coroutine_fn GRAPH_RDLOCK -bdrv_parent_cb_resize(BlockDriverState *bs); - static int coroutine_fn bdrv_co_do_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int64_t bytes, BdrvRequestFlags flags); =20 @@ -2038,7 +2035,7 @@ bdrv_co_write_req_finish(BdrvChild *child, int64_t of= fset, int64_t bytes, end_sector > bs->total_sectors) && req->type !=3D BDRV_TRACKED_DISCARD) { bs->total_sectors =3D end_sector; - bdrv_parent_cb_resize(bs); + bdrv_co_parent_cb_resize(bs); bdrv_dirty_bitmap_truncate(bs, end_sector << BDRV_SECTOR_BITS); } if (req->bytes) { @@ -3570,11 +3567,11 @@ int coroutine_fn bdrv_co_copy_range(BdrvChild *src,= int64_t src_offset, bytes, read_flags, write_flags); } =20 -static void coroutine_fn GRAPH_RDLOCK -bdrv_parent_cb_resize(BlockDriverState *bs) +void coroutine_fn bdrv_co_parent_cb_resize(BlockDriverState *bs) { BdrvChild *c; =20 + IO_CODE(); assert_bdrv_graph_readable(); =20 QLIST_FOREACH(c, &bs->parents, next_parent) { --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761740102; cv=none; d=zohomail.com; s=zohoarc; b=Sm/OG3Q40K7MrPzsJETJfmU+bXnqw+wXbskwYt+DKNB/f41FefOZPlaLElD24hbIetF7vZDDypVAY9ku/0tTnX6w06B9F0hj6oY0Zdap327UWolbfocyw/XMGtGjCmi74lzpWn7oP4eyhj+NdMV4HU3Nlhob5tnLYYmRMvI1Jxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761740102; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BbIyghYhaD6ACyGNGxhonS1mDxvdithkaleNNsGIw/U=; b=jvvR2LtgzzbbuwzG+hYrdHgzHaV50mIbiucxPtMl/oDTVor8CLMo6woNB8cUvSGugGoS9s8eNFRH2zz44ZuRn1UvLCInJHx1FmR7OLrJzEyn/eq67MALCWLgKqAHQZwoKM+4ST9ZHi2Cqi7vkrfWksuBqZKDmlMy2XABGmaHqKU= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176174010235052.32242597366121; Wed, 29 Oct 2025 05:15:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4zA-0004AX-SZ; Wed, 29 Oct 2025 08:09:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xW-0003H3-K0 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:22 -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 1vE4xH-00052K-Bs for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:22 -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-537-KdSJxG0aObW3zM-Esd6UGg-1; Wed, 29 Oct 2025 08:07:01 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 B787118002E4; Wed, 29 Oct 2025 12:07:00 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 78DE0180044F; Wed, 29 Oct 2025 12:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BbIyghYhaD6ACyGNGxhonS1mDxvdithkaleNNsGIw/U=; b=ZHILfBfmm8tRgYsN4rezLrEagKZwdTXCnvcmUcQmlQ0sVn6Spok17jRjKAEGUhnWEBV7rV bUGunQ6uKf3Tc55Ja0bK9RByDfAgvggL+iGLQx1HTSuqor9WbFnewwaB+7Uj8cD1YyU2/c 3Bw8OVMKb0dkXh2h0O5LTLhfW9QxCVk= X-MC-Unique: KdSJxG0aObW3zM-Esd6UGg-1 X-Mimecast-MFC-AGG-ID: KdSJxG0aObW3zM-Esd6UGg_1761739620 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 12/18] block: implement 'resize' callback for child_of_bds class Date: Wed, 29 Oct 2025 13:06:28 +0100 Message-ID: <20251029120634.288467-13-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1761740103609154100 Content-Type: text/plain; charset="utf-8" From: Fiona Ebner If a filtered child is resized, the size of the parent node is now also refreshed (recursively for chains of filtered children). For filter block drivers that do not implement .bdrv_co_getlength(), this commit does not change the current behavior, because bdrv_co_refresh_total_sectors() will used the current size via the passed-in hint. This is the case for block drivers for (some) block jobs, as well as copy-before-write. Block jobs already set up a blocker preventing a QMP block_resize operation while the job is running. That does not directly cover an associated 'file' node of a 'raw' node, but resizing such a 'file' node is already prevented too (backup, commit, mirror and stream were checked). The other case is copy-before-write. This commit does not change the fact that the copy-before-write node still has the same size after its filtered child is resized. Block drivers that do implement .bdrv_co_getlength() and where .is_filter is true, already returned the length of the file child, so there is no change before and after this commit, with two exceptions: 1. preallocate can return an early data_end and otherwise queries the file child, but that special casing is not changed. 2. blkverify returns the length of the test file. This commit does not affect that behavior. Signed-off-by: Fiona Ebner Message-ID: <20250917115509.401015-4-f.ebner@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/block_int-common.h | 2 +- block.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/block/block_int-common.h b/include/block/block_int-com= mon.h index 8a3d427356..c55b35da8e 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -1023,7 +1023,7 @@ struct BdrvChildClass { /* * Notifies the parent that the child was resized. */ - void (*resize)(BdrvChild *child); + void GRAPH_RDLOCK_PTR (*resize)(BdrvChild *child); =20 /* * Returns a name that is supposedly more useful for human users than = the diff --git a/block.c b/block.c index 8848e9a7ed..cf08e64add 100644 --- a/block.c +++ b/block.c @@ -1497,6 +1497,17 @@ static void GRAPH_WRLOCK bdrv_child_cb_detach(BdrvCh= ild *child) } } =20 +static void coroutine_fn GRAPH_RDLOCK bdrv_child_cb_resize(BdrvChild *chil= d) +{ + BlockDriverState *bs =3D child->opaque; + + if (child->role & BDRV_CHILD_FILTERED) { + /* Best effort, ignore errors. */ + bdrv_co_refresh_total_sectors(bs, bs->total_sectors); + bdrv_co_parent_cb_resize(bs); + } +} + static int bdrv_child_cb_update_filename(BdrvChild *c, BlockDriverState *b= ase, const char *filename, bool backing_mask_protocol, @@ -1529,6 +1540,7 @@ const BdrvChildClass child_of_bds =3D { .detach =3D bdrv_child_cb_detach, .inactivate =3D bdrv_child_cb_inactivate, .change_aio_ctx =3D bdrv_child_cb_change_aio_ctx, + .resize =3D bdrv_child_cb_resize, .update_filename =3D bdrv_child_cb_update_filename, .get_parent_aio_context =3D child_of_bds_get_parent_aio_context, }; --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761739981; cv=none; d=zohomail.com; s=zohoarc; b=VZFIVHLiCchtBuBO0DCeUW1wR/VvIlL/B22s86kMlX9spIGsUPFLfTVcGBLhepYgz7qCqY91GUsR64+YaJcUTsf57Uq/U29hGK47qnqmk4jK4OktOw6z0N8LlgNtJ3TMHF3H18oQXCtfkkemioZA4QE2Pk/xkgOTpFBAN/blehE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761739981; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cCZx8pQMWF2V6jc7yz6lG5be+du26mLG0xjV3VyCdtA=; b=md3N67qDe8SxaiJ7J0T4T5r7z4v/wsaO5iQW1lldSJgZqZgfLAXSuKB40AzjkeStwUvmFuROlX0uur1YqfLT/WfrLK+n7UJS1qVamIoiT3ri8mQr2llBVSGlY15u4AZRAuXDlnOCRNraIsXiCw5lM4k0M2fJ215A2yCxX7f2n9w= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761739981065730.9236562740613; Wed, 29 Oct 2025 05:13:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4xy-0003QP-Q1; Wed, 29 Oct 2025 08:07:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xi-0003P9-Eo for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07: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 1vE4xK-00054J-Ke for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:31 -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-439-ez5XbZFBOeKn4Q-uNv_UEg-1; Wed, 29 Oct 2025 08:07:03 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 77E10180121B; Wed, 29 Oct 2025 12:07:02 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 39FDB180044F; Wed, 29 Oct 2025 12:07:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cCZx8pQMWF2V6jc7yz6lG5be+du26mLG0xjV3VyCdtA=; b=VVGhgkWldFZDnxa1bNPqbnI6JOtlsnzJ/8QZUzSG8zneye+B3nF+XDa1fQE4C4HhAqUkwt jLcrMoTtvwv7zMg0TKqnvELMTsQyyMAxGMKSt739xthxRAiLJirWqaqIeKNukLB5XUfjfS dDvlxt+fwpHEpitp9D4nUGPQ8H0eby0= X-MC-Unique: ez5XbZFBOeKn4Q-uNv_UEg-1 X-Mimecast-MFC-AGG-ID: ez5XbZFBOeKn4Q-uNv_UEg_1761739622 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 13/18] iotests: add test for resizing a node below filters Date: Wed, 29 Oct 2025 13:06:29 +0100 Message-ID: <20251029120634.288467-14-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761740001114158501 Content-Type: text/plain; charset="utf-8" From: Fiona Ebner Signed-off-by: Fiona Ebner Reviewed-by: Hanna Czenczek Message-ID: <20250917115509.401015-5-f.ebner@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/tests/resize-below-filter | 73 +++++++++++++++++++ .../tests/resize-below-filter.out | 5 ++ 2 files changed, 78 insertions(+) create mode 100755 tests/qemu-iotests/tests/resize-below-filter create mode 100644 tests/qemu-iotests/tests/resize-below-filter.out diff --git a/tests/qemu-iotests/tests/resize-below-filter b/tests/qemu-iote= sts/tests/resize-below-filter new file mode 100755 index 0000000000..f55619cf34 --- /dev/null +++ b/tests/qemu-iotests/tests/resize-below-filter @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 +# group: rw quick +# +# Test what happens when a node below filter nodes is resized. +# +# Copyright (C) Proxmox Server Solutions GmbH +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os +import iotests +from iotests import imgfmt, qemu_img_create, QMPTestCase + +image_size =3D 1 * 1024 * 1024 +image =3D os.path.join(iotests.test_dir, 'test.img') + +class TestResizeBelowFilter(QMPTestCase): + def setUp(self) -> None: + qemu_img_create('-f', imgfmt, image, str(image_size)) + + self.vm =3D iotests.VM() + self.vm.add_blockdev(self.vm.qmp_to_opts({ + 'driver': imgfmt, + 'node-name': 'node0', + 'file': { + 'driver': 'file', + 'filename': image, + } + })) + self.vm.add_blockdev(self.vm.qmp_to_opts({ + 'driver': 'compress', + 'node-name': 'comp0', + 'file': 'node0', + })) + self.vm.add_object('throttle-group,id=3Dthrgr0') + self.vm.add_blockdev(self.vm.qmp_to_opts({ + 'driver': 'throttle', + 'node-name': 'thr0', + 'throttle-group': 'thrgr0', + 'file': 'comp0', + })) + self.vm.add_object('throttle-group,id=3Dthrgr1') + self.vm.add_blockdev(self.vm.qmp_to_opts({ + 'driver': 'throttle', + 'node-name': 'thr1', + 'throttle-group': 'thrgr1', + 'file': 'node0', + })) + self.vm.launch() + + def tearDown(self) -> None: + self.vm.shutdown() + os.remove(image) + + def assert_size(self, size: int) -> None: + nodes =3D self.vm.qmp('query-named-block-nodes', flat=3DTrue)['ret= urn'] + self.assertEqual(len(nodes), 5) + for node in nodes: + if node['drv'] =3D=3D 'file': + continue + self.assertEqual(node['image']['virtual-size'], size) + + def test_resize_below_filter(self) -> None: + self.assert_size(image_size) + self.vm.qmp('block_resize', node_name=3D'thr0', size=3D2*image_siz= e) + self.assert_size(2*image_size) + self.vm.qmp('block_resize', node_name=3D'comp0', size=3D3*image_si= ze) + self.assert_size(3*image_size) + self.vm.qmp('block_resize', node_name=3D'node0', size=3D4*image_si= ze) + self.assert_size(4*image_size) + +if __name__ =3D=3D '__main__': + iotests.main(supported_fmts=3D['qcow2'], supported_protocols=3D['file'= ]) diff --git a/tests/qemu-iotests/tests/resize-below-filter.out b/tests/qemu-= iotests/tests/resize-below-filter.out new file mode 100644 index 0000000000..ae1213e6f8 --- /dev/null +++ b/tests/qemu-iotests/tests/resize-below-filter.out @@ -0,0 +1,5 @@ +. +---------------------------------------------------------------------- +Ran 1 tests + +OK --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761739787; cv=none; d=zohomail.com; s=zohoarc; b=IRHJg6Q+T1oLjbIqhRVIcx1ne/kl3ZIoUulgzIwvi+ylHOt80ChoRLYGN79Cd8gLc+DGSBcJduvMPKtAIHGnZCh1sCMFkvpX+3IBhtLkT4xVd7xenlr7hljOpK4Cs36KTI/jg1Ca4/s835hXenmg+2rJmJAMUb0DLnkFZbTXq5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761739787; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+1Ut9r8lCcnqPAU7QxkJlD7etLQhVb4lI9907JqxRfU=; b=lsOBImNY7b+/8HrvqKz5uQUfPMJboz+Y4Z3gAvtNL0lMfZbp6wD//0ExEPmauLq9H0safHjk+9fRaFaFCvgav8HnY0aYNl1r+t7vwxsburudMID82Jcoh70obOHsWIme2b6WowGoRer021nfoWK6vnxdiVvtkPRGhODlpgNgtbo= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761739787615431.1074319072949; Wed, 29 Oct 2025 05:09:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4yC-0003di-Vr; Wed, 29 Oct 2025 08:08:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xr-0003Qi-8c for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:45 -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 1vE4xM-000550-I0 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:42 -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-513-07uXfyblNEqync_l67RqRw-1; Wed, 29 Oct 2025 08:07:05 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 396071800D8D; Wed, 29 Oct 2025 12:07:04 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EEDF0180044F; Wed, 29 Oct 2025 12:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+1Ut9r8lCcnqPAU7QxkJlD7etLQhVb4lI9907JqxRfU=; b=YFUpKY1y90vtdoHM8d225ZYoEdSn7EJ1XVGYmK+b0LfkIeLBMhkTmPQHA6q0JoM6DF+uUI Lsu2NTsbJm6SMdDxa5YGyzQPad8wweFZZRQx3+iNjKHSAzc93GRK8pMVH3p9JyWx14i046 JiTHRUMqBwmdXEXG8zHMzDSnxxwopRo= X-MC-Unique: 07uXfyblNEqync_l67RqRw-1 X-Mimecast-MFC-AGG-ID: 07uXfyblNEqync_l67RqRw_1761739624 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 14/18] iotests: add test for resizing a 'file' node below a 'raw' node Date: Wed, 29 Oct 2025 13:06:30 +0100 Message-ID: <20251029120634.288467-15-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761739802815158500 Content-Type: text/plain; charset="utf-8" From: Fiona Ebner Signed-off-by: Fiona Ebner Message-ID: <20250917115509.401015-6-f.ebner@proxmox.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/tests/resize-below-raw | 53 +++++++++++++++++++ tests/qemu-iotests/tests/resize-below-raw.out | 5 ++ 2 files changed, 58 insertions(+) create mode 100755 tests/qemu-iotests/tests/resize-below-raw create mode 100644 tests/qemu-iotests/tests/resize-below-raw.out diff --git a/tests/qemu-iotests/tests/resize-below-raw b/tests/qemu-iotests= /tests/resize-below-raw new file mode 100755 index 0000000000..3c9241c918 --- /dev/null +++ b/tests/qemu-iotests/tests/resize-below-raw @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# group: rw quick +# +# Test what happens when a 'file' node below a 'raw' node is resized. +# +# Copyright (C) Proxmox Server Solutions GmbH +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os +import iotests +from iotests import imgfmt, qemu_img_create, QMPTestCase + +image_size =3D 1 * 1024 * 1024 +image =3D os.path.join(iotests.test_dir, 'test.img') + +class TestResizeBelowRaw(QMPTestCase): + def setUp(self) -> None: + qemu_img_create('-f', imgfmt, image, str(image_size)) + + self.vm =3D iotests.VM() + self.vm.add_blockdev(self.vm.qmp_to_opts({ + 'driver': imgfmt, + 'node-name': 'node0', + 'file': { + 'driver': 'file', + 'filename': image, + 'node-name': 'file0', + } + })) + self.vm.launch() + + def tearDown(self) -> None: + self.vm.shutdown() + os.remove(image) + + def assert_size(self, size: int) -> None: + nodes =3D self.vm.qmp('query-named-block-nodes', flat=3DTrue)['ret= urn'] + self.assertEqual(len(nodes), 2) + for node in nodes: + if node['drv'] =3D=3D 'file': + continue + self.assertEqual(node['image']['virtual-size'], size) + + def test_resize_below_raw(self) -> None: + self.assert_size(image_size) + self.vm.qmp('block_resize', node_name=3D'file0', size=3D2*image_si= ze) + self.assert_size(2*image_size) + self.vm.qmp('block_resize', node_name=3D'node0', size=3D3*image_si= ze) + self.assert_size(3*image_size) + +if __name__ =3D=3D '__main__': + iotests.main(supported_fmts=3D['raw'], supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/tests/resize-below-raw.out b/tests/qemu-iot= ests/tests/resize-below-raw.out new file mode 100644 index 0000000000..ae1213e6f8 --- /dev/null +++ b/tests/qemu-iotests/tests/resize-below-raw.out @@ -0,0 +1,5 @@ +. +---------------------------------------------------------------------- +Ran 1 tests + +OK --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761739888; cv=none; d=zohomail.com; s=zohoarc; b=KL169VPEzr+5E2HfyCpkq4nTL5Uw2UaQzdkrVgEBplDHdTHpGp4tC6TJfTmGOptKkEJM8lKCG0GTJT0kWtci7D4GGmI2Qj8u7gze5hFJ2hfhoBl2ksbhaOCuKndwDqWGm4SoqXsm5zIfySfdnp+KbJkKn+pQpEyGBgwdHO59GH4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761739888; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PtAAnCMnWfQp6D27CSN/aCx9dp2ZDJqLGDcQmHk6UmY=; b=Z3s1j6Y0rw1HflyXnmFGG3jddVaHk/7GnfMA9BYxGqrhpI5aQPS9x+Fab4pNsA4u4AquGcjpXnhyFXYRVbDwecjhxSh8EuLUMgPYfFHB0RoCfrdiPodWOCOB3qXHvRlKOQfaf62Pzmv8QbvhAnLB3grr6ZQOqJO+Pk7c70LGYek= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761739888927983.3747680170574; Wed, 29 Oct 2025 05:11:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE50J-0005M1-1M; Wed, 29 Oct 2025 08:10:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xl-0003PY-16 for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:38 -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 1vE4xL-00054x-6V for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:35 -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-551-dHTALuoZNJWQ3tVmJGj0gA-1; Wed, 29 Oct 2025 08:07:06 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 EDB8A1809A04; Wed, 29 Oct 2025 12:07:05 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AF11A180057C; Wed, 29 Oct 2025 12:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PtAAnCMnWfQp6D27CSN/aCx9dp2ZDJqLGDcQmHk6UmY=; b=I1DFxX9vH/5gZQDuyj7R7tb8sRftIMyzG7DtNNdNUvH3yw9TMSDXf9RBmYBOiaitCfyUhl kIWc2ZjcVXeZ5EcTuGwxqNQKqHjZSL+IloRHW+tpFEMr03zqNerbF9HP37YvvtrH9fPK6H WFepMeGztoxg53OfygXONYaZofI05xI= X-MC-Unique: dHTALuoZNJWQ3tVmJGj0gA-1 X-Mimecast-MFC-AGG-ID: dHTALuoZNJWQ3tVmJGj0gA_1761739626 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 15/18] block: Improve comments in BlockLimits Date: Wed, 29 Oct 2025 13:06:31 +0100 Message-ID: <20251029120634.288467-16-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1761739894042158500 Content-Type: text/plain; charset="utf-8" Patches to expose the limits in QAPI have made clear that the existing documentation of BlockLimits could be improved: The meaning of min_mem_alignment and opt_mem_alignment could be clearer, and talking about better alignment values isn't helpful when we only detect these values and never choose them. Make the changes in the BlockLimits documentation now, so that the patches exposing the fields in QAPI can use descriptions consistent with it. Signed-off-by: Kevin Wolf Message-ID: <20251024123041.51254-2-kwolf@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- include/block/block_int-common.h | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/include/block/block_int-common.h b/include/block/block_int-com= mon.h index c55b35da8e..f2a4e863fc 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -817,10 +817,10 @@ typedef struct BlockLimits { int64_t max_pdiscard; =20 /* - * Optimal alignment for discard requests in bytes. A power of 2 - * is best but not mandatory. Must be a multiple of - * bl.request_alignment, and must be less than max_pdiscard if - * that is set. May be 0 if bl.request_alignment is good enough + * Optimal alignment for discard requests in bytes. Note that this doe= sn't + * have to be a power of two. Must be a multiple of bl.request_alignme= nt, + * and must be less than max_pdiscard if that is set. May be 0 if + * bl.request_alignment is good enough. */ uint32_t pdiscard_alignment; =20 @@ -831,11 +831,10 @@ typedef struct BlockLimits { int64_t max_pwrite_zeroes; =20 /* - * Optimal alignment for write zeroes requests in bytes. A power - * of 2 is best but not mandatory. Must be a multiple of - * bl.request_alignment, and must be less than max_pwrite_zeroes - * if that is set. May be 0 if bl.request_alignment is good - * enough + * Optimal alignment for write zeroes requests in bytes. Note that this + * doesn't have to be a power of two. Must be a multiple of + * bl.request_alignment, and must be less than max_pwrite_zeroes if th= at is + * set. May be 0 if bl.request_alignment is good enough. */ uint32_t pwrite_zeroes_alignment; =20 @@ -863,18 +862,23 @@ typedef struct BlockLimits { uint64_t max_hw_transfer; =20 /* - * Maximal number of scatter/gather elements allowed by the hardware. + * Maximum number of scatter/gather elements allowed by the hardware. * Applies whenever transfers to the device bypass the kernel I/O * scheduler, for example with SG_IO. If larger than max_iov * or if zero, blk_get_max_hw_iov will fall back to max_iov. */ int max_hw_iov; =20 - - /* memory alignment, in bytes so that no bounce buffer is needed */ + /* + * Minimal required memory alignment in bytes for zero-copy I/O to suc= ceed. + * For unaligned requests, a bounce buffer will be used. + */ size_t min_mem_alignment; =20 - /* memory alignment, in bytes, for bounce buffer */ + /* + * Optimal memory alignment in bytes. This is the alignment used for a= ny + * buffer allocations QEMU performs internally. + */ size_t opt_mem_alignment; =20 /* maximum number of iovec elements */ --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761739732; cv=none; d=zohomail.com; s=zohoarc; b=CzavXnPMiRV9woMdb/gx2r7tu6pIP0ShtKGA1yKoHDkK+Dhh6pJeXnH2UwhxjMkdjusTeqRTiEtFKmg/MuCOGhk8/1WxJ2+revfnQyS4I5+szuLR3yZYw4m4IAkNvOlBzL24dGyUy6rfpEhaAc0l0rsDc3zUkNxtXD6Ij3kHUXA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761739732; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FyqoyCe+Fki368LdFpQ/PHv0E9dWGI0wxaS9HS7unbY=; b=FEguAJ9D+GXsnlW8jH9V6tFqT5wKET83BK2FM3OFeTzF5t+XwKnz2HItHct6JIv2OP8/DXJF4vf6CaSd8SPsLuUGGIxJg8ttVB02fS2Sf3SoLkat4zdXzpRBT+r755iJwK5le3a/+vesXToknRZXDDW/JMxvyLcDhxZgGBR4MAY= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761739732189353.07552083298424; Wed, 29 Oct 2025 05:08:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE4y9-0003YX-Pp; Wed, 29 Oct 2025 08:08:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xw-0003R7-Cb for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:52 -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 1vE4xP-000562-8W for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:47 -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-656-FJ8_NvvvORSF-N-zu7IZVw-1; Wed, 29 Oct 2025 08:07:08 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 AFF0F180121E; Wed, 29 Oct 2025 12:07:07 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 717AF180044F; Wed, 29 Oct 2025 12:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FyqoyCe+Fki368LdFpQ/PHv0E9dWGI0wxaS9HS7unbY=; b=fE9fcl4FfTWIkVZZunXqIoWqHRTn7DhJZu/BSl/7AK8oRZh0VrE86ZrscQsR++bW8SlTsp Km8oFRtZ0eT28+thh84dmXqoKdrNVPE6+tzvdbtJO4VtCJkcch9thtiWXzPXwQYQrsCD3c 0QNEivCgVerjwohoX1q4GbgNDQf4WXY= X-MC-Unique: FJ8_NvvvORSF-N-zu7IZVw-1 X-Mimecast-MFC-AGG-ID: FJ8_NvvvORSF-N-zu7IZVw_1761739627 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 16/18] block: Expose block limits for images in QMP Date: Wed, 29 Oct 2025 13:06:32 +0100 Message-ID: <20251029120634.288467-17-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1761739746394158500 Content-Type: text/plain; charset="utf-8" This information can be useful both for debugging and for management tools trying to configure guest devices with the optimal limits (possibly across multiple hosts). There is no reason not to make it available, so just add it to BlockNodeInfo. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Hanna Czenczek Message-ID: <20251024123041.51254-3-kwolf@redhat.com> Signed-off-by: Kevin Wolf --- qapi/block-core.json | 66 ++++++++++++++++++++++++++++++++ block/qapi.c | 34 ++++++++++++++-- tests/qemu-iotests/184 | 5 ++- tests/qemu-iotests/184.out | 8 ---- tests/qemu-iotests/common.filter | 3 +- 5 files changed, 102 insertions(+), 14 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index dc6eb4ae23..2c037183f0 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -275,6 +275,69 @@ 'file': 'ImageInfoSpecificFileWrapper' } } =20 +## +# @BlockLimitsInfo: +# +# @request-alignment: Alignment requirement, in bytes, for +# offset/length of I/O requests. +# +# @max-discard: Maximum number of bytes that can be discarded at once. +# If not present, there is no specific maximum. +# +# @discard-alignment: Optimal alignment for discard requests in bytes. +# Note that this doesn't have to be a power of two. If not +# present, discards don't have a alignment requirement different +# from @request-alignment. +# +# @max-write-zeroes: Maximum number of bytes that can be zeroed out at +# once. If not present, there is no specific maximum. +# +# @write-zeroes-alignment: Optimal alignment for write zeroes requests +# in bytes. Note that this doesn't have to be a power of two. If +# not present, write_zeroes doesn't have a alignment requirement +# different from @request-alignment. +# +# @opt-transfer: Optimal transfer length in bytes. If not present, +# there is no preferred size. +# +# @max-transfer: Maximal transfer length in bytes. If not present, +# there is no specific maximum. +# +# @max-hw-transfer: Maximal hardware transfer length in bytes. +# Applies whenever transfers to the device bypass the kernel I/O +# scheduler, for example with SG_IO. If not present, there is no +# specific maximum. +# +# @max-iov: Maximum number of scatter/gather elements +# +# @max-hw-iov: Maximum number of scatter/gather elements allowed by +# the hardware. Applies whenever transfers to the device bypass +# the kernel I/O scheduler, for example with SG_IO. If not +# present, the hardware limits is unknown and @max-iov is always +# used. +# +# @min-mem-alignment: Minimal required memory alignment in bytes for +# zero-copy I/O to succeed. For unaligned requests, a bounce +# buffer will be used. +# +# @opt-mem-alignment: Optimal memory alignment in bytes. This is the +# alignment used for any buffer allocations QEMU performs +# internally. +## +{ 'struct': 'BlockLimitsInfo', + 'data': { 'request-alignment': 'uint32', + '*max-discard': 'uint64', + '*discard-alignment': 'uint32', + '*max-write-zeroes': 'uint64', + '*write-zeroes-alignment': 'uint32', + '*opt-transfer': 'uint32', + '*max-transfer': 'uint32', + '*max-hw-transfer': 'uint32', + 'max-iov': 'int', + '*max-hw-iov': 'int', + 'min-mem-alignment': 'size', + 'opt-mem-alignment': 'size' } } + ## # @BlockNodeInfo: # @@ -304,6 +367,8 @@ # # @snapshots: list of VM snapshots # +# @limits: block limits that are used for I/O on the node (Since 10.2) +# # @format-specific: structure supplying additional format-specific # information (since 1.7) # @@ -315,6 +380,7 @@ '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'b= ool', '*backing-filename': 'str', '*full-backing-filename': 'str', '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo= '], + '*limits': 'BlockLimitsInfo', '*format-specific': 'ImageInfoSpecific' } } =20 ## diff --git a/block/qapi.c b/block/qapi.c index 12fbf8d1b7..54521d0a68 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -235,7 +235,8 @@ int bdrv_query_snapshot_info_list(BlockDriverState *bs, * in @info, setting @errp on error. */ static void GRAPH_RDLOCK -bdrv_do_query_node_info(BlockDriverState *bs, BlockNodeInfo *info, Error *= *errp) +bdrv_do_query_node_info(BlockDriverState *bs, BlockNodeInfo *info, bool li= mits, + Error **errp) { int64_t size; const char *backing_filename; @@ -269,6 +270,33 @@ bdrv_do_query_node_info(BlockDriverState *bs, BlockNod= eInfo *info, Error **errp) info->dirty_flag =3D bdi.is_dirty; info->has_dirty_flag =3D true; } + + if (limits) { + info->limits =3D g_new(BlockLimitsInfo, 1); + *info->limits =3D (BlockLimitsInfo) { + .request_alignment =3D bs->bl.request_alignment, + .has_max_discard =3D bs->bl.max_pdiscard !=3D 0, + .max_discard =3D bs->bl.max_pdiscard, + .has_discard_alignment =3D bs->bl.pdiscard_alignment !=3D= 0, + .discard_alignment =3D bs->bl.pdiscard_alignment, + .has_max_write_zeroes =3D bs->bl.max_pwrite_zeroes !=3D = 0, + .max_write_zeroes =3D bs->bl.max_pwrite_zeroes, + .has_write_zeroes_alignment =3D bs->bl.pwrite_zeroes_alignment= !=3D 0, + .write_zeroes_alignment =3D bs->bl.pwrite_zeroes_alignment, + .has_opt_transfer =3D bs->bl.opt_transfer !=3D 0, + .opt_transfer =3D bs->bl.opt_transfer, + .has_max_transfer =3D bs->bl.max_transfer !=3D 0, + .max_transfer =3D bs->bl.max_transfer, + .has_max_hw_transfer =3D bs->bl.max_hw_transfer !=3D 0, + .max_hw_transfer =3D bs->bl.max_hw_transfer, + .max_iov =3D bs->bl.max_iov, + .has_max_hw_iov =3D bs->bl.max_hw_iov !=3D 0, + .max_hw_iov =3D bs->bl.max_hw_iov, + .min_mem_alignment =3D bs->bl.min_mem_alignment, + .opt_mem_alignment =3D bs->bl.opt_mem_alignment, + }; + } + info->format_specific =3D bdrv_get_specific_info(bs, &err); if (err) { error_propagate(errp, err); @@ -343,7 +371,7 @@ void bdrv_query_image_info(BlockDriverState *bs, ImageInfo *info; =20 info =3D g_new0(ImageInfo, 1); - bdrv_do_query_node_info(bs, qapi_ImageInfo_base(info), errp); + bdrv_do_query_node_info(bs, qapi_ImageInfo_base(info), true, errp); if (*errp) { goto fail; } @@ -397,7 +425,7 @@ void bdrv_query_block_graph_info(BlockDriverState *bs, BdrvChild *c; =20 info =3D g_new0(BlockGraphInfo, 1); - bdrv_do_query_node_info(bs, qapi_BlockGraphInfo_base(info), errp); + bdrv_do_query_node_info(bs, qapi_BlockGraphInfo_base(info), false, err= p); if (*errp) { goto fail; } diff --git a/tests/qemu-iotests/184 b/tests/qemu-iotests/184 index e4cbcd8634..6d0afe9d38 100755 --- a/tests/qemu-iotests/184 +++ b/tests/qemu-iotests/184 @@ -45,8 +45,9 @@ do_run_qemu() =20 run_qemu() { - do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_qmp\ - | _filter_qemu_io | _filter_generated_node_ids + do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_qmp \ + | _filter_qemu_io | _filter_generated_node_ids \ + | _filter_img_info } =20 test_throttle=3D$($QEMU_IMG --help|grep throttle) diff --git a/tests/qemu-iotests/184.out b/tests/qemu-iotests/184.out index ef99bb2e9a..52692b6b3b 100644 --- a/tests/qemu-iotests/184.out +++ b/tests/qemu-iotests/184.out @@ -41,12 +41,6 @@ Testing: }, "iops_wr": 0, "ro": false, - "children": [ - { - "node-name": "disk0", - "child": "file" - } - ], "node-name": "throttle0", "backing_file_depth": 1, "drv": "throttle", @@ -75,8 +69,6 @@ Testing: }, "iops_wr": 0, "ro": false, - "children": [ - ], "node-name": "disk0", "backing_file_depth": 0, "drv": "null-co", diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.f= ilter index 511a55b1e8..26e6b45b04 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -229,6 +229,7 @@ _filter_img_info() discard=3D0 regex_json_spec_start=3D'^ *"format-specific": \{' regex_json_child_start=3D'^ *"children": \[' + regex_json_limit_start=3D'^ *"limits": \{' gsed -e "s#$REMOTE_TEST_DIR#TEST_DIR#g" \ -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \ -e "s#$TEST_DIR#TEST_DIR#g" \ @@ -261,7 +262,7 @@ _filter_img_info() discard=3D1 elif [[ $line =3D~ "Child node '/" ]]; then discard=3D1 - elif [[ $line =3D~ $regex_json_spec_start ]]; then + elif [[ $line =3D~ $regex_json_spec_start || $line =3D~ $regex= _json_limit_start ]]; then discard=3D2 regex_json_end=3D"^${line%%[^ ]*}\\},? *$" elif [[ $line =3D~ $regex_json_child_start ]]; then --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761740053; cv=none; d=zohomail.com; s=zohoarc; b=XFSvu/vhaS0AiGQ099e/Wstt6xOW3z1mHGyhUvoggG+8tcxELy2Nonv/3g/KPI2Q3dpLQhz3pH5AXhx3Uk5U0dTBJUcJ5r9nWBzHPcBETK0+J0k88C/qFt7GTeTmiti0Re8BXzpSIJAUPE5iKiLSZljqXzvQOmBNaAeOm3DVMZ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761740053; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=l/R3cngSTl1RFIZ+auMj6lyWa7k0mkGS4J9oO8ESzdQ=; b=HLW6Wjt1Fnrcym14Rivk9q4Oj7ECSLJS4PpWaV5tILDpUz0obF+7F8mw4BoXeeoxfHBD4vSi0NqDFeFwGgmf50XiZJwl+Rm0CmMlTK9Aau84P/nhhywsVgAo/cxstqtnf9VX3nLCVsxXe0v8nVEThb8RPCEmFSTQc0m4aLgTO10= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761740053602878.8140916343103; Wed, 29 Oct 2025 05:14:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE50t-00067O-Bd; Wed, 29 Oct 2025 08:10:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xx-0003RM-OI for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:52 -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 1vE4xR-000573-0V for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:49 -0400 Received: from mx-prod-mc-02.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-632-nU5EhVasPEaVZSaOo4wj3g-1; Wed, 29 Oct 2025 08:07:10 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 737DF195609D; Wed, 29 Oct 2025 12:07:09 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 32C8D180057C; Wed, 29 Oct 2025 12:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l/R3cngSTl1RFIZ+auMj6lyWa7k0mkGS4J9oO8ESzdQ=; b=M9D60scoe2TEUlnWgzRpXTpZc8pW11nDbarwq3s3ccXPpcXluQNvchdWezPVhepuhZtkC5 AFBQCOeg1bmQtxVn2kSHAwsXepYgct4DMWsRmc895fd5w7/J6wn10s80zrqW/2muLG4p1C 9xlv/Apj6/q3JuIphKyqTa1Hs+VxBmc= X-MC-Unique: nU5EhVasPEaVZSaOo4wj3g-1 X-Mimecast-MFC-AGG-ID: nU5EhVasPEaVZSaOo4wj3g_1761739629 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 17/18] qemu-img info: Optionally show block limits Date: Wed, 29 Oct 2025 13:06:33 +0100 Message-ID: <20251029120634.288467-18-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1761740063828158500 Content-Type: text/plain; charset="utf-8" Add a new --limits option to 'qemu-img info' that displays the block limits for the image and all of its children, making the information more accessible for human users than in QMP. This option is not enabled by default because it can be a lot of output that isn't usually relevant if you're not specifically trying to diagnose some I/O problem. This makes the same information automatically also available in HMP 'info block -v'. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Hanna Czenczek Message-ID: <20251024123041.51254-4-kwolf@redhat.com> Signed-off-by: Kevin Wolf --- docs/tools/qemu-img.rst | 6 +++++- include/block/qapi.h | 2 +- block/qapi.c | 34 ++++++++++++++++++++++++++++++++-- qemu-img.c | 15 ++++++++++++--- qemu-img-cmds.hx | 4 ++-- 5 files changed, 52 insertions(+), 9 deletions(-) diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst index 5e7b85079d..fdc9ea9cf2 100644 --- a/docs/tools/qemu-img.rst +++ b/docs/tools/qemu-img.rst @@ -503,7 +503,7 @@ Command description: =20 The size syntax is similar to :manpage:`dd(1)`'s size syntax. =20 -.. option:: info [--object OBJECTDEF] [--image-opts] [-f FMT] [--output=3D= OFMT] [--backing-chain] [-U] FILENAME +.. option:: info [--object OBJECTDEF] [--image-opts] [-f FMT] [--output=3D= OFMT] [--backing-chain] [--limits] [-U] FILENAME =20 Give information about the disk image *FILENAME*. Use it in particular to know the size reserved on disk which can be different @@ -571,6 +571,10 @@ Command description: ``ImageInfoSpecific*`` QAPI object (e.g. ``ImageInfoSpecificQCow2`` for qcow2 images). =20 + *Block limits* + The block limits for I/O that QEMU detected for the image. + This information is only shown if the ``--limits`` option was specifie= d. + .. option:: map [--object OBJECTDEF] [--image-opts] [-f FMT] [--start-offs= et=3DOFFSET] [--max-length=3DLEN] [--output=3DOFMT] [-U] FILENAME =20 Dump the metadata of image *FILENAME* and its backing file chain. diff --git a/include/block/qapi.h b/include/block/qapi.h index 54c48de26a..be554e53dc 100644 --- a/include/block/qapi.h +++ b/include/block/qapi.h @@ -42,7 +42,7 @@ bdrv_query_image_info(BlockDriverState *bs, ImageInfo **p= _info, bool flat, bool skip_implicit_filters, Error **errp); void GRAPH_RDLOCK bdrv_query_block_graph_info(BlockDriverState *bs, BlockGraphInfo **p_info, - Error **errp); + bool limits, Error **errp); =20 void bdrv_snapshot_dump(QEMUSnapshotInfo *sn); void bdrv_image_info_specific_dump(ImageInfoSpecific *info_spec, diff --git a/block/qapi.c b/block/qapi.c index 54521d0a68..9f5771e019 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -417,6 +417,7 @@ fail: */ void bdrv_query_block_graph_info(BlockDriverState *bs, BlockGraphInfo **p_info, + bool limits, Error **errp) { ERRP_GUARD(); @@ -425,7 +426,7 @@ void bdrv_query_block_graph_info(BlockDriverState *bs, BdrvChild *c; =20 info =3D g_new0(BlockGraphInfo, 1); - bdrv_do_query_node_info(bs, qapi_BlockGraphInfo_base(info), false, err= p); + bdrv_do_query_node_info(bs, qapi_BlockGraphInfo_base(info), limits, er= rp); if (*errp) { goto fail; } @@ -439,7 +440,7 @@ void bdrv_query_block_graph_info(BlockDriverState *bs, QAPI_LIST_APPEND(children_list_tail, c_info); =20 c_info->name =3D g_strdup(c->name); - bdrv_query_block_graph_info(c->bs, &c_info->info, errp); + bdrv_query_block_graph_info(c->bs, &c_info->info, limits, errp); if (*errp) { goto fail; } @@ -936,6 +937,29 @@ void bdrv_image_info_specific_dump(ImageInfoSpecific *= info_spec, visit_free(v); } =20 +/** + * Dumps the given BlockLimitsInfo object in a human-readable form, + * prepending an optional prefix if the dump is not empty. + */ +static void bdrv_image_info_limits_dump(BlockLimitsInfo *limits, + const char *prefix, + int indentation) +{ + QObject *obj; + Visitor *v =3D qobject_output_visitor_new(&obj); + + visit_type_BlockLimitsInfo(v, NULL, &limits, &error_abort); + visit_complete(v, &obj); + if (!qobject_is_empty_dump(obj)) { + if (prefix) { + qemu_printf("%*s%s", indentation * 4, "", prefix); + } + dump_qobject(indentation + 1, obj); + } + qobject_unref(obj); + visit_free(v); +} + /** * Print the given @info object in human-readable form. Every field is in= dented * using the given @indentation (four spaces per indentation level). @@ -1011,6 +1035,12 @@ void bdrv_node_info_dump(BlockNodeInfo *info, int in= dentation, bool protocol) } } =20 + if (info->limits) { + bdrv_image_info_limits_dump(info->limits, + "Block limits:\n", + indentation); + } + if (info->has_snapshots) { SnapshotInfoList *elem; =20 diff --git a/qemu-img.c b/qemu-img.c index 7a162fdc08..5cdbeda969 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -86,6 +86,7 @@ enum { OPTION_BITMAPS =3D 275, OPTION_FORCE =3D 276, OPTION_SKIP_BROKEN =3D 277, + OPTION_LIMITS =3D 278, }; =20 typedef enum OutputFormat { @@ -3002,7 +3003,8 @@ static gboolean str_equal_func(gconstpointer a, gcons= tpointer b) static BlockGraphInfoList *collect_image_info_list(bool image_opts, const char *filename, const char *fmt, - bool chain, bool force_= share) + bool chain, bool limits, + bool force_share) { BlockGraphInfoList *head =3D NULL; BlockGraphInfoList **tail =3D &head; @@ -3039,7 +3041,7 @@ static BlockGraphInfoList *collect_image_info_list(bo= ol image_opts, * the chain manually here. */ bdrv_graph_rdlock_main_loop(); - bdrv_query_block_graph_info(bs, &info, &err); + bdrv_query_block_graph_info(bs, &info, limits, &err); bdrv_graph_rdunlock_main_loop(); =20 if (err) { @@ -3088,6 +3090,7 @@ static int img_info(const img_cmd_t *ccmd, int argc, = char **argv) BlockGraphInfoList *list; bool image_opts =3D false; bool force_share =3D false; + bool limits =3D false; =20 fmt =3D NULL; for(;;) { @@ -3097,6 +3100,7 @@ static int img_info(const img_cmd_t *ccmd, int argc, = char **argv) {"image-opts", no_argument, 0, OPTION_IMAGE_OPTS}, {"backing-chain", no_argument, 0, OPTION_BACKING_CHAIN}, {"force-share", no_argument, 0, 'U'}, + {"limits", no_argument, 0, OPTION_LIMITS}, {"output", required_argument, 0, OPTION_OUTPUT}, {"object", required_argument, 0, OPTION_OBJECT}, {0, 0, 0, 0} @@ -3119,6 +3123,8 @@ static int img_info(const img_cmd_t *ccmd, int argc, = char **argv) " display information about the backing chain for copy-on-write overla= ys\n" " -U, --force-share\n" " open image in shared mode for concurrent access\n" +" --limits\n" +" show detected block limits (may depend on options, e.g. cache mode)\= n" " --output human|json\n" " specify output format (default: human)\n" " --object OBJDEF\n" @@ -3140,6 +3146,9 @@ static int img_info(const img_cmd_t *ccmd, int argc, = char **argv) case 'U': force_share =3D true; break; + case OPTION_LIMITS: + limits =3D true; + break; case OPTION_OUTPUT: output_format =3D parse_output_format(argv[0], optarg); break; @@ -3156,7 +3165,7 @@ static int img_info(const img_cmd_t *ccmd, int argc, = char **argv) filename =3D argv[optind++]; =20 list =3D collect_image_info_list(image_opts, filename, fmt, chain, - force_share); + limits, force_share); if (!list) { return 1; } diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 2c5a8a28f9..74b66f9d42 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -66,9 +66,9 @@ SRST ERST =20 DEF("info", img_info, - "info [--object objectdef] [--image-opts] [-f fmt] [--output=3Dofmt] [= --backing-chain] [-U] filename") + "info [--object objectdef] [--image-opts] [-f fmt] [--output=3Dofmt] [= --backing-chain] [--limits] [-U] filename") SRST -.. option:: info [--object OBJECTDEF] [--image-opts] [-f FMT] [--output=3D= OFMT] [--backing-chain] [-U] FILENAME +.. option:: info [--object OBJECTDEF] [--image-opts] [-f FMT] [--output=3D= OFMT] [--backing-chain] [--limits] [-U] FILENAME ERST =20 DEF("map", img_map, --=20 2.51.0 From nobody Fri Nov 14 18:15:44 2025 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=1761739886; cv=none; d=zohomail.com; s=zohoarc; b=ScoyC/JZ+5vSPXEJ3+zBd+wbDf1DPfhoxPFdTwuyCpZyb//zy8xEzxrpm9JzJoIWQ29arVYwr50t74dCAx8Us9mP3ikezKJQLKwLT/O2syqm8BMpTwmUfloyBicHNeRxEmRBXPoAggeqp7RtqyQYsI4bTQLH+58hVOArY+PgFqU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761739886; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GfZPoYyKmyu4FhVIzLk59cIo5VdUH5ApabHHSYQUrTc=; b=EgKhp7RfXoob2arVWCBCGFohEDpmhOv5nA66bTBEy1rzeZu9jSbavc3Q0ig8Yx7D4Q1r4IaFWeLoZ09drhKLpSMhJkDKeozyI1Lwf3QgSxsp1TgHh4+mZKECcUpeJT8388hUrpeMhzLLbqnH3Ja/toyv/u7pj5p0uF6B76cjZcs= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761739886377544.9301126715519; Wed, 29 Oct 2025 05:11:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vE50m-0005t7-Ii; Wed, 29 Oct 2025 08:10:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vE4xw-0003R8-Cr for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:52 -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 1vE4xS-00057o-Iy for qemu-devel@nongnu.org; Wed, 29 Oct 2025 08:07:46 -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-678-hFIZtdgiOJmoLYnlqYRFHQ-1; Wed, 29 Oct 2025 08:07:12 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 5116B18002E4; Wed, 29 Oct 2025 12:07:11 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.44.33.204]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E82C3180057F; Wed, 29 Oct 2025 12:07:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761739635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GfZPoYyKmyu4FhVIzLk59cIo5VdUH5ApabHHSYQUrTc=; b=aIR/di+VcacrrgzFK72h5pwZxQyN3ltPtpNe6dXXwCue3c+UOV6us+fgc5iXtNFnUOn9mC L6kEFQzLDyxQFBTpWcsRb7/8+vnga/l9yqy3iXBSMFW9dlyz+mli/RQ9s71Aem5efzeXA+ D3Ftyz0FQt5d/RVjcUsFPk2jlMtuKa0= X-MC-Unique: hFIZtdgiOJmoLYnlqYRFHQ-1 X-Mimecast-MFC-AGG-ID: hFIZtdgiOJmoLYnlqYRFHQ_1761739631 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [PULL 18/18] qemu-img info: Add cache mode option Date: Wed, 29 Oct 2025 13:06:34 +0100 Message-ID: <20251029120634.288467-19-kwolf@redhat.com> In-Reply-To: <20251029120634.288467-1-kwolf@redhat.com> References: <20251029120634.288467-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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: 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: 1761739889307154100 Content-Type: text/plain; charset="utf-8" When querying block limits, different cache modes (in particular O_DIRECT or not) can result in different limits. Add an option to 'qemu-img info' that allows the user to specify a cache mode, so that they can get the block limits for the cache mode they intend to use with their VM. Signed-off-by: Kevin Wolf Message-ID: <20251024123041.51254-5-kwolf@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- docs/tools/qemu-img.rst | 2 +- qemu-img.c | 25 +++++++++++++++++++++---- qemu-img-cmds.hx | 4 ++-- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst index fdc9ea9cf2..558b0eb84d 100644 --- a/docs/tools/qemu-img.rst +++ b/docs/tools/qemu-img.rst @@ -503,7 +503,7 @@ Command description: =20 The size syntax is similar to :manpage:`dd(1)`'s size syntax. =20 -.. option:: info [--object OBJECTDEF] [--image-opts] [-f FMT] [--output=3D= OFMT] [--backing-chain] [--limits] [-U] FILENAME +.. option:: info [--object OBJECTDEF] [--image-opts] [-f FMT] [--output=3D= OFMT] [--backing-chain] [--limits] [-t CACHE] [-U] FILENAME =20 Give information about the disk image *FILENAME*. Use it in particular to know the size reserved on disk which can be different diff --git a/qemu-img.c b/qemu-img.c index 5cdbeda969..a7791896c1 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -3003,6 +3003,7 @@ static gboolean str_equal_func(gconstpointer a, gcons= tpointer b) static BlockGraphInfoList *collect_image_info_list(bool image_opts, const char *filename, const char *fmt, + const char *cache, bool chain, bool limits, bool force_share) { @@ -3010,6 +3011,15 @@ static BlockGraphInfoList *collect_image_info_list(b= ool image_opts, BlockGraphInfoList **tail =3D &head; GHashTable *filenames; Error *err =3D NULL; + int cache_flags =3D 0; + bool writethrough =3D false; + int ret; + + ret =3D bdrv_parse_cache_mode(cache, &cache_flags, &writethrough); + if (ret < 0) { + error_report("Invalid cache option: %s", cache); + return NULL; + } =20 filenames =3D g_hash_table_new_full(g_str_hash, str_equal_func, NULL, = NULL); =20 @@ -3026,8 +3036,8 @@ static BlockGraphInfoList *collect_image_info_list(bo= ol image_opts, g_hash_table_insert(filenames, (gpointer)filename, NULL); =20 blk =3D img_open(image_opts, filename, fmt, - BDRV_O_NO_BACKING | BDRV_O_NO_IO, false, false, - force_share); + BDRV_O_NO_BACKING | BDRV_O_NO_IO | cache_flags, + writethrough, false, force_share); if (!blk) { goto err; } @@ -3087,6 +3097,7 @@ static int img_info(const img_cmd_t *ccmd, int argc, = char **argv) OutputFormat output_format =3D OFORMAT_HUMAN; bool chain =3D false; const char *filename, *fmt; + const char *cache =3D BDRV_DEFAULT_CACHE; BlockGraphInfoList *list; bool image_opts =3D false; bool force_share =3D false; @@ -3099,13 +3110,14 @@ static int img_info(const img_cmd_t *ccmd, int argc= , char **argv) {"format", required_argument, 0, 'f'}, {"image-opts", no_argument, 0, OPTION_IMAGE_OPTS}, {"backing-chain", no_argument, 0, OPTION_BACKING_CHAIN}, + {"cache", required_argument, 0, 't'}, {"force-share", no_argument, 0, 'U'}, {"limits", no_argument, 0, OPTION_LIMITS}, {"output", required_argument, 0, OPTION_OUTPUT}, {"object", required_argument, 0, OPTION_OBJECT}, {0, 0, 0, 0} }; - c =3D getopt_long(argc, argv, "hf:U", long_options, NULL); + c =3D getopt_long(argc, argv, "hf:t:U", long_options, NULL); if (c =3D=3D -1) { break; } @@ -3121,6 +3133,8 @@ static int img_info(const img_cmd_t *ccmd, int argc, = char **argv) " (incompatible with -f|--format)\n" " --backing-chain\n" " display information about the backing chain for copy-on-write overla= ys\n" +" -t, --cache CACHE\n" +" cache mode for FILE (default: " BDRV_DEFAULT_CACHE ")\n" " -U, --force-share\n" " open image in shared mode for concurrent access\n" " --limits\n" @@ -3143,6 +3157,9 @@ static int img_info(const img_cmd_t *ccmd, int argc, = char **argv) case OPTION_BACKING_CHAIN: chain =3D true; break; + case 't': + cache =3D optarg; + break; case 'U': force_share =3D true; break; @@ -3164,7 +3181,7 @@ static int img_info(const img_cmd_t *ccmd, int argc, = char **argv) } filename =3D argv[optind++]; =20 - list =3D collect_image_info_list(image_opts, filename, fmt, chain, + list =3D collect_image_info_list(image_opts, filename, fmt, cache, cha= in, limits, force_share); if (!list) { return 1; diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 74b66f9d42..6bc8265cfb 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -66,9 +66,9 @@ SRST ERST =20 DEF("info", img_info, - "info [--object objectdef] [--image-opts] [-f fmt] [--output=3Dofmt] [= --backing-chain] [--limits] [-U] filename") + "info [--object objectdef] [--image-opts] [-f fmt] [--output=3Dofmt] [= --backing-chain] [--limits] [-t CACHE] [-U] filename") SRST -.. option:: info [--object OBJECTDEF] [--image-opts] [-f FMT] [--output=3D= OFMT] [--backing-chain] [--limits] [-U] FILENAME +.. option:: info [--object OBJECTDEF] [--image-opts] [-f FMT] [--output=3D= OFMT] [--backing-chain] [--limits] [-t CACHE] [-U] FILENAME ERST =20 DEF("map", img_map, --=20 2.51.0