WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] static vif/tap names

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] static vif/tap names
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Wed, 14 Oct 2009 12:31:18 -0600
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 14 Oct 2009 11:31:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C6FB32E6.175A7%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C6FB32E6.175A7%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.18 (X11/20081112)
Keir Fraser wrote:
> On 14/10/2009 06:30, "Jim Fehlig" <jfehlig@xxxxxxxxxx> wrote:
>
>   
>> 1. Appending vifname, if specified, to "tap" (tap-<vifname>), otherwise
>> use current dynamic tapX.Y
>> 2. Add a 'tapname=' parameter to vif config.  This would allow
>> controlling the vif and tap interface names independently.
>>
>> Is once of these solutions acceptable?  Any alternate suggestions?
>>     
>
> Option (1) sounds nice and straightforward.
>   

Thanks.  Patch attached.

Regards,
Jim


    Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>

diff -r 18758847bf31 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Wed Oct 14 09:09:23 2009 +0100
+++ b/tools/python/xen/xend/image.py    Wed Oct 14 12:28:35 2009 -0600
@@ -869,9 +869,14 @@
             ret.append("-net")
             ret.append("nic,vlan=%d,macaddr=%s,model=%s" %
                        (nics, mac, model))
+            vifname = devinfo.get('vifname')
+            if vifname:
+                vifname = "tap-" + vifname
+            else:
+                vifname = "tap%d.%d" % (self.vm.getDomid(), nics-1)
             ret.append("-net")
-            ret.append("tap,vlan=%d,ifname=tap%d.%d,bridge=%s" %
-                       (nics, self.vm.getDomid(), nics-1, bridge))
+            ret.append("tap,vlan=%d,ifname=%s,bridge=%s" %
+                       (nics, vifname, bridge))
 
         if nics == 0:
             ret.append("-net")
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>