# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1255678582 -3600
# Node ID 38a20d76cdec60c5fa3e4480d487d5ae6181843c
# Parent 4872dc215d62d5d5f57869619d36d854342860c5
xm: Use 'vifname' config option to construct a qemu tap name.
Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>
---
tools/python/xen/xend/image.py | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff -r 4872dc215d62 -r 38a20d76cdec tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py Fri Oct 16 08:35:21 2009 +0100
+++ b/tools/python/xen/xend/image.py Fri Oct 16 08:36:22 2009 +0100
@@ -873,9 +873,14 @@ class HVMImageHandler(ImageHandler):
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")
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|