From patchwork Fri Dec 25 05:23:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yolkfull Chow X-Patchwork-Id: 69737 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBP5Npcs010231 for ; Fri, 25 Dec 2009 05:23:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751103AbZLYFXn (ORCPT ); Fri, 25 Dec 2009 00:23:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751166AbZLYFXn (ORCPT ); Fri, 25 Dec 2009 00:23:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33280 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751036AbZLYFXn (ORCPT ); Fri, 25 Dec 2009 00:23:43 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBP5NdhY013327 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 25 Dec 2009 00:23:40 -0500 Received: from localhost.localdomain (dhcp-65-181.nay.redhat.com [10.66.65.181]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBP5NaZN031329; Fri, 25 Dec 2009 00:23:38 -0500 From: Yolkfull Chow To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Yolkfull Chow Subject: [Autotest PATCH] KVM test: Fixup memory size shown in 'GB' in get_memory_size Date: Fri, 25 Dec 2009 13:23:36 +0800 Message-Id: <1261718616-12864-1-git-send-email-yzhou@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index cc314d4..7229b79 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -854,7 +854,11 @@ class VM: mem_size = 0 for m in mem: mem_size += int(m) - if not "MB" in mem_str: + if "GB" in mem_str: + mem_size *= 1024 + elif "MB" in mem_str: + pass + else: mem_size /= 1024 return int(mem_size) return None