[pve-devel] [PATCH storage v8 1/2] vdisk_free: print warning if underlying storage does not exist

Michael Köppl m.koeppl at proxmox.com
Thu Jun 26 18:06:17 CEST 2025


Instead of failing later in the function, users are warned if the
underlying storage no longer exists.

Signed-off-by: Michael Köppl <m.koeppl at proxmox.com>
---
 src/PVE/Storage.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm
index 69eb435f..ec875fd0 100755
--- a/src/PVE/Storage.pm
+++ b/src/PVE/Storage.pm
@@ -1082,6 +1082,12 @@ sub vdisk_free {
 
     my ($storeid, $volname) = parse_volume_id($volid);
     my $scfg = storage_config($cfg, $storeid);
+    if (!$scfg) {
+        log_warn(
+            "storage '$storeid' does not exist, mountpoint volume '$volid' could not be deleted");
+        return;
+    }
+
     my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
 
     activate_storage($cfg, $storeid);
-- 
2.39.5





More information about the pve-devel mailing list