]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/API2/Qemu.pm
followup: use new base config provided destroy_config method
[qemu-server.git] / PVE / API2 / Qemu.pm
index 7e1d314762e4609d03c758bf4a3d4914c62a5f13..db436b3d4f2a37abea674eb3584e3776586246a5 100644 (file)
@@ -1498,8 +1498,9 @@ __PACKAGE__->register_method({
                PVE::QemuServer::destroy_vm($storecfg, $vmid, 1, $skiplock);
                PVE::AccessControl::remove_vm_access($vmid);
                PVE::Firewall::remove_vmfw_conf($vmid);
-               unlink PVE::QemuConfig->config_file($vmid)
-                   or die "Removal of VM $vmid config file failed: $!\n";
+
+               # only now remove the zombie config, else we can have reuse race
+               PVE::QemuConfig->destroy_config($vmid);
            });
        };