From nobody Mon Oct 27 11:31:20 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=1761309110; cv=none; d=zohomail.com; s=zohoarc; b=T34JePD1YUccWBA8Xn5treDeiQmPwxI2hMfyfvLziaJkGl8QR1eYCj2T+bJdOp+pQejplr7jtcrSTG9EXHf4/LfV6pZXHx6BPxajalxXEObtpvbUFlUNiJuRto+3beowbv6q+HsjusiHEphfMcGMTg4HkYgykl4YbyT7YmNsNUk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761309110; 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=vY6HOny8OWLBaW+1NOLRFvxDRZBqkxO95+48/OAZED0=; b=lwk0F9vHiD1qB7/xwF09RX5YCTSehXDcVWGtWXVjsDgCEIUVrCkPhVVn3veoEPvksZ2m3ksxKmNykzsKHY6ci/HU3QCQhtV6UJsDCOB3BbOBTY41ITMHbnb+4nWNYrjfRckGxjGKuCPf2x9X4y2SliNQfC7rQU575mf1QCtBBa0= 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 1761309109896308.109164589668; Fri, 24 Oct 2025 05:31:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vCGwg-0005yh-Vi; Fri, 24 Oct 2025 08:31: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 1vCGwe-0005y3-P2 for qemu-devel@nongnu.org; Fri, 24 Oct 2025 08:31:01 -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 1vCGwc-00067E-1F for qemu-devel@nongnu.org; Fri, 24 Oct 2025 08:31:00 -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-326-JMhYRBYKN3aT0_uW87Azmg-1; Fri, 24 Oct 2025 08:30:54 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 2CA011800637; Fri, 24 Oct 2025 12:30:53 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.45.225.249]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DADAC19540EB; Fri, 24 Oct 2025 12:30:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761309055; 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=vY6HOny8OWLBaW+1NOLRFvxDRZBqkxO95+48/OAZED0=; b=BB0Ou/Yk5d+cHeLNeTmb1cSjNJzPnG59cBkeApxXNep3htUAy+vMxATxPEiXXnxOXDfZkR xJTfunYLPDJhIGHokPpDjU6Zi57zv3Zw7xyWsLfI3YegfXTf64Ad3qtnlglasalWjRaMTE 5YzpOjW0fq/7AhFn1QMzljqP9VH+lrM= X-MC-Unique: JMhYRBYKN3aT0_uW87Azmg-1 X-Mimecast-MFC-AGG-ID: JMhYRBYKN3aT0_uW87Azmg_1761309053 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, eblake@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, hreitz@redhat.com Subject: [PATCH v2 1/4] block: Improve comments in BlockLimits Date: Fri, 24 Oct 2025 14:30:37 +0200 Message-ID: <20251024123041.51254-2-kwolf@redhat.com> In-Reply-To: <20251024123041.51254-1-kwolf@redhat.com> References: <20251024123041.51254-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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: 1761309120863158500 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 Reviewed-by: Eric Blake --- 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 034c0634c8..5206f32d53 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 Mon Oct 27 11:31:20 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=1761309132; cv=none; d=zohomail.com; s=zohoarc; b=nNdnLPtbfTByOck75meAMrE736AI0iytVvBOg02vRyrQGPBy+zCZgecQ9wkfwM+yyY94jmwQIs8L898fxQgbmLUGsVZori0xdN538puD3f0c4grz3wUPfpbsbAOnLOcOdt/dRk+lWaKMXLPBb2lo94VJhgHO7pkAQ/bHNTCiMt8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761309132; 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=LUv+R+slNmLor6S3bIUF+SYGY6Nvm33MoRQhkG4LAMw=; b=XYPWL6skbqvGt7mpauOH0lUNWeswRYJMjnTfKVY4Q5fBbhUeHUHQ0/9uRq0n8Jey+FEzupixWisTJdmCHT147SDqnGvKGc2oPQt8cqRT98qhBQIUt/1Dxf/Pk3rIkDE2HUBgHIC2L9cmT6KoK87faNncDq5GM1x/7zfZidnhDig= 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 1761309132092455.64706202890704; Fri, 24 Oct 2025 05:32:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vCGwk-00060R-Au; Fri, 24 Oct 2025 08:31:06 -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 1vCGwh-0005zA-KA for qemu-devel@nongnu.org; Fri, 24 Oct 2025 08:31:03 -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 1vCGwe-00067U-TR for qemu-devel@nongnu.org; Fri, 24 Oct 2025 08:31:03 -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-383-t0BWV_WGOr-duWcHDwC9Pw-1; Fri, 24 Oct 2025 08:30:56 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 CB18519540E4; Fri, 24 Oct 2025 12:30:55 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.45.225.249]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A3BD319540EB; Fri, 24 Oct 2025 12:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761309059; 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=LUv+R+slNmLor6S3bIUF+SYGY6Nvm33MoRQhkG4LAMw=; b=A2B/S18fnhysv8WSR76r+kgEsLym+/BpoFm173z5YwvU6UrhNGqvzBSW8nwZVw51qG+ml8 KTxIqhUiKdf26rZBlUnmbPNdWyF/UAnrIvkpSaMNvMq5mowSWJaR+RWUdlW1cznCNiUeGH hm5ElSNyXemIT5UqqN1wa4EG9nfJZb0= X-MC-Unique: t0BWV_WGOr-duWcHDwC9Pw-1 X-Mimecast-MFC-AGG-ID: t0BWV_WGOr-duWcHDwC9Pw_1761309055 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, eblake@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, hreitz@redhat.com Subject: [PATCH v2 2/4] block: Expose block limits for images in QMP Date: Fri, 24 Oct 2025 14:30:38 +0200 Message-ID: <20251024123041.51254-3-kwolf@redhat.com> In-Reply-To: <20251024123041.51254-1-kwolf@redhat.com> References: <20251024123041.51254-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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: 1761309138997158500 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 --- 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 Mon Oct 27 11:31:20 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=1761309157; cv=none; d=zohomail.com; s=zohoarc; b=N8tAEivMODdB/L0OOPQJ5HQQGxEaacneSrFONQtAwiRY5CjC/dURxGF1WlOiK4NX8xdtpFaf/oqtNGrjQpduJGToxNCY0FTfgFOt0dlNA/PF6SK7hopZlSNCRvjoksBoT802CQhzKssakPVOlZUcOBnlcqmRmtwQfopKwzqEGcQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761309157; 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=WqKQLlXDk5QUdRZgqBKNvopUTq1fwxAl4zQryYzfYgw=; b=f8CGOX5MMDvno5hZRZYbTq1n2HTVr8pBR8bQETI4HNhYsCR1rKx5r7Tlr9Nwt4v1IQNGrT2XcdvZNL69fSABnXlhLSbLE9f+8Bw0ObUDfazIexRK1O1rFzeST8gIq3u0jMAfzxsk5NG6WLD5idKhavWrwUROaMWuIRcAU9iwA7s= 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 17613091576578.32317121582264; Fri, 24 Oct 2025 05:32:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vCGwk-00060q-Rd; Fri, 24 Oct 2025 08:31:06 -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 1vCGwi-0005zZ-CD for qemu-devel@nongnu.org; Fri, 24 Oct 2025 08:31:04 -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 1vCGwg-00067k-3e for qemu-devel@nongnu.org; Fri, 24 Oct 2025 08:31:04 -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-296-mTwRELDkMtGz0aeBWRjG6A-1; Fri, 24 Oct 2025 08:30:59 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 795A719540DB; Fri, 24 Oct 2025 12:30:58 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.45.225.249]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4C91D19540EB; Fri, 24 Oct 2025 12:30:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761309060; 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=WqKQLlXDk5QUdRZgqBKNvopUTq1fwxAl4zQryYzfYgw=; b=C8GS5foTtzax5L4oqvWS1k6IO407VJo/jEonZcmvco1bxyjwmyJvh2fjqEZ3OSW5J2bOeE 9m4P9PBs6GC+/cxpMt8+EwdVHLkQk/1JrvLzz8Nx86OpeO3cy4+017zgBwCWbkapzfSoYP oBCEOw/2HeWQJ58sVpmr2gpxpkq0yh0= X-MC-Unique: mTwRELDkMtGz0aeBWRjG6A-1 X-Mimecast-MFC-AGG-ID: mTwRELDkMtGz0aeBWRjG6A_1761309058 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, eblake@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, hreitz@redhat.com Subject: [PATCH v2 3/4] qemu-img info: Optionally show block limits Date: Fri, 24 Oct 2025 14:30:39 +0200 Message-ID: <20251024123041.51254-4-kwolf@redhat.com> In-Reply-To: <20251024123041.51254-1-kwolf@redhat.com> References: <20251024123041.51254-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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: 1761309161416158500 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 --- 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 Mon Oct 27 11:31:20 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=1761309113; cv=none; d=zohomail.com; s=zohoarc; b=WK5myayXN2cBQKRiWlULqFf6JUYZbctAunh3+V0imSUZbSnzTekL7bksiIoFM6ysceTnogXsesh0dIMU1Ot3hauXEcuNy/5pr7mKUxxlC2y3UUZSZxfUHkcjN5emmocKfy/HhLG75JVVhCWMLma6UrUFPYd0Aipkdz6hmfz+FnI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761309113; 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=9B7wu+SfNVhC5TFZoBPOUdxmzu1rq3LIlO+WXANdseE=; b=HeazMiaM/QD73sSEFBG7A3RS/9Gd9mlvr39IqZHLbeSq71M5LpaxaSOFBWoOfLopwtSDtxv3ltWAVB7aSKXMUzUyDJpD1dd6Xih8HD5nYpySoJu6M0Ia1/eUXkI80/gcMmYuqktq50A4Jik63jFMx8ZYbc2a52Ioj5hS1Jz1RR4= 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 1761309113528231.11825654343477; Fri, 24 Oct 2025 05:31:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vCGwq-00063c-Gf; Fri, 24 Oct 2025 08:31:12 -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 1vCGwn-00061o-B0 for qemu-devel@nongnu.org; Fri, 24 Oct 2025 08:31: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 1vCGwk-00068i-Pr for qemu-devel@nongnu.org; Fri, 24 Oct 2025 08:31:08 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-507-_BHOcyI6Nli5qCUX2RnpdA-1; Fri, 24 Oct 2025 08:31:04 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8C0E81955F2E; Fri, 24 Oct 2025 12:31:03 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.45.225.249]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 80DDD19540EB; Fri, 24 Oct 2025 12:31:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761309065; 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=9B7wu+SfNVhC5TFZoBPOUdxmzu1rq3LIlO+WXANdseE=; b=dU2E9hE4RLLHKRf9C7mPH+DU8N0ctLVSsaGrnfqPYmi02RqDL+huN4TpKd9hFIRIOxl07M vtRk1M3CvsLbzY1S6Owznp3VtdaX1ni/kkw4s9MHOzgfLiv7WcZbmXZ86VvBTMTJa++Sde 5aFthvvQ9i1+Qe5FpsGiiKfuNF+bdIY= X-MC-Unique: _BHOcyI6Nli5qCUX2RnpdA-1 X-Mimecast-MFC-AGG-ID: _BHOcyI6Nli5qCUX2RnpdA_1761309063 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, eblake@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, hreitz@redhat.com Subject: [PATCH v2 4/4] qemu-img info: Add cache mode option Date: Fri, 24 Oct 2025 14:30:41 +0200 Message-ID: <20251024123041.51254-6-kwolf@redhat.com> In-Reply-To: <20251024123041.51254-1-kwolf@redhat.com> References: <20251024123041.51254-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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: 1761309120893158500 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 --- 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 From nobody Mon Oct 27 11:31:20 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=1761309139; cv=none; d=zohomail.com; s=zohoarc; b=UGvWEcaWTBiJg7YJ3QlADrM35anNlW71ovtGgKuS5Dii486X467gx1g+jhATupBEVxGiK350UrpGbYJ38TDAOXOZTwfkd0PHetZsloDNCkibd719r7z+uT0gKEkzQ1ry0EzA04WUGTW0yzTYi5ObrvcZSVZMH0ysJ6kmo5i1I3k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761309139; 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=9B7wu+SfNVhC5TFZoBPOUdxmzu1rq3LIlO+WXANdseE=; b=KbdFt23JkhQWM1HeDreAtaWPp0HiI75dlPAZsqVSFUtO+L/o+M3me6qbRN4RGIOdaZIxegX+VgSvQnWqXrQHzpSax7vbeMH1ncR/qM8M5TGjlbsbD6abFOjkC6Lk6Su8BF8anPLaG8IBZ2F3mB1TuWqqtP8eWu1bp6LK/Sk/sLY= 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 1761309139623107.61117671969168; Fri, 24 Oct 2025 05:32:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vCGwo-00062Y-3N; Fri, 24 Oct 2025 08:31:10 -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 1vCGwm-00061S-9t for qemu-devel@nongnu.org; Fri, 24 Oct 2025 08:31:08 -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 1vCGwk-00068e-6R for qemu-devel@nongnu.org; Fri, 24 Oct 2025 08:31:08 -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-68-19D1gkLjN_WfSr9uExVnPg-1; Fri, 24 Oct 2025 08:31:01 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 097D31800D8C; Fri, 24 Oct 2025 12:31:01 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.45.225.249]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F1F2919540EB; Fri, 24 Oct 2025 12:30:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761309065; 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=9B7wu+SfNVhC5TFZoBPOUdxmzu1rq3LIlO+WXANdseE=; b=erjNoRij4bXQcVxDuVqgMnW24urd/JaeKylLTXZY2IHq0heyEFED84oKh1kJ1BUnZwYyzy 2OYVIKQPeHTCVZ2qTCZYheg4DMVmTMakasDspmpMdXs8dy3F5C1lrB082DnbaJMaibD+Sx hmw1kpqBftJvLzpv4VOOQtdgLg+uVF0= X-MC-Unique: 19D1gkLjN_WfSr9uExVnPg-1 X-Mimecast-MFC-AGG-ID: 19D1gkLjN_WfSr9uExVnPg_1761309061 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, eblake@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, hreitz@redhat.com Subject: [PATCH v2 4/4] qemu-img info: Add cache mode option Date: Fri, 24 Oct 2025 14:30:40 +0200 Message-ID: <20251024123041.51254-5-kwolf@redhat.com> In-Reply-To: <20251024123041.51254-1-kwolf@redhat.com> References: <20251024123041.51254-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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: 1761309145027158500 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 Reviewed-by: Eric Blake --- 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