mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
Fix xenapi_create re: Multiple VIFs for test 04_restore_withdevices_pos
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
This commit is contained in:
1 parent
a28f499e56
commit
a24516689f
1 file changed
+8
-4
@@ -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
|
||||