From patchwork Sun Oct 24 11:01:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 265412 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9OB1RJ2008706 for ; Sun, 24 Oct 2010 11:01:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932480Ab0JXLBV (ORCPT ); Sun, 24 Oct 2010 07:01:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2873 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932459Ab0JXLBT (ORCPT ); Sun, 24 Oct 2010 07:01:19 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9OB1Itl027313 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 24 Oct 2010 07:01:18 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o9OB1I9t019873; Sun, 24 Oct 2010 07:01:18 -0400 Received: from localhost.localdomain (dhcp-1-188.tlv.redhat.com [10.35.1.188]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o9OB1BC6007247; Sun, 24 Oct 2010 07:01:17 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 4/7] KVM test: get_ifname(): use self.instance instead of self.vnc_port Date: Sun, 24 Oct 2010 13:01:07 +0200 Message-Id: <1287918070-4579-4-git-send-email-mgoldish@redhat.com> In-Reply-To: <1287918070-4579-3-git-send-email-mgoldish@redhat.com> References: <1287918070-4579-1-git-send-email-mgoldish@redhat.com> <1287918070-4579-2-git-send-email-mgoldish@redhat.com> <1287918070-4579-3-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 24 Oct 2010 11:01:27 +0000 (UTC) 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):