From patchwork Sun Jun 13 14:33:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 105812 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5DEYRr4026976 for ; Sun, 13 Jun 2010 14:34:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753875Ab0FMOeT (ORCPT ); Sun, 13 Jun 2010 10:34:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22058 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753861Ab0FMOeP (ORCPT ); Sun, 13 Jun 2010 10:34:15 -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 o5DEYF98005952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 13 Jun 2010 10:34:15 -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 o5DEYEea019841; Sun, 13 Jun 2010 10:34:14 -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 o5DEY6v1030030; Sun, 13 Jun 2010 10:34:13 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 06/14] KVM test: kvm_vm.py: correct get_shared_meminfo() Date: Sun, 13 Jun 2010 17:33:37 +0300 Message-Id: <1276439625-32472-6-git-send-email-mgoldish@redhat.com> In-Reply-To: <1276439625-32472-5-git-send-email-mgoldish@redhat.com> References: <1276439625-32472-1-git-send-email-mgoldish@redhat.com> <1276439625-32472-2-git-send-email-mgoldish@redhat.com> <1276439625-32472-3-git-send-email-mgoldish@redhat.com> <1276439625-32472-4-git-send-email-mgoldish@redhat.com> <1276439625-32472-5-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 (demeter.kernel.org [140.211.167.41]); Sun, 13 Jun 2010 14:34:30 +0000 (UTC) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 9d3539f..f65d967 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -884,11 +884,10 @@ class VM: logging.error("Could not get shared memory info from dead VM.") return None - cmd = "cat /proc/%d/statm" % self.params.get('pid_' + self.name) - shm = int(os.popen(cmd).readline().split()[2]) + filename = "/proc/%d/statm" % self.get_pid() + shm = int(open(filename).read().split()[2]) # statm stores informations in pages, translate it to MB - shm = shm * 4 / 1024 - return shm + return shm * 4.0 / 1024 def remote_login(self, nic_index=0, timeout=10):