PVE::Storage::check_volume_access($rpcenv, $authuser, $cfg, undef, $volid);
return PVE::Tools::run_with_timeout(30, sub {
- my $import = PVE::Storage::get_import_metadata($cfg, $volid);
- return $import->get_create_args();
+ return PVE::Storage::get_import_metadata($cfg, $volid);
});
}});
return;
}
-sub get_import_metadata : prototype($$$$) {
+sub get_import_metadata : prototype($$$$$) {
my ($class, $scfg, $volname, $storeid) = @_;
if ($volname !~ m!^([^/]+)/.*\.vmx$!) {
my $manifest = $class->get_manifest($storeid, $scfg, 0);
my $contents = file_get_contents($vmx_path);
- return PVE::Storage::ESXiPlugin::VMX->parse(
+ my $vmx = PVE::Storage::ESXiPlugin::VMX->parse(
$storeid,
$scfg,
$volname,
$contents,
$manifest,
);
+ return $vmx->get_create_args();
}
# Returns a size in bytes, this is a helper for already-mounted files.