[pve-devel] [PATCH qemu-server] qm create: Set the NICs firewall to enabled by default on container creation

Christian Ebner c.ebner at proxmox.com
Wed Apr 3 17:10:03 CEST 2019


Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 PVE/API2/Qemu.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 5469089..f9ce355 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -526,6 +526,10 @@ __PACKAGE__->register_method({
 
 		    PVE::QemuServer::cleanup_drive_path($opt, $storecfg, $drive);
 		    $param->{$opt} = PVE::QemuServer::print_drive($vmid, $drive);
+		} elsif ($opt =~ m/^net\d+/) {
+		    my $net = PVE::QemuServer::parse_net($param->{$opt});
+		    $net->{'firewall'} = 1 if !defined($net->{'firewall'});
+		    $param->{$opt} = PVE::QemuServer::print_net($net);
 		}
 	    }
 
-- 
2.11.0




More information about the pve-devel mailing list