[pve-devel] [PATCH storage 2/2] config: prevent empty content list when content type 'none' is not supported

Fabian Ebner f.ebner at proxmox.com
Fri Jun 18 12:59:36 CEST 2021


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/Storage/Plugin.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm
index 318d13a..d25e23f 100644
--- a/PVE/Storage/Plugin.pm
+++ b/PVE/Storage/Plugin.pm
@@ -344,6 +344,10 @@ sub decode_value {
 	    die "unable to combine 'none' with other content types\n";
 	}
 
+	if (scalar(keys $res->%*) == 0 && !$valid_content->{none}) {
+	    die "storage does not support content type 'none'\n";
+	}
+
 	return $res;
     } elsif ($key eq 'format') {
 	my $valid_formats = $def->{format}->[0];
-- 
2.30.2






More information about the pve-devel mailing list