Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 362575

Summary: app-emulation/xen-tools-4.1.0-r1 - network-bridge will not create multiple bridges
Product: Gentoo Linux Reporter: Sylvain Chevalier <sylvain.chevalier>
Component: [OLD] UnspecifiedAssignee: Gentoo Xen Devs <xen>
Status: RESOLVED FIXED    
Severity: normal CC: bug, bugs.gentoo.org
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=382035
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: done according to comment 1
xen-tools-4.1.1-bridge.patch

Description Sylvain Chevalier 2011-04-08 09:21:34 UTC
After update from xen 4.0 to xen 4.1, if we still want to use xend (it is supposed to be ), and use a wrapper of network-bridge to create multiple bridges, only one bridge will be created. This is because a test has been added into network-bridge which stops if bridges already exist.


Reproducible: Always

Steps to Reproduce:
1. Use Xen 4.1 on a machine with several network interfaces (eg. 4)
2. Create a wrapper script to create 4 bridges. For example
/etc/xen/scripts/network-bridge-wrapper:
#!/bin/sh
/etc/xen/scripts/network-bridge "$@" vifnum=0 netdev=eth0 bridge=xenbr0
/etc/xen/scripts/network-bridge "$@" vifnum=1 netdev=eth1 bridge=xenbr1
/etc/xen/scripts/network-bridge "$@" vifnum=2 netdev=eth2 bridge=xenbr2
/etc/xen/scripts/network-bridge "$@" vifnum=3 netdev=eth3 bridge=xenbr3

3.In /etc/xen/xend-config.sxp, make sure you are using network-bridge configuration, and use the wrapper instead by replacing:
(network-script network-bridge)
by
(network-script network-bridge-wrapper)
4. Reboot

Actual Results:  
Only one bridge is created

Expected Results:  
There should be 4 bridges

If I comment out these 3 lines in network, it works fine, jsut as it did before the upgrade:

    #if [ `brctl show | wc -l` != 1 ]; then
    #    return
    #fi

The reason I understand is that xen does not want us to use these scripts anymore, only if it is necessary (ie only if no bridge exist). That is probably a bug to be reported upstream?
Comment 1 Klas Meder Boqvist 2011-06-19 11:33:43 UTC
I replaced the rows with:
if [ `brctl show | grep $netdev | wc -l` != 0 ]; then 
    return 
fi
Comment 2 Ian Delaney (RETIRED) gentoo-dev 2011-10-15 17:31:59 UTC
Created attachment 289885 [details, diff]
done according to comment 1
Comment 3 Ian Delaney (RETIRED) gentoo-dev 2011-10-15 17:35:00 UTC
Created attachment 289887 [details, diff]
xen-tools-4.1.1-bridge.patch
Comment 4 Norbert Marx 2011-10-21 18:11:50 UTC
I believe this patch is not a good idea. xend is obsolete and only the xl toolstack will be supported in future. xl Upgrade Checklist says: Configure your host networking using the configuration tools provided by your distribution. (See: HostConfiguration/Networking) (from http://wiki.xen.org/xenwiki/MigrationGuideToXen4.1+)

Change the /etc/conf.d/net and add net.* to your services. My example for two bridges:

bridge_xenbr0="eth0"
config_xenbr0="192.168.1.10/24"
routes_xenbr0="default gw 192.168.1.1"

dns_domain_xenbr0="xyz.local"                                                                                                                                                 
dns_servers_xenbr0="192.168.1.1"                                                                                                                                              
                                                                                                                                                                                      
bridge_xenbr1="eth1"                                                                                                                                                                  
config_xenbr1="null"                                                                                                                                                                  
                                                                                                                                                                                      
config_eth0="null"
config_eth1="null"
Comment 5 Ian Delaney (RETIRED) gentoo-dev 2011-10-22 07:41:03 UTC
well, point1.  this bug was set in April.

point 2.  Since then the use of xend has been made an option from the making of the xend flag in 4.1.1

point 3. At some point, your claim xend is obsolete will become true.  Until then, gentoo has for now adopted a position of supporting xen-3(still stable amd64) for a while.  xen-4 has been made stable in x86 and for some reason of insanity that escapes me, xen-4 amd64 has not yet occurred.

point 4. your example utilises eth0 and eth1.  Unless my understanding of networking bridges is fundamentally flawed, your said example necessitates the making of a legitimate eth0 and eth1 by ifconfig and friends during boot.  That is, this example requires two ethernet network cards.  How typical is that?  I myself have an ethernet and a wireless card, a mis-match for the example.

point 5. The notion of the patch as a bad idea is a generalisation.  It caters to the use of xend, therefore it is valid under the umbrella of use=xend.

point 6. xensource has clearly allowed for a period to phase out xend as a xen manager before committing itself to xl.  Hopefully by then any such fumblings in its networking scripts will be ironed out.  Until then, allow gentoo enough 'slack' to cater to both options.

point 7. When a decision is made by a 'qualified' dev, a likely outcome of this bug for resolution will be obsolete anyway.
Comment 6 Alexey Shvetsov archtester gentoo-dev 2011-10-24 12:01:59 UTC
Fixed in -r6