[pve-devel] [PATCH storage v3 02/20] rbd: implement check_config
Fabian Grünbichler
f.gruenbichler at proxmox.com
Thu Aug 31 11:38:05 CEST 2017
to ensure the XOR-like connection between monhost and pveceph
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
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
More information about the pve-devel
mailing list