mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-13 08:19:15 +00:00
start: always stop an existing $vmid.scope
Checking for the cgroup directory is a kind of time-of-check time-of-use race condition stop-mode backups seem to occasionally run into on some systems. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
230406dc52
commit
3c23aa808c
@ -4894,10 +4894,11 @@ sub vm_start {
|
|||||||
|
|
||||||
PVE::Storage::activate_volumes($storecfg, $vollist);
|
PVE::Storage::activate_volumes($storecfg, $vollist);
|
||||||
|
|
||||||
if (!check_running($vmid, 1) && -d "/sys/fs/cgroup/systemd/qemu.slice/$vmid.scope") {
|
if (!check_running($vmid, 1)) {
|
||||||
my $cmd = [];
|
eval {
|
||||||
push @$cmd, '/bin/systemctl', 'stop', "$vmid.scope";
|
run_command(['/bin/systemctl', 'stop', "$vmid.scope"],
|
||||||
eval { run_command($cmd); };
|
outfunc => sub {}, errfunc => sub {});
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
my $cpuunits = defined($conf->{cpuunits}) ? $conf->{cpuunits}
|
my $cpuunits = defined($conf->{cpuunits}) ? $conf->{cpuunits}
|
||||||
|
Loading…
Reference in New Issue
Block a user