public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
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	[thread overview]
Message-ID: <20260724081611.11254-1-f.ebner@proxmox.com> (raw)

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 <t.ellmenreich@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 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





             reply	other threads:[~2026-07-24  8:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24  8:13 Fiona Ebner [this message]
2026-07-24  9:11 ` applied: [PATCH qemu-server] fix #7828: register unused drive: fix failure to handle non-PVE managed volumes Fabian Grünbichler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260724081611.11254-1-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal