Skip to contentSkip to conversation

KVM test: Fixup memory size shown in 'GB' in get_memory_size

PATCH Applied Yolkfull Chow 2 participants 3 messages Dec 25, 2009 – Dec 26, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM test: Fixup memory size shown in 'GB' in get_memory_size

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.

---
 client/tests/kvm/kvm_vm.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
client/tests/kvm/kvm_vm.py +5 -1
index cc314d4..7229b79 100755
@@ -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
Signature · 1 line
1.6.5.5
Applied
#1 lore raw

Applied, thanks

Quoted 28 lines

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.

---
 client/tests/kvm/kvm_vm.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
client/tests/kvm/kvm_vm.py +5 -1
index cc314d4..7229b79 100755
@@ -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
#2 lore raw

Sorry for the noise, please ignore this mail.

Quoted 37 lines

Applied, thanks

Quoted 19 lines

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.

---
 client/tests/kvm/kvm_vm.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
client/tests/kvm/kvm_vm.py +0 -0
index cc314d4..7229b79 100755
@@ -854,7 +854,11 @@ class VM:
                 mem_size = 0
                 for m in mem:

client/tests/kvm/kvm_vm.py class VM: · line 864

Quoted 10 lines
client/tests/kvm/kvm_vm.py +5 -1
                     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
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest