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

Dietmar Maurer dietmar at proxmox.com
Tue Jul 31 11:09:58 CEST 2012


I am not sure if we should add that check here (slow).

Normally, we already tested that the storage is available when we call volume_size_info?
 

> -----Original Message-----
> From: pve-devel-bounces at pve.proxmox.com [mailto:pve-devel-
> bounces at pve.proxmox.com] On Behalf Of Alexandre Derumier
> Sent: Dienstag, 31. Juli 2012 10:02
> To: pve-devel at pve.proxmox.com
> Subject: [pve-devel] [PATCH] volume_size_info: check that storage is enabled
> (and available)
> 
> 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
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel





More information about the pve-devel mailing list