KVMHypervisor: return memory and cpus as integers
authorGuido Trotter <ultrotter@google.com>
Tue, 12 May 2009 11:11:00 +0000 (12:11 +0100)
committerGuido Trotter <ultrotter@google.com>
Tue, 12 May 2009 11:30:25 +0000 (12:30 +0100)
Currently the KVM hypervisor returns strings for the memory and cpu
values, while the xen hypervisor returns integers. Making this uniform
converting the values to integers in KVM as well.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/hypervisor/hv_kvm.py

index 246c7f9..358de74 100644 (file)
@@ -194,9 +194,9 @@ class KVMHypervisor(hv_base.BaseHypervisor):
     while arg_list:
       arg =  arg_list.pop(0)
       if arg == '-m':
-        memory = arg_list.pop(0)
+        memory = int(arg_list.pop(0))
       elif arg == '-smp':
-        vcpus = arg_list.pop(0)
+        vcpus = int(arg_list.pop(0))
 
     return (instance_name, pid, memory, vcpus, stat, times)