Commit fe72e04f authored by Thomas Lamprecht's avatar Thomas Lamprecht Committed by Dietmar Maurer

fix lxc config key in get_start_stop_list sub

When adding the new LXC config format we forgot to adapt the
get_start_stop_list and do s/pve.startup/onboot/

This fixes that qemu VMs were started always before LXC CTs,
irregardless of the defined order.

This also let's us simplify the surrounding code and reduce code
reuse.
Signed-off-by: 's avatarThomas Lamprecht <t.lamprecht@proxmox.com>
parent d3a6b7e5
......@@ -1145,18 +1145,15 @@ my $get_start_stop_list = sub {
my $bootorder = LONG_MAX;
my $conf;
if ($d->{type} eq 'lxc') {
my $conf = PVE::LXC::load_config($vmid);
return if $autostart && !$conf->{'onboot'};
if ($conf->{'pve.startup'}) {
$startup = PVE::JSONSchema::pve_parse_startup_order($conf->{'startup'});
$startup->{order} = $bootorder if !defined($startup->{order});
$conf = PVE::LXC::load_config($vmid);
} elsif ($d->{type} eq 'qemu') {
$conf = PVE::QemuServer::load_config($vmid);
} else {
$startup = { order => $bootorder };
die "unknown VM type '$d->{type}'\n";
}
} elsif ($d->{type} eq 'qemu') {
my $conf = PVE::QemuServer::load_config($vmid);
return if $autostart && !$conf->{onboot};
if ($conf->{startup}) {
......@@ -1165,9 +1162,6 @@ my $get_start_stop_list = sub {
} else {
$startup = { order => $bootorder };
}
} else {
die "unknown VM type '$d->{type}'\n";
}
# skip ha managed VMs (started by pve-ha-manager)
return if defined($haconf->{ids}->{"pvevm:$vmid"});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment