From c05c90a10df19f4abee61f8031fbe5b1cf618066 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 15 Jan 2020 08:06:14 +0100 Subject: [PATCH] api: vm clone: remove cloned FW conf in error cleanup path We clone the source VM firewall config before forking the "realcmd" worker, but did not mind cleaning it up again if the clone failed somewhere in the worker. Signed-off-by: Thomas Lamprecht --- PVE/API2/Qemu.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 454cd4a..f5e757a 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -2940,6 +2940,9 @@ __PACKAGE__->register_method({ eval { PVE::Storage::vdisk_free($storecfg, $volid); }; warn $@ if $@; } + + PVE::Firewall::remove_vmfw_conf($newid); + die "clone failed: $err"; } -- 2.39.2