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 22:54:40 +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> <1337765821.30233.7.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: 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 Wed, May 23, 2012 at 9:04 PM, Teck Choon Giam wrote: > On Wed, May 23, 2012 at 5:37 PM, Ian Campbell w= rote: >> On Wed, 2012-05-23 at 03:22 +0100, Teck Choon Giam wrote: >> >>> > >>> > 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 en= ds up >>> > using qemu-ifup which does some fiddling with the device too, includi= ng >>> > bringing it up. >>> >>> Ok, so default for xend is using script=3Dqemu-ifup if script is not >>> set? =A0Am I right about this? >> >> Yes. > > Thanks for clarifying. > >> >>> > 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? >> >> This was already a deliberate change made in xl, it does not effect the >> guest config, only the mechanisms by which that configuration is >> achieved. I think extending this to xend in order not to break xend in >> 4.2 is worthwhile. > > Noted. > >> >> I don't think we should be backporting any of this to 4.1 though. > > You mean your tap to -emu patch series including the latest fix patch > you posted shouldn't be backporting to 4.1? =A0If this is so, I am fine > since there isn't much difference for me as personally I kept few > custom patches in own xen packages. =A0Of course whatever get into > upstream is better though :p Just an update. I have run my tests with your fix patch in xen-unstable changeset 25386:340062faf298 and all are working fine. Thanks again. Kindest regards, Giam Teck Choon > >> >>> If your fix patch is going into xen-unstable for sure, I will re-run >>> my tests by then. =A0I 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. >> >> There should be no guest config change necessary. > > Noted. > >> >> Ian. > > Thanks for taking time to provide fix and responses. > > Kindest regards, > Giam Teck Choon > > > >> >>> >>> 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 fail= ing >>> > because it is racing with this script and therefore the device is une= xpectedly >>> > 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.getDomi= d(), 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,= osdep.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,= script)) >>> > >>> > =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) >>> > >>> > >> >>