From 4d284721ed6990cc7b51b69cedafb6443f245258 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Wed, 18 Jul 2012 13:35:01 +0200 Subject: [PATCH] nfs: add check_connection Signed-off-by: Alexandre Derumier --- PVE/Storage/NFSPlugin.pm | 8 ++++++++ 1 file changed, 8 insertions(+) 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;