Warn and skip if a storage with unknown storage type is encountered.
This might happen by manually editing the storage config.

Signed-off-by: Christian Ebner <c.eb...@proxmox.com>
---
 src/PVE/Storage/Plugin.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
index 9d3b1ae..7e7749d 100644
--- a/src/PVE/Storage/Plugin.pm
+++ b/src/PVE/Storage/Plugin.pm
@@ -520,6 +520,10 @@ sub parse_config {
        my $type = $d->{type};
 
        my $def = $defaultData->{plugindata}->{$type};
+       if (!$def) {
+           warn "invalid storage type for '$d'\n";
+           next;
+       }
 
        if ($def->{content}) {
            $d->{content} = $def->{content}->[1] if !$d->{content};
-- 
2.39.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to