]> git.proxmox.com Git - pve-container.git/commitdiff
use PVE::Cluster::complete_next_vmid
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 4 Sep 2015 07:15:07 +0000 (09:15 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 4 Sep 2015 07:15:07 +0000 (09:15 +0200)
src/PVE/API2/LXC.pm
src/PVE/LXC.pm

index d5acacebcd7a8683619c8d80dc76e6b8d7648e22..13111826aecbff53db15de879ae05c71d322ffec 100644 (file)
@@ -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',
index e2960471782e72bd4d76cdf013718cde84ff1502..cf45fff967dfca6d5eea93e8ab663af3ddc91de0 100644 (file)
@@ -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) = @_;