[libvirt] [PATCH] virsh: Fix vcpupin command output wrong vcpu pinning info

Luyao Huang posted 1 patch 5 years, 3 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1545189421-631-1-git-send-email-lhuang@redhat.com
tools/virsh-domain.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[libvirt] [PATCH] virsh: Fix vcpupin command output wrong vcpu pinning info
Posted by Luyao Huang 5 years, 3 months ago
Commit 3072ded3 changed the waya to format the vcpu pinning info
and forget to get cpumap for each vcpu during the loop, that cause
vcpupin command will display vcpu 0 info for other vcpus.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
---
 tools/virsh-domain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 4d9f065..24f7852 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -6954,7 +6954,8 @@ virshVcpuPinQuery(vshControl *ctl,
             if (got_vcpu && i != vcpu)
                 continue;
 
-            if (!(pinInfo = virBitmapDataFormat(cpumap, cpumaplen)))
+            if (!(pinInfo = virBitmapDataFormat(VIR_GET_CPUMAP(cpumap, cpumaplen, i),
+                                                cpumaplen)))
                 goto cleanup;
 
             if (virAsprintf(&vcpuStr, "%zu", i) < 0)
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] virsh: Fix vcpupin command output wrong vcpu pinning info
Posted by Michal Privoznik 5 years, 3 months ago
On 12/19/18 4:17 AM, Luyao Huang wrote:
> Commit 3072ded3 changed the waya to format the vcpu pinning info
> and forget to get cpumap for each vcpu during the loop, that cause
> vcpupin command will display vcpu 0 info for other vcpus.
> 
> Signed-off-by: Luyao Huang <lhuang@redhat.com>
> ---
>  tools/virsh-domain.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index 4d9f065..24f7852 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -6954,7 +6954,8 @@ virshVcpuPinQuery(vshControl *ctl,
>              if (got_vcpu && i != vcpu)
>                  continue;
>  
> -            if (!(pinInfo = virBitmapDataFormat(cpumap, cpumaplen)))
> +            if (!(pinInfo = virBitmapDataFormat(VIR_GET_CPUMAP(cpumap, cpumaplen, i),
> +                                                cpumaplen)))
>                  goto cleanup;
>  
>              if (virAsprintf(&vcpuStr, "%zu", i) < 0)
> 


ACKed and pushed.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] virsh: Fix vcpupin command output wrong vcpu pinning info
Posted by lhuang 5 years, 3 months ago

On 12/19/2018 05:27 PM, Michal Privoznik wrote:
> On 12/19/18 4:17 AM, Luyao Huang wrote:
>> Commit 3072ded3 changed the waya to format the vcpu pinning info
>> and forget to get cpumap for each vcpu during the loop, that cause
>> vcpupin command will display vcpu 0 info for other vcpus.
>>
>> Signed-off-by: Luyao Huang <lhuang@redhat.com>
>> ---
>>   tools/virsh-domain.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
>> index 4d9f065..24f7852 100644
>> --- a/tools/virsh-domain.c
>> +++ b/tools/virsh-domain.c
>> @@ -6954,7 +6954,8 @@ virshVcpuPinQuery(vshControl *ctl,
>>               if (got_vcpu && i != vcpu)
>>                   continue;
>>   
>> -            if (!(pinInfo = virBitmapDataFormat(cpumap, cpumaplen)))
>> +            if (!(pinInfo = virBitmapDataFormat(VIR_GET_CPUMAP(cpumap, cpumaplen, i),
>> +                                                cpumaplen)))
>>                   goto cleanup;
>>   
>>               if (virAsprintf(&vcpuStr, "%zu", i) < 0)
>>
>
> ACKed and pushed.

Thanks a lot for your quick review !

Luyao

> Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list