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

Wolfgang Link w.link at proxmox.com
Fri Nov 20 08:41:51 CET 2015


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

diff --git a/src/PVE/VZDump/LXC.pm b/src/PVE/VZDump/LXC.pm
index 72ad9c0..99a08b2 100644
--- a/src/PVE/VZDump/LXC.pm
+++ b/src/PVE/VZDump/LXC.pm
@@ -4,6 +4,7 @@ use strict;
 use warnings;
 use File::Path;
 use File::Basename;
+use File::Copy;
 use PVE::INotify;
 use PVE::Cluster qw(cfs_read_file);
 use PVE::Storage;
@@ -252,6 +253,8 @@ 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));
+
+    $task->{fw} = File::Copy::copy("/etc/pve/firewall/$vmid.fw", "$tmpdir/etc/vzdump/firewall.fw");
 }
 
 sub archive {
@@ -297,6 +300,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