diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/python/xen/xend/image.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index faf12eabce..d6127bfb93 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -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") |