diff mbox

[KVM-AUTOTEST,4/7] KVM test: get_ifname(): use self.instance instead of self.vnc_port

Message ID 1287918070-4579-4-git-send-email-mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish Oct. 24, 2010, 11:01 a.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index 2db916f..a5c110c 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -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):