]> git.proxmox.com Git - pve-storage.git/commitdiff
storage plugins: add 'import' content type
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 4 Mar 2024 09:10:33 +0000 (10:10 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 13 Mar 2024 11:25:00 +0000 (12:25 +0100)
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>
src/PVE/Storage.pm
src/PVE/Storage/Plugin.pm

index 0beabbcf060a179030606f1b32f3feb09bbb30da..099df2b6c6a654daaceb4f2b20f73a053e98cbb6 100755 (executable)
@@ -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 ];
 
index e086de9b2f9ad268ae1c3e6ba3276c93bd1feed7..7456c8efec49cd74a85e7bb51e3935277defbb0c 100644 (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;