@@ -959,10 +959,7 @@ class VM:
def get_ifname(self, nic_index=0):
"""
- Return the ifname of tap device for the guest nic.
-
- The vnc_port is unique for each VM, nic_index is unique for each nic
- of one VM, it can avoid repeated ifname.
+ Return the ifname of a tap device associated with a NIC.
@param nic_index: Index of the NIC
"""
@@ -972,8 +969,7 @@ class VM:
if nic_params.get("nic_ifname"):
return nic_params.get("nic_ifname")
else:
- return "%s_%s_%s" % (nic_params.get("nic_model"),
- nic_index, self.vnc_port)
+ return "t%d-%s" % (nic_index, self.instance[-11:])
def get_mac_address(self, nic_index=0):