]> git.proxmox.com Git - qemu-server.git/commitdiff
vm_start : force systemctl stop if orphan scope exist
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 21 Apr 2016 13:18:28 +0000 (15:18 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 22 Apr 2016 09:09:09 +0000 (11:09 +0200)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/QemuServer.pm

index cd53978cd4cd2f7b4022399d01f3163369631ea6..02a689c42b175f3e44e4eae36df7762fff673427 100644 (file)
@@ -4531,6 +4531,12 @@ 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); };
+       }
+
        eval  { run_command($cmd, timeout => $statefile ? undef : 30,
                    umask => 0077); };