> -     die "no such volume '$volid'\n" if ! -e $path;
> +     if (! -e $path){
> +         my $dl = PVE::Storage::vdisk_list($self->{storecfg}, $storeid, 
> undef);
> +         my $foundvolid = undef;
> +
> +         PVE::Storage::foreach_volid($dl, sub {
> +             my ($volumeid) = @_;
> +             if($volumeid eq $volid) {
> +                 $foundvolid = 1;
> +                 return;
> +             }
> +         });
> +         die "no such volume '$volid'\n" if !$foundvolid;
> +     }
> 
>       my ($size, $format) = PVE::Storage::Plugin::file_size_info($path);

But this does not raise an exception if the volume does not exists? Maybe we 
want:

    die "no such volume '$volid'\n" if !$size;



_______________________________________________
pve-devel mailing list
[email protected]
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to