get_filtered_vmlist: save VM conf in own subhash

small refactoring in get_filtered_vmlist: save a VMs config in its
own subhash to avoid collisions with other data which we want to save
in the vmid list, for now this is only `type` but in the next patch
I want to save also the class

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 627fa10467a1578c5a3c7d2a292bbe6f14a881ca)
This commit is contained in:
Thomas Lamprecht 2017-03-15 16:47:41 +01:00 committed by Fabian Grünbichler
parent a99170e1aa
commit 2edea01c78

View File

@ -1248,7 +1248,7 @@ my $get_filtered_vmlist = sub {
return if !$templates && $class->is_template($conf);
return if !$ha_managed && PVE::HA::Config::vm_is_ha_managed($vmid);
$res->{$vmid} = $conf;
$res->{$vmid}->{conf} = $conf;
$res->{$vmid}->{type} = $d->{type};
};
warn $@ if $@;
@ -1265,7 +1265,7 @@ my $get_start_stop_list = sub {
my $resList = {};
foreach my $vmid (keys %$vmlist) {
my $conf = $vmlist->{$vmid};
my $conf = $vmlist->{$vmid}->{conf};
next if $autostart && !$conf->{onboot};