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

Dietmar Maurer dietmar at proxmox.com
Mon Jun 29 16:03:23 CEST 2015



> On June 29, 2015 at 2:09 PM Alexandre DERUMIER <aderumier at odiso.com> wrote:
> 
> 
> >>> - 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.

But why do you set $rest to '{}', instead of ''?

And I think the resulting value starts with ','?

> 
> 
> 
> 
> 
> ----- 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