xm: Use 'vifname' config option to construct a qemu tap name.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
This commit is contained in:
Keir Fraser committed 2009-10-16 08:36:22 +01:00
1 parent dea1048d11
commit 5a0730a435
1 file changed
+7 -2
+7 -2
View File
@@ -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")
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.