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 <w.bumiller@proxmox.com>
 [ TL: add more commit message with some background ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2024-03-04 10:10:33 +01:00
committed by Thomas Lamprecht
parent eaf6995afd
commit bf453532b0
2 changed files with 4 additions and 2 deletions

View File

@ -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 ];

View File

@ -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;