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 EAA431FF15C for ; Fri, 3 Oct 2025 12:33:55 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 04907E04; Fri, 3 Oct 2025 12:33:56 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Fri, 3 Oct 2025 12:33:11 +0200 Message-ID: <20251003103319.44974-3-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251003103319.44974-1-f.ebner@proxmox.com> References: <20251003103319.44974-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1759487578200 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.022 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: [pve-devel] [PATCH qemu-server 2/2] backup: fleecing: avoid warning when querying block node size for TPM state 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" Currently, there only is a warning that the fallback, being the size queried from the storage, is used. This should work in all cases, but there are plans for supporting TPM state as a FUSE/NBD export from an underlying qcow2 image where it might still work, but the correspondence of size between the attached block node in QEMU and the storage layer already becomes much more blurry. Avoid the warning and future-proof by also querying the size for the TPM state directly from the attached block node in QEMU. Signed-off-by: Fiona Ebner --- src/PVE/VZDump/QemuServer.pm | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/PVE/VZDump/QemuServer.pm b/src/PVE/VZDump/QemuServer.pm index b84957be..55a3f55b 100644 --- a/src/PVE/VZDump/QemuServer.pm +++ b/src/PVE/VZDump/QemuServer.pm @@ -1128,9 +1128,22 @@ sub query_block_node_sizes { for my $diskinfo ($disks->@*) { my $drive_key = $diskinfo->{virtdev}; - $drive_key .= "-backup" if $drive_key eq 'tpmstate0'; - my $block_node_size = - eval { $block_info->{$drive_key}->{inserted}->{image}->{'virtual-size'}; }; + + my $block_node_size; + if ($drive_key eq 'tpmstate0') { + # There is no front-end device for TPM state, so it's not included in the result of + # get_block_info(). Note that it is always attached with the same explicit node name. + my $named_block_node_info = mon_cmd($vmid, 'query-named-block-nodes'); + for my $info ($named_block_node_info->@*) { + next if $info->{'node-name'} ne 'drive-tpmstate0-backup'; + $block_node_size = $info->{image}->{'virtual-size'}; + last; + } + } else { + $block_node_size = + eval { $block_info->{$drive_key}->{inserted}->{image}->{'virtual-size'}; }; + } + if (!$block_node_size) { $self->loginfo( "could not determine block node size of drive '$drive_key' - using fallback"); -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel