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

[Xen-devel] [OSSTEST PATCH 3/4] ts-xen-install: networking: Never rewrite the interface config



Instead, if we need to, simply change the physical interface in the
`iface' line to refer to xenbr0, and add the physical interface as a
`bridge_ports' along with the other bridge settings.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 ts-xen-install |   33 +++++----------------------------
 1 file changed, 5 insertions(+), 28 deletions(-)

diff --git a/ts-xen-install b/ts-xen-install
index b148163..ef26cba 100755
--- a/ts-xen-install
+++ b/ts-xen-install
@@ -295,36 +295,13 @@ sub nodhcp () {
     bridge_stp off
 END
 
-       my $routes= target_cmd_output_root($ho, "route -n");
+       logm("iface=$iface physif=$iface");
 
-       $routes =~ m/^ [0-9.]+ \s+ 0\.0\.0\.0 \s+ ([0-9.]+) \s+ \S*U\S* \s /mxi
-           or die "no own local network in route ?  $routes ";
-       my $netmask= $1;
-
-       $routes =~
-           m/^ 0\.0\.0\.0 \s+ ([0-9.]+) \s+ 0\.0\.0\.0 \s+ \S*UG\S* \s /mxi
-           or die "no default gateway ?  $routes ";
-       my $gateway= $1;
-
-       logm("iface $iface mask=$netmask gw=$gateway");
-
-        my $suppress= 0;
         while (<EI>) {
-            $suppress= 0 unless m/^\s+/;
-            s/^ \s* allow-hotplug \s+ (?: $physif | xenbr0 ) \s* $
-                /auto $iface\n/x;
-            if (m/^\s* iface \s+ (?: $physif | xenbr0 ) \s+ inet \s /x) {
-                $suppress= 1;
-                print EO <<END;
-iface $iface inet static
-    address $ho->{Ip}
-    netmask $netmask
-    gateway $gateway
-$bridgex
-END
-            }
-            print EO or die $!
-                unless $suppress;
+            if (s/^\s* iface \s+ \Q$physif\E \s+ /iface $iface /x) {
+               $_ .= $bridgex;
+           }
+            print EO or die $!;
         }
     });
 }    
-- 
1.7.10.4


_______________________________________________
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®.