[pve-devel] [PATCH pve-container 1/2] add firewall config to vzdump

Wolfgang Link w.link at proxmox.com
Mon Nov 23 14:35:12 CET 2015


it is necessary to copy firewall config first in tmp dir to prevent xattr warnings
---
 src/PVE/VZDump/LXC.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/PVE/VZDump/LXC.pm b/src/PVE/VZDump/LXC.pm
index 72ad9c0..e83e922 100644
--- a/src/PVE/VZDump/LXC.pm
+++ b/src/PVE/VZDump/LXC.pm
@@ -252,6 +252,12 @@ sub assemble {
     delete $conf->{'pve.parent'};
 
     PVE::Tools::file_set_contents("$tmpdir/etc/vzdump/pct.conf", PVE::LXC::write_pct_config("/lxc/$vmid.conf", $conf));
+
+    my $firewall ="/etc/pve/firewall/$vmid.fw";
+    if (-e  $firewall) {
+	PVE::Tools::file_atomic_copy($firewall, "$tmpdir/etc/vzdump/firewall.fw");
+	$task->{fw} = 1;
+    }
 }
 
 sub archive {
@@ -297,6 +303,7 @@ sub archive {
     # The directory parameter can give a alternative directory as source.
     # the second parameter gives the structure in the tar.
     push @$tar, "--directory=$tmpdir", './etc/vzdump/pct.conf';
+    push @$tar, "./etc/vzdump/firewall.fw" if $task->{fw};
     push @$tar, "--directory=$snapdir";
     push @$tar, map { "--exclude=.$_" } @{$self->{vzdump}->{findexcl}};
 
-- 
2.1.4





More information about the pve-devel mailing list