From mboxrd@z Thu Jan 1 00:00:00 1970 From: Teck Choon Giam Subject: Re: [patch] xen udev rule interfering with openvpn Date: Wed, 23 May 2012 10:22:22 +0800 Message-ID: References: <1334658395.23948.6.camel@zakaz.uk.xensource.com> <1334817587.11493.44.camel@dagon.hellion.org.uk> <1334912603.28331.2.camel@zakaz.uk.xensource.com> <20369.15528.270106.567037@mariner.uk.xensource.com> <1334918900.28331.47.camel@zakaz.uk.xensource.com> <20369.16555.46229.798603@mariner.uk.xensource.com> <1334919613.28331.53.camel@zakaz.uk.xensource.com> <20369.17085.330843.561841@mariner.uk.xensource.com> <1335347949.28015.19.camel@zakaz.uk.xensource.com> <20375.52677.287182.934829@mariner.uk.xensource.com> <1335348880.28015.24.camel@zakaz.uk.xensource.com> <1335358736.28015.41.camel@zakaz.uk.xensource.com> <20397.10224.96552.711065@mariner.uk.xensource.com> <1336861837.3891.29.camel@dagon.hellion.org.uk> <1337603519.24660.116.camel@zakaz.uk.xensource.com> <1337605458.24660.122.camel@zakaz.uk.xensource.com> <1337692779.10118.126.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1337692779.10118.126.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: "xen-devel@lists.xen.org" , Roger Pau Monne , Ian Jackson , M A Young List-Id: xen-devel@lists.xenproject.org On Tue, May 22, 2012 at 9:19 PM, Ian Campbell wro= te: > On Mon, 2012-05-21 at 14:16 +0100, Teck Choon Giam wrote: > >> vif5.0-emu Link encap:Ethernet =A0HWaddr 1A:58:5C:16:5C:02 >> =A0 =A0 =A0 =A0 =A0 inet6 addr: fe80::1858:5cff:fe16:5c02/64 Scope:Link >> =A0 =A0 =A0 =A0 =A0 UP BROADCAST RUNNING MULTICAST =A0MTU:1500 =A0Metric= :1 >> =A0 =A0 =A0 =A0 =A0 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 >> =A0 =A0 =A0 =A0 =A0 TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 >> =A0 =A0 =A0 =A0 =A0 collisions:0 txqueuelen:500 >> =A0 =A0 =A0 =A0 =A0 RX bytes:0 (0.0 b) =A0TX bytes:280 (280.0 b) > > The fact that this interface is up at this point is interesting, didn't > you mention something about this at another time? Yes, I did mentioned that $dev is up when test with xm create hvmdomain with vifname set which cause test #7 to fail. > > In the tap dev case I made the rename into: > =A0 =A0 =A0 =A0 =A0 =A0do_or_die ifconfig "$dev" down > =A0 =A0 =A0 =A0 =A0 =A0do_or_die ip link set "$dev" name "$vifname" > > which seemed to workaround the issue for me. The workaround is identical for mine by bringing the $dev down. > > I think the reason this effects xm and not xl is that libxl uses > script=3Dnone to disable qemu-ifup while xend does not and instead ends up > using qemu-ifup which does some fiddling with the device too, including > bringing it up. Ok, so default for xend is using script=3Dqemu-ifup if script is not set? Am I right about this? > > The proper fix is probably to change xend, I'm a bit wary of this, > especially for a 4.1 backport, but the following looks right and works > for me. It's a bit more complex since in libxl we seem to only do this > for Linux (i.e. not NetBSD) and I guess we should do the same in xend > too. Err... if we are going to change default behaviour will we be affecting those users who is upgrading from xen-4.1 to xen-4.2? If your fix patch is going into xen-unstable for sure, I will re-run my tests by then. I hope it doesn't affect current domUs configuration (I mean we shouldn't need to change domU configuration) especially when users prefer to use xm then xl in xen-4.2. Thanks. Kindest regards, Giam Teck Choon > > Ian > > # HG changeset patch > # User Ian Campbell > # Date 1337692747 -3600 > # Node ID 426bbf58cea4559464b6e5d3ff0f65324a5f5926 > # Parent =A072ca5bc4eb6b91fa8dff51d439bd05f5586179df > xend: do not run a hotplug script from qemu on Linux > > The current vif-hotplug-common.sh for renaming the tap device is failing > because it is racing with this script and therefore the device is unexpec= tedly > up when we come to rename it. > > Fix this in the same way as libxl does, by disabling the script (only on > Linux). > > Signed-off-by: Ian Campbell > > diff -r 72ca5bc4eb6b -r 426bbf58cea4 tools/python/xen/xend/image.py > --- a/tools/python/xen/xend/image.py =A0 =A0Tue May 22 11:29:50 2012 +0100 > +++ b/tools/python/xen/xend/image.py =A0 =A0Tue May 22 14:19:07 2012 +0100 > @@ -919,8 +919,13 @@ class HVMImageHandler(ImageHandler): > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(nics, mac, model)) > =A0 =A0 =A0 =A0 =A0 =A0 vifname =3D "vif%d.%d-emu" % (self.vm.getDomid(),= nics-1) > =A0 =A0 =A0 =A0 =A0 =A0 ret.append("-net") > - =A0 =A0 =A0 =A0 =A0 =A0ret.append("tap,vlan=3D%d,ifname=3D%s,bridge=3D%= s" % > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (nics, vifname, bridge)) > + =A0 =A0 =A0 =A0 =A0 =A0if osdep.tapif_script is not None: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0script=3D",script=3D%s,downscript=3D%s" = % \ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(osdep.tapif_script, osd= ep.tapif_script) > + =A0 =A0 =A0 =A0 =A0 =A0else: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0script=3D"" > + =A0 =A0 =A0 =A0 =A0 =A0ret.append("tap,vlan=3D%d,ifname=3D%s,bridge=3D%= s%s" % > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (nics, vifname, bridge, scr= ipt)) > > =A0 =A0 =A0 =A0 if nics =3D=3D 0: > =A0 =A0 =A0 =A0 =A0 =A0 ret.append("-net") > diff -r 72ca5bc4eb6b -r 426bbf58cea4 tools/python/xen/xend/osdep.py > --- a/tools/python/xen/xend/osdep.py =A0 =A0Tue May 22 11:29:50 2012 +0100 > +++ b/tools/python/xen/xend/osdep.py =A0 =A0Tue May 22 14:19:07 2012 +0100 > @@ -30,6 +30,10 @@ _vif_script =3D { > =A0 =A0 "SunOS": "vif-vnic" > =A0} > > +_tapif_script =3D { > + =A0 =A0"Linux": "no", > +} > + > =A0PROC_XEN_BALLOON =3D '/proc/xen/balloon' > =A0SYSFS_XEN_MEMORY =3D '/sys/devices/system/xen_memory/xen_memory0' > > @@ -257,6 +261,7 @@ def _get(var, default=3DNone): > > =A0xend_autorestart =3D _get(_xend_autorestart) > =A0vif_script =3D _get(_vif_script, "vif-bridge") > +tapif_script =3D _get(_tapif_script) > =A0lookup_balloon_stat =3D _get(_balloon_stat, _linux_balloon_stat) > =A0get_cpuinfo =3D _get(_get_cpuinfo, _linux_get_cpuinfo) > =A0prefork =3D _get(_get_prefork, _default_prefork) > >