From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 26A751FF187 for ; Mon, 30 Jun 2025 14:43:13 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1DD9B1BB0C; Mon, 30 Jun 2025 14:43:49 +0200 (CEST) Date: Mon, 30 Jun 2025 14:43:11 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20250626160504.330350-1-f.ebner@proxmox.com> <20250626160504.330350-4-f.ebner@proxmox.com> In-Reply-To: <20250626160504.330350-4-f.ebner@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1751287337.5ct5ta78ui.astroid@yuna.none> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.044 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH qemu 3/3] blockdev: query file child QMP command X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On June 26, 2025 6:04 pm, Fiona Ebner wrote: > There currently does not seem to be a good way to obtain information > about the file child of a node, so add a custom command. The > query-block and query-named-block-nodes commands lack the necessary > info and while x-debug-query-block-graph exists, that is explicitly > only for debugging and experimental. > > This is requried for e.g. blockdev-mirror in PVE to determine the > node below the top throttle node. > > Signed-off-by: Fiona Ebner > --- > > Alternatively, we could think about adding the node name of the file > child to the info returned by query-named-block-nodes. I can give that > a shot and also ask upstream which approach is prefered. that might be nice, or alternatively if we go with our custom solution here for now - give it a prefixed name to avoid potential clashes with a future upstream variant? > > blockdev.c | 22 ++++++++++++++++++++++ > qapi/block-core.json | 13 +++++++++++++ > 2 files changed, 35 insertions(+) > > diff --git a/blockdev.c b/blockdev.c > index 17de5d2ae4..3be209767a 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -57,6 +57,7 @@ > #include "system/system.h" > #include "system/iothread.h" > #include "block/block_int.h" > +#include "block/qapi.h" > #include "block/trace.h" > #include "system/runstate.h" > #include "system/replay.h" > @@ -2782,6 +2783,27 @@ XDbgBlockGraph *qmp_x_debug_query_block_graph(Error **errp) > return bdrv_get_xdbg_block_graph(errp); > } > > +BlockDeviceInfo *qmp_block_node_query_file_child(const char *node_name, > + Error **errp) > +{ > + GRAPH_RDLOCK_GUARD_MAINLOOP(); > + > + BlockDriverState *bs; > + > + bs = bdrv_find_node(node_name); > + if (!bs) { > + error_setg(errp, "Failed to find node with node-name='%s'", node_name); > + return NULL; > + } > + > + if (!bs->file || !bs->file->bs) { > + error_setg(errp, "Node '%s' has no 'file' child", node_name); > + return NULL; > + } > + > + return bdrv_block_device_info(NULL, bs->file->bs, false, errp); > +} > + > void qmp_blockdev_backup(BlockdevBackup *backup, Error **errp) > { > TransactionAction action = { > diff --git a/qapi/block-core.json b/qapi/block-core.json > index f8ed564cf0..6c683b00ec 100644 > --- a/qapi/block-core.json > +++ b/qapi/block-core.json > @@ -2463,6 +2463,19 @@ > 'features': [ 'unstable' ], > 'allow-preconfig': true } > > +## > +# @block-node-query-file-child: > +# > +# Get information about a child of the specified block node. > +# > +# @node-name: the block node name of the node to query. > +# > +# Returns: the BlockDeviceInfo of the file child. > +## > +{ 'command': 'block-node-query-file-child', > + 'data': { 'node-name': 'str' }, > + 'returns': 'BlockDeviceInfo' } > + > ## > # @drive-mirror: > # > -- > 2.47.2 > > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel