From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 3F4F41FF0E6 for ; Fri, 24 Jul 2026 10:16:48 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id F214221492; Fri, 24 Jul 2026 10:16:47 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server] fix #7828: register unused drive: fix failure to handle non-PVE managed volumes Date: Fri, 24 Jul 2026 10:13:54 +0200 Message-ID: <20260724081611.11254-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784880944257 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.218 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 6KWINLFWQIZWRID7IUL4KHD36EKHDNR3 X-Message-ID-Hash: 6KWINLFWQIZWRID7IUL4KHD36EKHDNR3 X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Volumes that are not PVE-managed have no storage associated to them, and in particular cannot be owned by a VM. When removing such a volume from the configuration, registering it as unused should be skipped. This was the case before commit 5b5c5768 ("display warnings for storage errors or if storage no longer exists"), but the new handling misses this edge case and causes a failure to parse the volume ID instead. Fix the regression by using the non-erroring variant when parsing the volume ID and skipping such volumes again. Fixes: 5b5c5768 ("display warnings for storage errors or if storage no longer exists") Analyzed-by: Thomas Ellmenreich Signed-off-by: Fiona Ebner --- src/PVE/QemuServer.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index 191ae549..9aec7f9c 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -1576,7 +1576,8 @@ sub vmconfig_register_unused_drive { delete $conf->{'special-sections'}->{cloudinit}; } elsif (!drive_is_cdrom($drive)) { my $volid = $drive->{file}; - my ($storeid, undef) = PVE::Storage::parse_volume_id($volid); + my ($storeid, undef) = PVE::Storage::parse_volume_id($volid, 1); + return if !$storeid; # Not a PVE-managed volume, don't register as unused. if (PVE::Storage::storage_config($storecfg, $storeid, 1)) { if (vm_is_volid_owner($storecfg, $vmid, $volid)) { PVE::QemuConfig->add_unused_volume($conf, $volid, $vmid); -- 2.47.3