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

[Xen-changelog] [xen-unstable] Fix xenapi_create re: Multiple VIFs for test 04_restore_withdevices_pos



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1174647608 0
# Node ID 5dfa9b09b07cd2e9c515f9dff0dc3a90af8dc80a
# Parent  8b0be0ddc2234997aefe3f180d27df2b0f345d67
Fix xenapi_create re: Multiple VIFs for test 04_restore_withdevices_pos

Signed-off-by: Tom Wilkie <tom.wilkie@xxxxxxxxx>
---
 tools/python/xen/xm/xenapi_create.py |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff -r 8b0be0ddc223 -r 5dfa9b09b07c tools/python/xen/xm/xenapi_create.py
--- a/tools/python/xen/xm/xenapi_create.py      Fri Mar 23 10:59:49 2007 +0000
+++ b/tools/python/xen/xm/xenapi_create.py      Fri Mar 23 11:00:08 2007 +0000
@@ -611,7 +611,10 @@ class sxp2xml:
 
         vif = document.createElement("vif")
 
-        dev = get_child_by_name(vif_sxp, "vifname", "eth0")
+        dev = get_child_by_name(vif_sxp, "vifname", None)
+
+        if dev is None:
+            dev = self.getFreshEthDevice()
 
         vif.attributes["name"] \
             = "vif" + str(dev.__hash__())
@@ -628,7 +631,8 @@ class sxp2xml:
         
         return vif
 
-
-
-
-
+    _eths = -1
+
+    def getFreshEthDevice(self):
+        self._eths += 1
+        return "eth%i" % self._eths

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


 


Rackspace

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