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-changelog

[Xen-changelog] Resurrect vifname xm create vif option support. This was

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Resurrect vifname xm create vif option support. This was present in earlier
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Dec 2005 19:38:12 +0000
Delivery-date: Tue, 13 Dec 2005 19:40:25 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 95f84e37c90d573dd01cc29db5b81ffb5f86f84a
# Parent  7256d2425fa795556903b706beed870014c48406
Resurrect vifname xm create vif option support.  This was present in earlier
versions of Xen, and allows one to name a vif when it is created.  This is
useful for integration with IP accounting packages, for example.

Closes bug #439.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 7256d2425fa7 -r 95f84e37c90d tools/examples/vif-common.sh
--- a/tools/examples/vif-common.sh      Tue Dec 13 17:31:35 2005
+++ b/tools/examples/vif-common.sh      Tue Dec 13 18:06:03 2005
@@ -51,6 +51,17 @@
 # Check presence of compulsory args.
 XENBUS_PATH="${XENBUS_PATH:?}"
 vif="${vif:?}"
+
+
+vifname=$(xenstore_read_default "$XENBUS_PATH/vifname" "")
+if [ "$vifname" ]
+then
+  if [ "$command" == "online" ] && ! ip link show "$vifname" >&/dev/null
+  then
+    do_or_die ip link set "$vif" name "$vifname"
+  fi
+  vif="$vifname"
+fi
 
 
 function frob_iptable()
diff -r 7256d2425fa7 -r 95f84e37c90d tools/python/xen/xend/server/netif.py
--- a/tools/python/xen/xend/server/netif.py     Tue Dec 13 17:31:35 2005
+++ b/tools/python/xen/xend/server/netif.py     Tue Dec 13 18:06:03 2005
@@ -74,9 +74,10 @@
         typ = sxp.child_value(config, 'type')
         if typ == 'ioemu':
             return (None,{},{})
-        bridge = sxp.child_value(config, 'bridge')
-        mac    = sxp.child_value(config, 'mac')
-        ipaddr = _get_config_ipaddr(config)
+        bridge  = sxp.child_value(config, 'bridge')
+        mac     = sxp.child_value(config, 'mac')
+        vifname = sxp.child_value(config, 'vifname')
+        ipaddr  = _get_config_ipaddr(config)
 
         devid = self.allocateDeviceID()
 
@@ -90,6 +91,8 @@
             back['ip'] = ' '.join(ipaddr)
         if bridge:
             back['bridge'] = bridge
+        if vifname:
+            back['vifname'] = vifname
 
         front = { 'handle' : "%i" % devid,
                   'mac'    : mac }
@@ -102,9 +105,8 @@
 
         result = DevController.configuration(self, devid)
 
-        (script, ip, bridge, mac) = self.readBackend(devid,
-                                                     'script', 'ip', 'bridge',
-                                                     'mac')
+        (script, ip, bridge, mac, typ, vifname) = self.readBackend(
+            devid, 'script', 'ip', 'bridge', 'mac', 'type', 'vifname')
 
         if script:
             result.append(['script',
@@ -116,5 +118,9 @@
             result.append(['bridge', bridge])
         if mac:
             result.append(['mac', mac])
+        if typ:
+            result.append(['type', typ])
+        if vifname:
+            result.append(['vifname', vifname])
 
         return result

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Resurrect vifname xm create vif option support. This was present in earlier, Xen patchbot -unstable <=