All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Teck Choon Giam <giamteckchoon@gmail.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>,
	M A Young <m.a.young@durham.ac.uk>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [patch] xen udev rule interfering with openvpn
Date: Fri, 20 Apr 2012 10:03:23 +0100	[thread overview]
Message-ID: <1334912603.28331.2.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <1334817587.11493.44.camel@dagon.hellion.org.uk>

On Thu, 2012-04-19 at 07:39 +0100, Ian Campbell wrote:
> > > diff -r 8d92d1f34921 -r de3e65d804cc tools/python/xen/xend/image.py
> > > --- a/tools/python/xen/xend/image.py    Mon Apr 16 17:57:00 2012 +0100
> > > +++ b/tools/python/xen/xend/image.py    Tue Apr 17 11:26:06 2012 +0100
> > > @@ -921,7 +921,7 @@ class HVMImageHandler(ImageHandler):
> > >             if vifname:
> > >                 vifname = "tap-" + vifname
> > 
> > The above shouldn't it be:
> > 
> > vifname = "xentap-" + vifname
> 
> You are absolutely right, not sure how I missed that!
> 
> I'm out-of-office today but I'll resend later.

8<--------------------

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1334912375 -3600
# Node ID fbc0dc31b6d71bed654a05ea85ec56c34ac2ef21
# Parent  f28eea0efe1223277400ff5408b1e85df5efdeac
libxl/xend: name tap devices with a xentap prefix

This prevents the udev scripts from operating on other tap devices (e.g.
openvpn etc)

Also add "xentap-" prefix to the tap device when an explicit name is given to
avoid a conflict with the vif device, which would otherwise have the same name.
Likewise correct the documentation for this option which suggested it applied
to HVM tap devices only.

Reported by Michael Young.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r f28eea0efe12 -r fbc0dc31b6d7 docs/misc/xl-network-configuration.markdown
--- a/docs/misc/xl-network-configuration.markdown	Fri Apr 20 09:59:12 2012 +0100
+++ b/docs/misc/xl-network-configuration.markdown	Fri Apr 20 09:59:35 2012 +0100
@@ -93,11 +93,14 @@ are:
 
 ### vifname
 
-This keyword is valid for HVM guest devices with `type=ioemu` only.
+Specifies the backend device name for the virtual device.
 
-Specifies the backend device name for an emulated device. The default
-is `tapDOMID.DEVID` where `DOMID` is the guest domain ID and `DEVID`
-is the device number.
+If the domain is an HVM domain then the associated emulated (tap)
+device will have a "xentap-" prefix added.
+
+The default name for the virtual device is `vifDOMID.DEVID` where
+`DOMID` is the guest domain ID and `DEVID` is the device
+number. Likewise the default tap name is `xentapDOMID.DEVID`.
 
 ### script
 
diff -r f28eea0efe12 -r fbc0dc31b6d7 tools/hotplug/Linux/vif-common.sh
--- a/tools/hotplug/Linux/vif-common.sh	Fri Apr 20 09:59:12 2012 +0100
+++ b/tools/hotplug/Linux/vif-common.sh	Fri Apr 20 09:59:35 2012 +0100
@@ -85,8 +85,8 @@ elif [ "$type_if" = tap ]; then
     : ${INTERFACE:?}
 
     # Get xenbus_path from device name.
