From 081ce2c9df7422f93f5b4fdf597d538b44b48f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 10 Dec 2024 11:50:46 +0100 Subject: [PATCH] esxi: fix return value of volume_size_info for vmx volumes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Fiona Ebner --- 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..c8412c4 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; + } my $filename = $class->path($scfg, $volname, $storeid, undef); return PVE::Storage::Plugin::file_size_info($filename, $timeout, 'auto-detect');