[pve-devel] [PATCH qemu-server 1/2] restore firewall config from backup

Wolfgang Link w.link at proxmox.com
Mon Nov 23 14:38:33 CET 2015


---
 PVE/QemuServer.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 81a1c84..0c76083 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5300,6 +5300,10 @@ sub restore_vma_archive {
 	my $fh = IO::File->new($cfgfn, "r") ||
 	    "unable to read qemu-server.conf - $!\n";
 
+	if (-e "$tmpdir/firewall.fw") {
+	    PVE::Tools::file_atomic_copy("$tmpdir/firewall.fw", "/etc/pve/firewall/$vmid.fw");
+	};
+
 	while (defined(my $line = <$fh>)) {
 	    if ($line =~ m/^\#qmdump\#map:(\S+):(\S+):(\S*):(\S*):$/) {
 		my ($virtdev, $devname, $storeid, $format) = ($1, $2, $3, $4);
-- 
2.1.4





More information about the pve-devel mailing list