]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/QemuServer.pm
start: always stop an existing $vmid.scope
[qemu-server.git] / 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}