[pve-devel] [PATCH storage v2 2/3] esxi: fix return value of volume_size_info for vmx volumes

Fiona Ebner f.ebner at proxmox.com
Tue Dec 10 13:34:47 CET 2024


Am 10.12.24 um 13:17 schrieb Fabian Grünbichler:
> in case of an array context, it should also return the format, else a caller
> might assume it failed.
> 
> Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
> ---
> v2: fix return value ordering, thanks Fiona!
> 
>  src/PVE/Storage/ESXiPlugin.pm | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/PVE/Storage/ESXiPlugin.pm b/src/PVE/Storage/ESXiPlugin.pm
> index 37f9e75..70735f9 100644
> --- a/src/PVE/Storage/ESXiPlugin.pm
> +++ b/src/PVE/Storage/ESXiPlugin.pm
> @@ -535,7 +535,9 @@ sub volume_resize {
>  sub volume_size_info {
>      my ($class, $scfg, $storeid, $volname, $timeout) = @_;
>  
> -    return 0 if $volname =~ /\.vmx$/;
> +    if ($volname =~ /\.vmx$/) {
> +	return wantarray ? (0, 'vmx') : 0 ;

Style nit: space before semicolon

> +    }
>  
>      my $filename = $class->path($scfg, $volname, $storeid, undef);
>      return PVE::Storage::Plugin::file_size_info($filename, $timeout, 'auto-detect');





More information about the pve-devel mailing list