From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 8AACE1FF15C for ; Fri, 17 Oct 2025 13:35:34 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B5CBC3AF; Fri, 17 Oct 2025 13:35:38 +0200 (CEST) To: pve-devel@lists.proxmox.com Date: Fri, 17 Oct 2025 12:25:32 +0100 In-Reply-To: <20251017112539.26471-1-joao.sousa@eurotux.com> References: <20251017112539.26471-1-joao.sousa@eurotux.com> MIME-Version: 1.0 Message-ID: List-Id: Proxmox VE development discussion List-Post: From: Tiago Sousa via pve-devel Precedence: list Cc: Tiago Sousa X-Mailman-Version: 2.1.29 X-BeenThere: pve-devel@lists.proxmox.com List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Proxmox VE development discussion List-Help: Subject: [pve-devel] [PATCH qemu-server 7/8] blockdev: add query-blockstats qmp command Content-Type: multipart/mixed; boundary="===============0629777359569221798==" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" --===============0629777359569221798== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Original-To: pve-devel@lists.proxmox.com Delivered-To: pve-devel@lists.proxmox.com Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 457ADD0F8A for ; Fri, 17 Oct 2025 13:35:36 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1ED3827D0A for ; Fri, 17 Oct 2025 13:35:06 +0200 (CEST) Received: from eurotux.com (mail.eurotux.com [185.98.249.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 17 Oct 2025 13:35:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by eurotux.com (Postfix) with ESMTP id 20C3630CFB17; Fri, 17 Oct 2025 12:26:03 +0100 (WEST) Authentication-Results: mail.prd.eurotux.pt (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=eurotux.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eurotux.com; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from; s= default; t=1760700362; x=1762514763; bh=K1LJPzX5PxoS+HiW6Oj5BYcS EFvC26CDXEvKY6W8Jl0=; b=xIH/ZfUkzxMA55i7rcBxGFAR5lU0BiRLF12AUl0E WLT9Yey4J+HOmmc6RqX+ZJatjXHAlYLLWMaLjhyVAf8mwiYyTKZaJ8B8Y8e/rSai Eza1K4l8dlqH4i1FYJ+P7LNvtYwgIGugr2stRiiRISnMNHdwKD4QEpd8ErHebZhP 7JljoaFdhCtrcvD1aXG3Uvl8nANg9yooORKLSluTbKnbAlWQA3Pti4hCW5AHy95Z zPgsHSJT/9hJiVfhDtG4gl1UUrfH1a6yEL4ky9xrrwStaaFFJ1tsUVQIyhutULKp UWTlWqAKTzbArs1reVuKlRztYXTMSKxxpvyXjN9J+WWlXA== X-Virus-Scanned: amavisd-new at mail.prd.eurotux.pt Received: from eurotux.com ([127.0.0.1]) by localhost (mail.prd.eurotux.pt [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id kVaU6NwOK48I; Fri, 17 Oct 2025 12:26:02 +0100 (WEST) Received: from proxmox.example (184.137.90.149.rev.vodafone.pt [149.90.137.184]) (Authenticated sender: joao.sousa@eurotux.com) by eurotux.com (Postfix) with ESMTPSA id 4F0F730D17BC; Fri, 17 Oct 2025 12:26:02 +0100 (WEST) From: Tiago Sousa To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server 7/8] blockdev: add query-blockstats qmp command Date: Fri, 17 Oct 2025 12:25:32 +0100 Message-ID: <20251017112539.26471-8-joao.sousa@eurotux.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251017112539.26471-1-joao.sousa@eurotux.com> References: <20251017112539.26471-1-joao.sousa@eurotux.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL -0.000 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) SPF_HELO_PASS -0.001 SPF: HELO matches SPF record SPF_PASS -0.001 SPF: sender matches SPF record Signed-off-by: Tiago Sousa --- src/PVE/QemuServer/Blockdev.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev= .pm index 38a1408a..78769198 100644 --- a/src/PVE/QemuServer/Blockdev.pm +++ b/src/PVE/QemuServer/Blockdev.pm @@ -113,6 +113,21 @@ sub get_block_info { return $block_info; } =20 +sub get_block_stats { + my ($vmid) =3D @_; + + my $block_stats =3D {}; + + my $qmp_block_stats =3D mon_cmd($vmid, "query-blockstats"); + for my $info ($qmp_block_stats->@*) { + my $qdev_id =3D $info->{qdev} or next; + my $drive_id =3D qdev_id_to_drive_id($qdev_id); + $block_stats->{$drive_id} =3D $info; + } + + return $block_stats; +} + my sub get_node_name { my ($type, $drive_id, $volid, $options) =3D @_; =20 --=20 2.47.3 --===============0629777359569221798== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel --===============0629777359569221798==--