From: Kurt Garloff Subject: Re: network-bridge script reworked Date: Fri, 21 Oct 2005 16:44:04 +0200 Message-ID: <20051021144404.GO28406@tpkurt.garloff.de> References: <20051019093502.GP8705@tpkurt.tagung.uni-hamburg.de> <20051020104100.GZ26910@leeni.uk.xensource.com> <20051020182220.GB13372@tpkurt.garloff.de> <20051021134809.GA27120@leeni.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0744019566==" Return-path: In-Reply-To: <20051021134809.GA27120@leeni.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ewan Mellor Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============0744019566== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fjEAjMKpll6GDq3U" Content-Disposition: inline --fjEAjMKpll6GDq3U Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 21, 2005 at 02:48:09PM +0100, Ewan Mellor wrote: > On Thu, Oct 20, 2005 at 08:22:20PM +0200, Kurt Garloff wrote: > Is this a reasonable solution: >=20 > if [ -e /etc/SuSE-release ] > then > ifup() > { > eval `/sbin/getcfg -d /etc/sysconfig/network/ -f ifcfg- -- $1` > /sbin/ifup ${HWD_CONFIG_0} $1 > } > ifdown() > { > eval `/sbin/getcfg -d /etc/sysconfig/network/ -f ifcfg- -- $1` > /sbin/ifdown ${HWD_CONFIG_0} $1 > } I like the approachm but it won't work. The reason is that we do the eval before the renaming of network interfaces.=20 So we get the config of the physical device in ${HWD_CONFIG_0}, then do the renaming, reassignment of MAC addresses and then use the config to ifup the virtual device. > In other words, override ifup and ifdown to do the right thing on SuSE. = That > way, in our scripts we can just write "ifup eth0". We already are doing = this > for Gentoo, so this would be my preferred solution, as it keeps all the > distro-specific stuff out of the script bodies. >=20 > My only doubt is that you use the eval before ifup and ifdown in op_start= (), > but not in op_stop(), and I wonder whether that is important. It's cleaner and safer to do it at both places. But it's hard to get it right due to the interface renaming for ifdown. So I did not address this: ifdown does little more than ip link down and kill dhcpcd ... so this is not an issue in real life. Best, --=20 Kurt Garloff, Director SUSE Labs, Novell Inc. --fjEAjMKpll6GDq3U Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFDWP60xmLh6hyYd04RAr/oAKCVkoTEKp3py6xHzRWLHf+NJoJVpQCggNsB zIhh5ZcOu7MswU3YyJLLH70= =AsaJ -----END PGP SIGNATURE----- --fjEAjMKpll6GDq3U-- --===============0744019566== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0744019566==--