[pve-devel] [PATCH 1/3] add net hot-unplug

Alexandre Derumier aderumier at odiso.com
Thu Jun 25 07:06:39 CEST 2015


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 src/PVE/LXC.pm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 2ddee60..5acb3c2 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -13,6 +13,7 @@ use PVE::SafeSyslog;
 use PVE::INotify;
 use PVE::JSONSchema qw(get_standard_option);
 use PVE::Tools qw($IPV6RE $IPV4RE);
+use PVE::Network;
 
 use Data::Dumper;
 
@@ -1008,10 +1009,11 @@ sub update_lxc_config {
 		delete $conf->{'pve.searchdomain'};
 		push @nohotplug, $opt;
 		next if $running;
-	    } elsif ($opt =~ m/^net\d$/) {
+	    } elsif ($opt =~ m/^net(\d)$/) {
 		delete $conf->{$opt};
-		push @nohotplug, $opt;
-		next if $running;
+		next if !$running;
+		my $netid = $1;
+		PVE::Network::veth_delete("veth${vmid}.$netid");
 	    } else {
 		die "implement me"
 	    }
@@ -1116,5 +1118,5 @@ sub destory_lxc_container {
 	PVE::Tools::run_command($cmd);
     }
 }
-    
+
 1;
-- 
2.1.4




More information about the pve-devel mailing list