[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [OSSTEST PATCH 05/12] ts-xen-install: default the interface to the one in /etc/network/interfaces



On Tue, 2014-02-11 at 15:25 +0000, Ian Jackson wrote:
> The default was simply eth0.  This is the other piece of automatically
> coping with the boot interface not being eth0.
> 
> Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

I think/suspect this change is causing ts-xen-install to create me a
bridge with bridge_ports == xenbr0 on the second time (i.e. when using a
host).

I notice that the second half of this function explicitly suppresses
xenbr0 -- perhaps this first half should do something similar?

(I haven't tried but I assume using the "interface force" host prop
would fix this...)

> ---
>  ts-xen-install |   18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/ts-xen-install b/ts-xen-install
> index 09c90ce..a1f5998 100755
> --- a/ts-xen-install
> +++ b/ts-xen-install
> @@ -22,6 +22,7 @@ use File::Path;
>  use POSIX;
>  use Osstest::Debian;
>  use Osstest::TestSupport;
> +use Data::Dumper;
>  
>  my $checkmode= 0;
>  
> @@ -210,6 +211,23 @@ sub nodhcp () {
>                           "etc-network-interfaces", sub {
>          my $physif= get_host_property($ho,'interface force',undef);
>  
> +     if (!defined $physif) {
> +         # preread /etc/network/interfaces to figure out the interface
> +         my %candidates;
> +         while (<EI>) {
> +             next unless
> +                 m{^ \s* (  auto \s+ (\S+)               ) \s* $}x ||
> +                 m{^ \s* (  allow-hotplug \s+ (\S+)      ) \s* $}x ||
> +                 m{^ \s* (  iface \s+ (\S+) \s+ inet \s+ ) \s* $}x ;
> +             push @{ $candidates{$2} }, $1;
> +         }
> +         EI->error and die $!;
> +         delete $candidates{'lo'};
> +         die Dumper(\%candidates)." -- cannot determine default interface"
> +             unless (scalar keys %candidates) == 1;
> +         ($physif,) = keys %candidates;
> +         seek EI,0,0 or die $!;
> +     }
>       my ($iface,$bridgex);
>  
>       if ($initscripts_nobridge) {



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.