followup: use new base config provided destroy_config method

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-10-18 11:12:39 +02:00
parent 3e8e214d73
commit 5172770df7
2 changed files with 4 additions and 3 deletions

View File

@ -1498,8 +1498,9 @@ __PACKAGE__->register_method({
PVE::QemuServer::destroy_vm($storecfg, $vmid, 1, $skiplock); PVE::QemuServer::destroy_vm($storecfg, $vmid, 1, $skiplock);
PVE::AccessControl::remove_vm_access($vmid); PVE::AccessControl::remove_vm_access($vmid);
PVE::Firewall::remove_vmfw_conf($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);
}); });
}; };

View File

@ -2665,7 +2665,7 @@ sub destroy_vm {
if ($keep_empty_config) { if ($keep_empty_config) {
PVE::Tools::file_set_contents($conffile, "memory: 128\n"); PVE::Tools::file_set_contents($conffile, "memory: 128\n");
} else { } else {
unlink $conffile; PVE::QemuConfig->destroy_config($vmid);
} }
# also remove unused disk # also remove unused disk