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] [xen-unstable] Fix xenapi_create re: Multiple VIFs for t

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix xenapi_create re: Multiple VIFs for test 04_restore_withdevices_pos
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 23 Mar 2007 11:10:09 -0700
Delivery-date: Fri, 23 Mar 2007 11:09:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Fix xenapi_create re: Multiple VIFs for test 04_restore_withdevices_pos, Xen patchbot-unstable <=