-    # The name is built like that: "tap${domid}.${devid}".
-    dev_=${dev#tap}
+    # The name is built like that: "xentap${domid}.${devid}".
+    dev_=${dev#xentap}
     domid=${dev_%.*}
     devid=${dev_#*.}
 
diff -r f28eea0efe12 -r fbc0dc31b6d7 tools/hotplug/Linux/xen-backend.rules
--- a/tools/hotplug/Linux/xen-backend.rules	Fri Apr 20 09:59:12 2012 +0100
+++ b/tools/hotplug/Linux/xen-backend.rules	Fri Apr 20 09:59:35 2012 +0100
@@ -13,4 +13,4 @@ KERNEL=="blktap-control", NAME="xen/blkt
 KERNEL=="gntdev", NAME="xen/%k", MODE="0600"
 KERNEL=="pci_iomul", NAME="xen/%k", MODE="0600"
 KERNEL=="tapdev[a-z]*", NAME="xen/blktap-2/tapdev%m", MODE="0600"
-SUBSYSTEM=="net", KERNEL=="tap*", ACTION=="add", RUN+="/etc/xen/scripts/vif-setup $env{ACTION} type_if=tap"
+SUBSYSTEM=="net", KERNEL=="xentap*", ACTION=="add", RUN+="/etc/xen/scripts/vif-setup $env{ACTION} type_if=tap"
diff -r f28eea0efe12 -r fbc0dc31b6d7 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Fri Apr 20 09:59:12 2012 +0100
+++ b/tools/libxl/libxl_dm.c	Fri Apr 20 09:59:35 2012 +0100
@@ -212,9 +212,9 @@ static char ** libxl__build_device_model
                 char *ifname;
                 if (!vifs[i].ifname)
                     ifname = libxl__sprintf(gc,
-                                            "tap%d.%d", domid, vifs[i].devid);
+                                            "xentap%d.%d", domid, vifs[i].devid);
                 else
-                    ifname = vifs[i].ifname;
+                    ifname = libxl__sprintf(gc, "xentap-%s", vifs[i].ifname);
                 flexarray_vappend(dm_args,
                                 "-net", libxl__sprintf(gc, "nic,vlan=%d,macaddr=%s,model=%s",
                                                        vifs[i].devid, smac, vifs[i].model),
@@ -451,10 +451,10 @@ static char ** libxl__build_device_model
                                 LIBXL_MAC_FMT, LIBXL_MAC_BYTES(vifs[i].mac));
                 char *ifname;
                 if (!vifs[i].ifname) {
-                    ifname = libxl__sprintf(gc, "tap%d.%d",
+                    ifname = libxl__sprintf(gc, "xentap%d.%d",
                                             guest_domid, vifs[i].devid);
                 } else {
-                    ifname = vifs[i].ifname;
+                    ifname = libxl__sprintf(gc, "xentap-%s", vifs[i].ifname);
                 }
                 flexarray_append(dm_args, "-device");
                 flexarray_append(dm_args,
diff -r f28eea0efe12 -r fbc0dc31b6d7 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py	Fri Apr 20 09:59:12 2012 +0100
+++ b/tools/python/xen/xend/image.py	Fri Apr 20 09:59:35 2012 +0100
@@ -919,9 +919,9 @@ class HVMImageHandler(ImageHandler):
                        (nics, mac, model))
             vifname = devinfo.get('vifname')
             if vifname:
-                vifname = "tap-" + vifname
+                vifname = "xentap-" + vifname
             else:
-                vifname = "tap%d.%d" % (self.vm.getDomid(), nics-1)
+                vifname = "xentap%d.%d" % (self.vm.getDomid(), nics-1)
             ret.append("-net")
             ret.append("tap,vlan=%d,ifname=%s,bridge=%s" %
                        (nics, vifname, bridge))

  reply	other threads:[~2012-04-20  9:03 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 19:03 [patch] xen udev rule interfering with openvpn M A Young
2012-04-17 10:26 ` Ian Campbell
2012-04-17 13:08   ` Roger Pau Monne
2012-04-18 18:25   ` Teck Choon Giam
2012-04-19  6:39     ` Ian Campbell
2012-04-20  9:03       ` Ian Campbell [this message]
2012-04-20 10:38         ` Ian Jackson
2012-04-20 10:48           ` Ian Campbell
2012-04-20 10:55             ` Ian Jackson
2012-04-20 11:00               ` Ian Campbell
2012-04-20 11:04                 ` Ian Jackson
2012-04-20 13:21                   ` Ian Campbell
2012-04-20 15:26                     ` Teck Choon Giam
2012-04-20 15:38                       ` Ian Campbell
2012-04-20 16:34                         ` Teck Choon Giam
2012-04-25  9:59                   ` Ian Campbell
2012-04-25 10:11                     ` Ian Jackson
2012-04-25 10:14                       ` Ian Campbell
2012-04-25 12:58                         ` Ian Campbell
2012-04-25 13:16                           ` Roger Pau Monne
2012-04-25 13:38                             ` Ian Campbell
2012-05-11 14:53                           ` Ian Jackson
2012-05-11 23:53                             ` Teck Choon Giam
2012-05-12  7:29                               ` Teck Choon Giam
2012-05-12 22:00                                 ` Teck Choon Giam
2012-05-12 22:30                                   ` Ian Campbell
2012-05-12 23:37                                     ` Teck Choon Giam
2012-05-13  0:39                                       ` Teck Choon Giam
2012-05-21 12:31                                         ` Ian Campbell
2012-05-21 12:51                                           ` Teck Choon Giam
2012-05-21 13:04                                             ` Ian Campbell
2012-05-21 13:16                                               ` Teck Choon Giam
2012-05-22 13:19                                                 ` Ian Campbell
2012-05-23  2:22                                                   ` Teck Choon Giam
2012-05-23  9:37                                                     ` Ian Campbell
2012-05-23 13:04                                                       ` Teck Choon Giam
2012-05-23 14:54                                                         ` Teck Choon Giam
2012-05-21 12:24                                       ` Teck Choon Giam
2012-05-21 12:49                                         ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1334912603.28331.2.camel@zakaz.uk.xensource.com \
    --to=ian.campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=giamteckchoon@gmail.com \
    --cc=m.a.young@durham.ac.uk \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.