From patchwork Sun May 24 15:46:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 25595 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4OFiXVt012408 for ; Sun, 24 May 2009 15:44:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754809AbZEXPo3 (ORCPT ); Sun, 24 May 2009 11:44:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754784AbZEXPo3 (ORCPT ); Sun, 24 May 2009 11:44:29 -0400 Received: from mx2.redhat.com ([66.187.237.31]:49713 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754717AbZEXPo2 (ORCPT ); Sun, 24 May 2009 11:44:28 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4OFiUuQ029836 for ; Sun, 24 May 2009 11:44:30 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n4OFiTxE019928; Sun, 24 May 2009 11:44:29 -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 n4OFiMTw009023; Sun, 24 May 2009 11:44:28 -0400 From: Michael Goldish To: kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH] Use new function VM.get_name() to get the VM's name, instead of VM.name Date: Sun, 24 May 2009 18:46:40 +0300 Message-Id: In-Reply-To: <6a70cb56a775fdb688da0231073abb0ce4baa7b1.1243179847.git.mgoldish@redhat.com> References: <8e37a36c044c20259dcd8a34d72a651e85b37d5f.1243179847.git.mgoldish@redhat.com> <838bcae1b49be011e2cde1294a391a296059464a.1243179847.git.mgoldish@redhat.com> <6a70cb56a775fdb688da0231073abb0ce4baa7b1.1243179847.git.mgoldish@redhat.com> In-Reply-To: <8e37a36c044c20259dcd8a34d72a651e85b37d5f.1243179847.git.mgoldish@redhat.com> References: <8e37a36c044c20259dcd8a34d72a651e85b37d5f.1243179847.git.mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org kvm_vm.py: add function VM.get_name(). kvm_preprocessing.py: use VM.get_name() instead of directly accessing the .name attribute. Signed-off-by: Michael Goldish --- client/tests/kvm_runtest_2/kvm_preprocessing.py | 6 +++--- client/tests/kvm_runtest_2/kvm_vm.py | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/tests/kvm_runtest_2/kvm_preprocessing.py b/client/tests/kvm_runtest_2/kvm_preprocessing.py index c9eb35d..bcabf5a 100644 --- a/client/tests/kvm_runtest_2/kvm_preprocessing.py +++ b/client/tests/kvm_runtest_2/kvm_preprocessing.py @@ -178,7 +178,7 @@ def preprocess(test, params, env): if vm.is_dead(): continue if not vm.verify_process_identity(): - kvm_log.debug("VM '%s' seems to have been replaced by another process" % vm.name) + kvm_log.debug("VM '%s' seems to have been replaced by another process" % vm.get_name()) vm.pid = None # Destroy and remove VMs that are no longer needed in the environment @@ -187,8 +187,8 @@ def preprocess(test, params, env): vm = env[key] if not kvm_utils.is_vm(vm): continue - if not vm.name in requested_vms: - kvm_log.debug("VM '%s' found in environment but not required for test; removing it..." % vm.name) + if not vm.get_name() in requested_vms: + kvm_log.debug("VM '%s' found in environment but not required for test; removing it..." % vm.get_name()) vm.destroy() del env[key] diff --git a/client/tests/kvm_runtest_2/kvm_vm.py b/client/tests/kvm_runtest_2/kvm_vm.py index fab839f..df99859 100644 --- a/client/tests/kvm_runtest_2/kvm_vm.py +++ b/client/tests/kvm_runtest_2/kvm_vm.py @@ -454,6 +454,10 @@ class VM: """Return True iff the VM's PID does not exist.""" return not kvm_utils.pid_exists(self.pid) + def get_name(self): + """Return the VM's name.""" + return self.name + def get_params(self): """Return the VM's params dict.