mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-07 16:21:31 +00:00
api: vm clone: unlink zombie target config at end of error cleanup
This is the guarantee that this call operates on it's created config. A VMID cannot be reused afterall. So only remove the guarantee at the last step, just before throwing up the error message about the clone failure. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
c05c90a10d
commit
990b65ab60
@ -2931,8 +2931,6 @@ __PACKAGE__->register_method({
|
|||||||
PVE::AccessControl::add_vm_to_pool($newid, $pool) if $pool;
|
PVE::AccessControl::add_vm_to_pool($newid, $pool) if $pool;
|
||||||
};
|
};
|
||||||
if (my $err = $@) {
|
if (my $err = $@) {
|
||||||
unlink $conffile;
|
|
||||||
|
|
||||||
eval { PVE::QemuServer::qemu_blockjobs_cancel($vmid, $jobs) };
|
eval { PVE::QemuServer::qemu_blockjobs_cancel($vmid, $jobs) };
|
||||||
sleep 1; # some storage like rbd need to wait before release volume - really?
|
sleep 1; # some storage like rbd need to wait before release volume - really?
|
||||||
|
|
||||||
@ -2943,6 +2941,8 @@ __PACKAGE__->register_method({
|
|||||||
|
|
||||||
PVE::Firewall::remove_vmfw_conf($newid);
|
PVE::Firewall::remove_vmfw_conf($newid);
|
||||||
|
|
||||||
|
unlink $conffile; # avoid races -> last thing before die
|
||||||
|
|
||||||
die "clone failed: $err";
|
die "clone failed: $err";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user