From: Dietmar Maurer Date: Fri, 4 Sep 2015 07:15:07 +0000 (+0200) Subject: use PVE::Cluster::complete_next_vmid X-Git-Url: https://git.proxmox.com/?p=pve-container.git;a=commitdiff_plain;h=781e26b2377187ed610f127fa29b6ac680dbc481 use PVE::Cluster::complete_next_vmid --- diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm index d5acace..1311182 100644 --- a/src/PVE/API2/LXC.pm +++ b/src/PVE/API2/LXC.pm @@ -180,7 +180,7 @@ __PACKAGE__->register_method({ additionalProperties => 0, properties => PVE::LXC::json_config_properties({ node => get_standard_option('pve-node'), - vmid => get_standard_option('pve-vmid', { completion => \&PVE::LXC::complete_next_vmid }), + vmid => get_standard_option('pve-vmid', { completion => \&PVE::Cluster::complete_next_vmid }), ostemplate => { description => "The OS template or backup file.", type => 'string', diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index e296047..cf45fff 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -2136,18 +2136,6 @@ sub complete_migration_target { return $res; } -sub complete_next_vmid { - - my $vmlist = PVE::Cluster::get_vmlist() || {}; - my $idlist = $vmlist->{ids} || {}; - - for (my $i = 100; $i < 10000; $i++) { - return [$i] if !defined($idlist->{$i}); - } - - return []; -} - my $complete_ctid_full = sub { my ($running) = @_;