mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-10-05 00:40:09 +00:00
cleanup startall code
Only sleep when neccessary
This commit is contained in:
parent
ed3ffe31d4
commit
30f6cd84a2
14
qm
14
qm
@ -248,19 +248,25 @@ __PACKAGE__->register_method ({
|
|||||||
foreach my $vmid (keys %$vzlist) {
|
foreach my $vmid (keys %$vzlist) {
|
||||||
next if $vzlist->{$vmid}->{pid}; # already running
|
next if $vzlist->{$vmid}->{pid}; # already running
|
||||||
|
|
||||||
|
my $conf;
|
||||||
|
eval { $conf = PVE::QemuServer::load_config($vmid); };
|
||||||
|
if (my $err = $@) {
|
||||||
|
warn $err;
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
next if !($conf && $conf->{onboot});
|
||||||
|
|
||||||
sleep(2) if $count != 0; # reduce load
|
sleep(2) if $count != 0; # reduce load
|
||||||
$count++;
|
$count++;
|
||||||
|
|
||||||
PVE::Cluster::check_cfs_quorum(); # abort when we loose quorum
|
PVE::Cluster::check_cfs_quorum(); # abort when we loose quorum
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
my $conf = PVE::QemuServer::load_config($vmid);
|
|
||||||
if ($conf->{onboot}) {
|
|
||||||
print STDERR "Starting Qemu VM $vmid\n";
|
print STDERR "Starting Qemu VM $vmid\n";
|
||||||
PVE::QemuServer::vm_start($storecfg, $vmid);
|
PVE::QemuServer::vm_start($storecfg, $vmid);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
print STDERR $@ if $@;
|
warn $@ if $@;
|
||||||
}
|
}
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
|
Loading…
Reference in New Issue
Block a user