[libvirt] [test-API][PATCH] Fix a problem in cpu_affinity

Guannan Ren gren at redhat.com
Fri Nov 16 08:08:32 UTC 2012


On 11/16/2012 02:47 PM, Wayne Sun wrote:
> int() with base 16 will cause problem when cpu number bigger than
> 10, so change it as default with base 10.
>
> Signed-off-by: Wayne Sun <gsun at redhat.com>
> ---
>   repos/domain/cpu_affinity.py |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/repos/domain/cpu_affinity.py b/repos/domain/cpu_affinity.py
> index ee585e6..e710968 100644
> --- a/repos/domain/cpu_affinity.py
> +++ b/repos/domain/cpu_affinity.py
> @@ -151,7 +151,7 @@ def vcpu_affinity_check(domain_name, vcpu, expected_pinned_cpu, hypervisor):
>   
>               task_list = output.split('\n')[1:]
>               vcpu_task = task_list[int(vcpu)]
> -            actual_pinned_cpu = int(vcpu_task.split('\t')[1], 16)
> +            actual_pinned_cpu = int(vcpu_task.split('\t')[1])
>           elif 'el5' in host_kernel_version:
>               cmd_get_task_list = "grep Cpus_allowed /proc/%s/task/*/status" % pid
>               status, output = commands.getstatusoutput(cmd_get_task_list)

    Transition from hex to decimal.
    Actually we need digit in decimal.

    ACK and pushed.
    Guannan.




More information about the libvir-list mailing list