[pve-devel] [PATCH container] autocomplete: os templates: do not list VM backup archives for restore

Fiona Ebner f.ebner at proxmox.com
Fri Jun 14 13:29:47 CEST 2024


While archives with unknown or undetermined subtype could be shown,
this is only for autocompletion, so users can still specify those
manually if required.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 src/PVE/LXC.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 65d0fa8..e154efe 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -2341,6 +2341,7 @@ sub complete_os_templates {
     my $res = [];
     foreach my $id (keys %$data) {
 	foreach my $item (@{$data->{$id}}) {
+	    next if $vtype eq 'backup' && ($item->{subtype} // '') ne 'lxc';
 	    push @$res, $item->{volid} if defined($item->{volid});
 	}
     }
-- 
2.39.2





More information about the pve-devel mailing list