[pve-devel] [PATCH] volume_size_info: check that storage is enabled (and available)

Alexandre Derumier aderumier at odiso.com
Tue Jul 31 10:01:59 CEST 2012


We need to check if storage is available, as for example, nfs can have infinite timeout and qemu-img info can hang in interruptible state.

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Storage.pm |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index 60cc53d..3b38734 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -118,6 +118,7 @@ sub volume_size_info {
     my ($cfg, $volid, $timeout) = @_;
 
     my ($storeid, $volname) = parse_volume_id($volid);
+    return undef if !storage_check_enabled($cfg, $storeid, undef, 1);
 
     my $scfg = storage_config($cfg, $storeid);
     my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
-- 
1.7.2.5




More information about the pve-devel mailing list