From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Wang Subject: Re: [Autotest PATCH] KVM test: Fixup memory size shown in 'GB' in get_memory_size Date: Sat, 26 Dec 2009 15:34:00 +0800 Message-ID: <4B35BC68.9090405@redhat.com> References: <1261718616-12864-1-git-send-email-yzhou@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: autotest@test.kernel.org, kvm@vger.kernel.org To: Yolkfull Chow Return-path: In-Reply-To: <1261718616-12864-1-git-send-email-yzhou@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autotest-bounces@test.kernel.org Errors-To: autotest-bounces@test.kernel.org List-Id: kvm.vger.kernel.org Applied, thanks > In guest RHEL-3.9 $mem_chk_cmd will catch memory size in GB which > will be computed wrongly in get_memory_size. This patch fix the problem. > > Thanks akong for pointing this out. > > Signed-off-by: Yolkfull Chow > --- > client/tests/kvm/kvm_vm.py | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > > 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 >