Add Gentoo handling to network-bridge. Based on patches
Hi Keir,
The network-bridge script is executed under -e so you'll either have to move the gentoo stuff before the set -e or refactor the if. Attached is a patch that moves it before the set -e since refactoring the if is gonna look pretty ugly.
Regards,
Anthony Liguori
Quoted 26 lines · Xen patchbot -unstable
# HG changeset patch
# User [email protected]
# Node IDe579bef0d237a12d3d52e2e61a6d48632fe61aff# Parente643fccb851bb5ef271057e02455661f4beff1bcAdd Gentoo handling to network-bridge. Based on patches from Jon Mason and Anthony Liguori.diff -r
e643fccb851b-re579bef0d237tools/examples/network-bridgetools/examples/network-bridge +0
-0@@ -54,6 +54,17 @@ antispoof=${antispoof:-no}echo "*network $OP bridge=$bridge netdev=$netdev antispoof=$antispoof" >&2
tools/examples/network-bridge +11
-0+ +# Gentoo doesn't have ifup/ifdown: define appropriate alternatives +which ifup >& /dev/null +if [ "$?" != 0 -a -e /etc/conf.d/net ]; then + ifup() { + /etc/init.d/net.$1 start + } + ifdown() { + /etc/init.d/net.$1 stop + } +fi
Quoted 10 lines
# Usage:
transfer_addrssrc dst
# Copy all IP addresses (including aliases) from device $src to device $dst._______________________________________________
Xen-changelog mailing list
[email protected]
http://lists.xensource.com/xen-changelog
# HG changeset patch
# User [email protected]
# Node ID f63d3f87db25e3cbe7309e1805a46357336e9200
# Parent 6f71824a45c19e860a3655dd8e76a83e047c84d2
Gentoo compatible stuff has to be done *before* the set -e. You could also do the which in the if with a combination of ! and || after the set -e but I think it's cleaner to just do it before the set -e.
tools/examples/network-bridge +16 -16
@@ -38,22 +38,6 @@ # Print routes. # #============================================================================ - -# Exit if anything goes wrong. -set -e - -# First arg is the operation. -OP=$1 -shift - -# Pull variables in args in to environment. -for arg ; do export "${arg}" ; done - -bridge=${bridge:-xen-br0} -netdev=${netdev:-eth0} -antispoof=${antispoof:-no} - -echo "*network $OP bridge=$bridge netdev=$netdev antispoof=$antispoof" >&2 # Gentoo doesn't have ifup/ifdown: define appropriate alternatives which ifup >& /dev/null
@@ -65,6 +49,22 @@ /etc/init.d/net.$1 stop } fi + +# Exit if anything goes wrong. +set -e + +# First arg is the operation. +OP=$1 +shift + +# Pull variables in args in to environment. +for arg ; do export "${arg}" ; done + +bridge=${bridge:-xen-br0} +netdev=${netdev:-eth0} +antispoof=${antispoof:-no} + +echo "*network $OP bridge=$bridge netdev=$netdev antispoof=$antispoof" >&2 # Usage: transfer_addrs src dst # Copy all IP addresses (including aliases) from device $src to device $dst.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
The patch that was commited did not fix Gentoo bridging problem (as Anthony describes below). The patch below fixes it. Good work Anthony!
Thanks,
Jon
Quoted 116 lines · Anthony Liguori
Hi Keir,
The network-bridge script is executed under -e so you'll either have to move the gentoo stuff before the set -e or refactor the if. Attached is a patch that moves it before the set -e since refactoring the if is gonna look pretty ugly.
Regards,
Anthony Liguori
Quoted 26 lines · Xen patchbot -unstable
# HG changeset patch
# User [email protected]
# Node IDe579bef0d237a12d3d52e2e61a6d48632fe61aff# Parente643fccb851bb5ef271057e02455661f4beff1bcAdd Gentoo handling to network-bridge. Based on patches from Jon Mason and Anthony Liguori.diff -r
e643fccb851b-re579bef0d237tools/examples/network-bridgetools/examples/network-bridge +0
-0@@ -54,6 +54,17 @@ antispoof=${antispoof:-no}echo "*network $OP bridge=$bridge netdev=$netdev antispoof=$antispoof" >&2
tools/examples/network-bridge +11
-0+ +# Gentoo doesn't have ifup/ifdown: define appropriate alternatives +which ifup >& /dev/null +if [ "$?" != 0 -a -e /etc/conf.d/net ]; then + ifup() { + /etc/init.d/net.$1 start + } + ifdown() { + /etc/init.d/net.$1 stop + } +fiQuoted 11 lines
# Usage:
transfer_addrssrc dst
# Copy all IP addresses (including aliases) from device $src to device $dst._______________________________________________
Xen-changelog mailing list
[email protected]
http://lists.xensource.com/xen-changelog# HG changeset patch
# User [email protected]
# Node IDf63d3f87db25e3cbe7309e1805a46357336e9200
# Parent6f71824a45c19e860a3655dd8e76a83e047c84d2
Gentoo compatible stuff has to be done *before* the set -e. You could also do the which in the if with a combination of ! and || after the set -e but I think it's cleaner to just do it before the set -e.Signed-off-by Anthony Liguori <[email protected]>diff -r
6f71824a45c1-rf63d3f87db25tools/examples/network-bridgetools/examples/network-bridge +16
-16@@ -38,22 +38,6 @@ # Print routes. # #============================================================================ - -# Exit if anything goes wrong. -set -e - -# First arg is the operation. -OP=$1 -shift - -# Pull variables in args in to environment. -for arg ; do export "${arg}" ; done - -bridge=${bridge:-xen-br0} -netdev=${netdev:-eth0} -antispoof=${antispoof:-no} - -echo "*network $OP bridge=$bridge netdev=$netdev antispoof=$antispoof" >&2 # Gentoo doesn't have ifup/ifdown: define appropriate alternatives which ifup >& /dev/null@@ -65,6 +49,22 @@ /etc/init.d/net.$1 stop } fi + +# Exit if anything goes wrong. +set -e + +# First arg is the operation. +OP=$1 +shift + +# Pull variables in args in to environment. +for arg ; do export "${arg}" ; done + +bridge=${bridge:-xen-br0} +netdev=${netdev:-eth0} +antispoof=${antispoof:-no} + +echo "*network $OP bridge=$bridge netdev=$netdev antispoof=$antispoof" >&2 # Usage: transfer_addrs src dst # Copy all IP addresses (including aliases) from device $src to device $dst._______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel