]> git.proxmox.com Git - pve-container.git/commitdiff
add net hot-unplug
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 25 Jun 2015 05:06:39 +0000 (07:06 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 26 Jun 2015 09:57:25 +0000 (11:57 +0200)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
src/PVE/LXC.pm

index 10257108f3bcb589bdb8175c714056e8b3c56b0d..f1c09c4ec629896356da0076aca25518bd7ab927 100644 (file)
@@ -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"
            }
@@ -1118,5 +1120,5 @@ sub destory_lxc_container {
        PVE::Tools::run_command($cmd);
     }
 }
-    
+
 1;