From bf453532b0dd2108e1b66b6fb02e8191626304e2 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 4 Mar 2024 10:10:33 +0100 Subject: [PATCH] storage plugins: add 'import' content type Add a new 'import' content type which will be the corner stone for a better API and UI integrated way to import virtual guests into Proxmox VE. For starters this will be used to implement a ESXi adapter, so that those VMs can get imported nicely. Later we want to integrate the OVF/OVA import skeletons we got in qemu-server to something more usable here. Signed-off-by: Wolfgang Bumiller [ TL: add more commit message with some background ] Signed-off-by: Thomas Lamprecht --- src/PVE/Storage.pm | 2 +- src/PVE/Storage/Plugin.pm | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm index 0beabbc..099df2b 100755 --- a/src/PVE/Storage.pm +++ b/src/PVE/Storage.pm @@ -1107,7 +1107,7 @@ sub template_list { sub volume_list { my ($cfg, $storeid, $vmid, $content) = @_; - my @ctypes = qw(rootdir images vztmpl iso backup snippets); + my @ctypes = qw(rootdir images vztmpl iso backup snippets import); my $cts = $content ? [ $content ] : [ @ctypes ]; diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm index e086de9..7456c8e 100644 --- a/src/PVE/Storage/Plugin.pm +++ b/src/PVE/Storage/Plugin.pm @@ -319,7 +319,9 @@ PVE::JSONSchema::register_format('pve-storage-content', \&verify_content); sub verify_content { my ($ct, $noerr) = @_; - my $valid_content = valid_content_types('dir'); # dir includes all types + return $ct if $ct eq 'import'; + + my $valid_content = valid_content_types('dir'); # dir includes all other types if (!$valid_content->{$ct}) { return undef if $noerr;