All of lore.kernel.org
 help / color / mirror / Atom feed
* [Autotest PATCH] KVM test: Fixup memory size shown in 'GB' in get_memory_size
@ 2009-12-25  5:23 Yolkfull Chow
  2009-12-26  7:34 ` Jason Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Yolkfull Chow @ 2009-12-25  5:23 UTC (permalink / raw)
  To: autotest; +Cc: kvm

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 <yzhou@redhat.com>
---
 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
-- 
1.6.5.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Autotest PATCH] KVM test: Fixup memory size shown in 'GB' in get_memory_size
  2009-12-25  5:23 [Autotest PATCH] KVM test: Fixup memory size shown in 'GB' in get_memory_size Yolkfull Chow
@ 2009-12-26  7:34 ` Jason Wang
  2009-12-26  7:39   ` [Autotest] " Jason Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Wang @ 2009-12-26  7:34 UTC (permalink / raw)
  To: Yolkfull Chow; +Cc: autotest, kvm

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 <yzhou@redhat.com>
> ---
>  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
>   

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Autotest] [Autotest PATCH] KVM test: Fixup memory size shown in 'GB' in get_memory_size
  2009-12-26  7:34 ` Jason Wang
@ 2009-12-26  7:39   ` Jason Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Wang @ 2009-12-26  7:39 UTC (permalink / raw)
  To: Yolkfull Chow; +Cc: autotest, kvm

Sorry for the noise, please ignore this mail.
> 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 <yzhou@redhat.com>
>> ---
>>  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
>>   
>>     
>
> _______________________________________________
> Autotest mailing list
> Autotest@test.kernel.org
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>   


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-26  7:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-25  5:23 [Autotest PATCH] KVM test: Fixup memory size shown in 'GB' in get_memory_size Yolkfull Chow
2009-12-26  7:34 ` Jason Wang
2009-12-26  7:39   ` [Autotest] " Jason Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.