[pve-devel] applied: [PATCH qemu-server 1/2] api: vm clone: remove cloned FW conf in error cleanup path

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jan 15 08:28:24 CET 2020


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 <t.lamprecht at proxmox.com>
---
 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.20.1





More information about the pve-devel mailing list