]> git.proxmox.com Git - qemu-server.git/commitdiff
start: always stop an existing $vmid.scope
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 16 Feb 2018 11:44:58 +0000 (12:44 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 12 Mar 2018 08:14:17 +0000 (09:14 +0100)
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>
PVE/QemuServer.pm

index 628ca3359cf11140ebb1d1242dabfb1e8e1c9aba..7d0f65c7377ecf73353b92cf7a091e4bfc9b7239 100644 (file)
@@ -4894,10 +4894,11 @@ sub vm_start {
 
        PVE::Storage::activate_volumes($storecfg, $vollist);
 
-       if (!check_running($vmid, 1) && -d "/sys/fs/cgroup/systemd/qemu.slice/$vmid.scope") {
-           my $cmd = [];
-           push @$cmd, '/bin/systemctl', 'stop', "$vmid.scope";
-           eval  { run_command($cmd); };
+       if (!check_running($vmid, 1)) {
+           eval {
+               run_command(['/bin/systemctl', 'stop', "$vmid.scope"],
+                   outfunc => sub {}, errfunc => sub {});
+           };
        }
 
        my $cpuunits = defined($conf->{cpuunits}) ? $conf->{cpuunits}