From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Fehlig Subject: Re: static vif/tap names Date: Wed, 14 Oct 2009 12:31:18 -0600 Message-ID: <4AD618F6.1080804@novell.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010004070501030306080902" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------010004070501030306080902 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Keir Fraser wrote: > On 14/10/2009 06:30, "Jim Fehlig" wrote: > > >> 1. Appending vifname, if specified, to "tap" (tap-), 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 --------------010004070501030306080902 Content-Type: text/x-patch; name="vifname.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="vifname.patch" 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") --------------010004070501030306080902 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------010004070501030306080902--