[pve-devel] [PATCH] fix hotplug ip configuration

Alexandre DERUMIER aderumier at odiso.com
Mon Jun 29 14:09:48 CEST 2015


>>> - die "no network bridge defined\n" if !$net->{bridge}; 
>>> - 
>>> - my $res = "bridge=$net->{bridge}"; 
>>> + my $res = {}; 
>
>why? 

In case we want to switch to a new bridge, and a failure occur

- unplug tap from initial bridge

  write config

- plug tap to new bridge ->failed


Technically, it's not a problem to have a veth not plugged in a bridge.





----- Mail original -----
De: "dietmar" <dietmar at proxmox.com>
À: "aderumier" <aderumier at odiso.com>, "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Lundi 29 Juin 2015 12:43:12
Objet: Re: [pve-devel] [PATCH] fix hotplug ip configuration

> diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm 
> index 76c512d..2b7069b 100644 
> --- a/src/PVE/LXC.pm 
> +++ b/src/PVE/LXC.pm 
> @@ -775,11 +775,9 @@ sub vmstatus { 
> sub print_lxc_network { 
> my $net = shift; 
> 
> - die "no network bridge defined\n" if !$net->{bridge}; 
> - 
> - my $res = "bridge=$net->{bridge}"; 
> + my $res = {}; 

why? 

> 
> - foreach my $k (qw(hwaddr mtu name ip gw ip6 gw6 firewall tag)) { 
> + foreach my $k (qw(bridge hwaddr mtu name ip gw ip6 gw6 firewall tag)) { 
> next if !defined($net->{$k}); 
> $res .= ",$k=$net->{$k}"; 
> } 
> @@ -852,6 +850,19 @@ sub find_lxc_console_pids { 
> return $res; 
> } 
> 



More information about the pve-devel mailing list