[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.