[pve-devel] [PATCH 2/3] nfs: add check_connection
Alexandre Derumier
aderumier at odiso.com
Wed Jul 18 13:35:01 CEST 2012
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/Storage/NFSPlugin.pm | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/PVE/Storage/NFSPlugin.pm b/PVE/Storage/NFSPlugin.pm
index 63e03d2..b20f8ab 100644
--- a/PVE/Storage/NFSPlugin.pm
+++ b/PVE/Storage/NFSPlugin.pm
@@ -162,4 +162,12 @@ sub deactivate_storage {
}
}
+sub check_connection {
+ my ($class, $storeid, $scfg) = @_;
+
+ my $server = $scfg->{server};
+ my $p = Net::Ping->new();
+ return $p->ping($server, 2);
+
+}
1;
--
1.7.2.5
More information about the pve-devel
mailing list