]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #2043: vm start: always stop existing systemd scopes
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 5 Feb 2019 08:40:17 +0000 (09:40 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 11 Feb 2019 07:12:32 +0000 (08:12 +0100)
commit 3c23aa808ccc946bad92d9bc63b6f833c61d0f52 tried to fix a issue
where after a stop mode backup a scope could still linger around, but
it actually removed the wrong check. If we want to remove a
lingering, not yet cleaned up, scope we need to check if said scope
exists not if a VM process is still running. While they are corelated
the scope will always get cleaned up _after_ it's processes are gone.

Should fix #2043, but as this is seemingly not that easy to fix one
for all I'll put the should as disclaimer here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: Wolfgang Bumiller <w.bumiller@proxmox.com>
PVE/QemuServer.pm

index 4a903a6dd58b5f95b4b00f6385a1779a935bc26e..6dc68a40665abe44e311f204ae39db37460b0019 100644 (file)
@@ -5204,7 +5204,7 @@ sub vm_start {
 
        PVE::Storage::activate_volumes($storecfg, $vollist);
 
-       if (!check_running($vmid, 1)) {
+       if (-d "/sys/fs/cgroup/systemd/qemu.slice/$vmid.scope") {
            eval {
                run_command(['/bin/systemctl', 'stop', "$vmid.scope"],
                    outfunc => sub {}, errfunc => sub {});