From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: Re: [PATCH] fix: domains do not get created when using vifname variable for bridged interfaces Date: Mon, 7 Feb 2011 17:23:04 +0000 Message-ID: References: <201102051726.30996.pittipatti@web.de> <19792.6596.96339.883733@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Return-path: In-Reply-To: <19792.6596.96339.883733@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: Patrick Scharrenberg , Anthony Perard , "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Mon, 7 Feb 2011, Ian Jackson wrote: > Patrick Scharrenberg writes ("[Xen-devel] [PATCH] fix: domains do not get created when using vifname variable for bridged interfaces"): > > In the two scripts vif-bridge and vif-route the variable containing > > the right interface-name, after an interface was renamed using > > "ifname", is $vif. Otherwise hotplug can't handle renamed > > interfaces and prevents xm from creating domains. > > This seems to be partly reverting 21922:0232bc7c9544 "tools/hotplug, > Use udev rules instead of qemu script to setup the bridge." > > I can't exactly follow the logic of 21922 but it seems to me that the > bug is that in the case of an interface of type vif which is later > renamed (by the code around line 75 of vif-common.sh in xen-unstable), > the shell variable dev is not changed. > > The change you are proposing would also an effect in the case of > interfaces of type tap and I'm not convinced that in this case it > would do the right thing. > > Anthony, Stefano: as the authors of 21922 would you care to comment ? I don't think that patch is the right way to fix the issue. Does this patch fix the problem for you? diff -r 9e463cb15658 tools/hotplug/Linux/vif-common.sh --- a/tools/hotplug/Linux/vif-common.sh Mon Feb 07 17:02:46 2011 +0000 +++ b/tools/hotplug/Linux/vif-common.sh Mon Feb 07 17:19:32 2011 +0000 @@ -69,16 +69,16 @@ if [ "$type_if" = vif ]; then if [ "$type_if" = vif ]; then # Check presence of compulsory args. XENBUS_PATH="${XENBUS_PATH:?}" - vif="${vif:?}" + dev="${dev:?}" vifname=$(xenstore_read_default "$XENBUS_PATH/vifname" "") if [ "$vifname" ] then if [ "$command" == "online" ] && ! ip link show "$vifname" >&/dev/null then - do_or_die ip link set "$vif" name "$vifname" + do_or_die ip link set "$dev" name "$vifname" fi - vif="$vifname" + dev="$vifname" fi elif [ "$type_if" = tap ]; then # Check presence of compulsory args. @@ -105,9 +105,9 @@ frob_iptable() local c="-D" fi - iptables "$c" FORWARD -m physdev --physdev-is-bridged --physdev-in "$vif" \ + iptables "$c" FORWARD -m physdev --physdev-is-bridged --physdev-in "$dev" \ "$@" -j ACCEPT 2>/dev/null && - iptables "$c" FORWARD -m physdev --physdev-is-bridged --physdev-out "$vif" \ + iptables "$c" FORWARD -m physdev --physdev-is-bridged --physdev-out "$dev" \ -j ACCEPT 2>/dev/null if [ "$command" == "online" -a $? -ne 0 ]