]> git.proxmox.com Git - qemu-server.git/commitdiff
api: vm clone: remove cloned FW conf in error cleanup path
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 15 Jan 2020 07:06:14 +0000 (08:06 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 15 Jan 2020 07:06:16 +0000 (08:06 +0100)
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@proxmox.com>
PVE/API2/Qemu.pm

index 454cd4aa06d7e4deab2792dde4387e7b0b951f87..f5e757a52473b549f54c79a0d305098bdaedc747 100644 (file)
@@ -2940,6 +2940,9 @@ __PACKAGE__->register_method({
                        eval { PVE::Storage::vdisk_free($storecfg, $volid); };
                        warn $@ if $@;
                    }
                        eval { PVE::Storage::vdisk_free($storecfg, $volid); };
                        warn $@ if $@;
                    }
+
+                   PVE::Firewall::remove_vmfw_conf($newid);
+
                    die "clone failed: $err";
                }
 
                    die "clone failed: $err";
                }