to ensure the XOR-like connection between monhost and pveceph

Signed-off-by: Fabian Grünbichler <[email protected]>
---
new in v3, based on $check_monhost_pveceph from patch 4

 PVE/Storage/RBDPlugin.pm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index 70d1fda..9251e59 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -297,6 +297,18 @@ sub options {
     };
 }
 
+sub check_config {
+    my ($class, $sectionId, $config, $create, $skipSchemaCheck) = @_;
+
+    die "'monhost' and 'pveceph' options set on storage '$sectionId'\n"
+       if $config->{monhost} && $config->{pveceph};
+
+    die "one of 'monhost' or 'pveceph' must be set on storage '$sectionId'\n"
+       if !($config->{monhost} || $config->{pveceph});
+
+    return $class->SUPER::check_config($sectionId, $config, $create, 
$skipSchemaCheck);
+}
+
 # Storage implementation
 
 sub parse_volname {
-- 
2.11.0


_______________________________________________
pve-devel mailing list
[email protected]
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to