esxi: fix return value of volume_size_info for vmx volumes

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@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2024-12-10 11:50:46 +01:00
parent bfb3dff319
commit 081ce2c9df

View File

@ -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;
}
my $filename = $class->path($scfg, $volname, $storeid, undef);
return PVE::Storage::Plugin::file_size_info($filename, $timeout, 'auto-detect');