qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/core/machine: Add the missing delimiter in cpu_slot_to_string()
@ 2021-10-08  7:50 Yanan Wang
  2021-10-19  7:55 ` wangyanan (Y)
  2021-10-19  8:23 ` Laurent Vivier
  0 siblings, 2 replies; 5+ messages in thread
From: Yanan Wang @ 2021-10-08  7:50 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Yanan Wang, wanghaibin.wang, Paolo Bonzini,
	Philippe Mathieu-Daudé

The expected output string from cpu_slot_to_string() ought to be
like "socket-id: *, die-id: *, core-id: *, thread-id: *", so add
the missing ", " before "die-id". This affects the readability
of the error message.

Fixes: 176d2cda0d ("i386/cpu: Consolidate die-id validity in smp context")
Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
---
 hw/core/machine.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index b8d95eec32..0a23ae3106 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -1157,6 +1157,9 @@ static char *cpu_slot_to_string(const CPUArchId *cpu)
         g_string_append_printf(s, "socket-id: %"PRId64, cpu->props.socket_id);
     }
     if (cpu->props.has_die_id) {
+        if (s->len) {
+            g_string_append_printf(s, ", ");
+        }
         g_string_append_printf(s, "die-id: %"PRId64, cpu->props.die_id);
     }
     if (cpu->props.has_core_id) {
-- 
2.19.1



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

* Re: [PATCH] hw/core/machine: Add the missing delimiter in cpu_slot_to_string()
  2021-10-08  7:50 [PATCH] hw/core/machine: Add the missing delimiter in cpu_slot_to_string() Yanan Wang
@ 2021-10-19  7:55 ` wangyanan (Y)
  2021-10-19  8:23 ` Laurent Vivier
  1 sibling, 0 replies; 5+ messages in thread
From: wangyanan (Y) @ 2021-10-19  7:55 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: Paolo Bonzini, Philippe Mathieu-Daudé,
	Eduardo Habkost, wanghaibin.wang

Cc'ing qemu-trivial@nongnu.org. What about this simple one ?

Before this patch, with "-smp 4, dies=2" for a PC machine, we will 
generate warn strings like:
qemu-system-x86_64: warning: CPU(s) not present in any NUMA nodes: CPU 0 
[socket-id: 0die-id: 0, core-id: 0, thread-id: 0]

After we will get,
qemu-system-x86_64: warning: CPU(s) not present in any NUMA nodes: CPU 0 
[socket-id: 0, die-id: 0, core-id: 0, thread-id: 0]

Thanks,
Yanan

On 2021/10/8 15:50, Yanan Wang wrote:
> The expected output string from cpu_slot_to_string() ought to be
> like "socket-id: *, die-id: *, core-id: *, thread-id: *", so add
> the missing ", " before "die-id". This affects the readability
> of the error message.
>
> Fixes: 176d2cda0d ("i386/cpu: Consolidate die-id validity in smp context")
> Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
> ---
>   hw/core/machine.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index b8d95eec32..0a23ae3106 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -1157,6 +1157,9 @@ static char *cpu_slot_to_string(const CPUArchId *cpu)
>           g_string_append_printf(s, "socket-id: %"PRId64, cpu->props.socket_id);
>       }
>       if (cpu->props.has_die_id) {
> +        if (s->len) {
> +            g_string_append_printf(s, ", ");
> +        }
>           g_string_append_printf(s, "die-id: %"PRId64, cpu->props.die_id);
>       }
>       if (cpu->props.has_core_id) {



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

* Re: [PATCH] hw/core/machine: Add the missing delimiter in cpu_slot_to_string()
  2021-10-08  7:50 [PATCH] hw/core/machine: Add the missing delimiter in cpu_slot_to_string() Yanan Wang
  2021-10-19  7:55 ` wangyanan (Y)
@ 2021-10-19  8:23 ` Laurent Vivier
  2021-10-26 12:55   ` wangyanan (Y)
  1 sibling, 1 reply; 5+ messages in thread
From: Laurent Vivier @ 2021-10-19  8:23 UTC (permalink / raw)
  To: Yanan Wang, qemu-devel
  Cc: qemu-trivial, wanghaibin.wang, Philippe Mathieu-Daudé,
	Eduardo Habkost, Paolo Bonzini

Le 08/10/2021 à 09:50, Yanan Wang a écrit :
> The expected output string from cpu_slot_to_string() ought to be
> like "socket-id: *, die-id: *, core-id: *, thread-id: *", so add
> the missing ", " before "die-id". This affects the readability
> of the error message.
> 
> Fixes: 176d2cda0d ("i386/cpu: Consolidate die-id validity in smp context")
> Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
> ---
>  hw/core/machine.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index b8d95eec32..0a23ae3106 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -1157,6 +1157,9 @@ static char *cpu_slot_to_string(const CPUArchId *cpu)
>          g_string_append_printf(s, "socket-id: %"PRId64, cpu->props.socket_id);
>      }
>      if (cpu->props.has_die_id) {
> +        if (s->len) {
> +            g_string_append_printf(s, ", ");
> +        }
>          g_string_append_printf(s, "die-id: %"PRId64, cpu->props.die_id);
>      }
>      if (cpu->props.has_core_id) {
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>


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

* Re: [PATCH] hw/core/machine: Add the missing delimiter in cpu_slot_to_string()
  2021-10-19  8:23 ` Laurent Vivier
@ 2021-10-26 12:55   ` wangyanan (Y)
  2021-10-26 13:08     ` Laurent Vivier
  0 siblings, 1 reply; 5+ messages in thread
From: wangyanan (Y) @ 2021-10-26 12:55 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel
  Cc: qemu-trivial, wanghaibin.wang, Philippe Mathieu-Daudé,
	Eduardo Habkost, Paolo Bonzini


On 2021/10/19 16:23, Laurent Vivier wrote:
> Le 08/10/2021 à 09:50, Yanan Wang a écrit :
>> The expected output string from cpu_slot_to_string() ought to be
>> like "socket-id: *, die-id: *, core-id: *, thread-id: *", so add
>> the missing ", " before "die-id". This affects the readability
>> of the error message.
>>
>> Fixes: 176d2cda0d ("i386/cpu: Consolidate die-id validity in smp context")
>> Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
>> ---
>>   hw/core/machine.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/hw/core/machine.c b/hw/core/machine.c
>> index b8d95eec32..0a23ae3106 100644
>> --- a/hw/core/machine.c
>> +++ b/hw/core/machine.c
>> @@ -1157,6 +1157,9 @@ static char *cpu_slot_to_string(const CPUArchId *cpu)
>>           g_string_append_printf(s, "socket-id: %"PRId64, cpu->props.socket_id);
>>       }
>>       if (cpu->props.has_die_id) {
>> +        if (s->len) {
>> +            g_string_append_printf(s, ", ");
>> +        }
>>           g_string_append_printf(s, "die-id: %"PRId64, cpu->props.die_id);
>>       }
>>       if (cpu->props.has_core_id) {
>>
> Reviewed-by: Laurent Vivier <laurent@vivier.eu>
> .
Thanks! Will you take this one in the trivial branch ?

Thanks,
Yanan



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

* Re: [PATCH] hw/core/machine: Add the missing delimiter in cpu_slot_to_string()
  2021-10-26 12:55   ` wangyanan (Y)
@ 2021-10-26 13:08     ` Laurent Vivier
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Vivier @ 2021-10-26 13:08 UTC (permalink / raw)
  To: wangyanan (Y), qemu-devel
  Cc: qemu-trivial, wanghaibin.wang, Philippe Mathieu-Daudé,
	Eduardo Habkost, Paolo Bonzini

Le 26/10/2021 à 14:55, wangyanan (Y) a écrit :
> 
> On 2021/10/19 16:23, Laurent Vivier wrote:
>> Le 08/10/2021 à 09:50, Yanan Wang a écrit :
>>> The expected output string from cpu_slot_to_string() ought to be
>>> like "socket-id: *, die-id: *, core-id: *, thread-id: *", so add
>>> the missing ", " before "die-id". This affects the readability
>>> of the error message.
>>>
>>> Fixes: 176d2cda0d ("i386/cpu: Consolidate die-id validity in smp context")
>>> Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
>>> ---
>>>   hw/core/machine.c | 3 +++
>>>   1 file changed, 3 insertions(+)
>>>
>>> diff --git a/hw/core/machine.c b/hw/core/machine.c
>>> index b8d95eec32..0a23ae3106 100644
>>> --- a/hw/core/machine.c
>>> +++ b/hw/core/machine.c
>>> @@ -1157,6 +1157,9 @@ static char *cpu_slot_to_string(const CPUArchId *cpu)
>>>           g_string_append_printf(s, "socket-id: %"PRId64, cpu->props.socket_id);
>>>       }
>>>       if (cpu->props.has_die_id) {
>>> +        if (s->len) {
>>> +            g_string_append_printf(s, ", ");
>>> +        }
>>>           g_string_append_printf(s, "die-id: %"PRId64, cpu->props.die_id);
>>>       }
>>>       if (cpu->props.has_core_id) {
>>>
>> Reviewed-by: Laurent Vivier <laurent@vivier.eu>
>> .
> Thanks! Will you take this one in the trivial branch ?


yes, sorry, I missed that one in my last collect. Thank you for the heads-up.

Applied to my trivial-patches branch.

Thanks,
Laurent




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

end of thread, other threads:[~2021-10-26 13:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-08  7:50 [PATCH] hw/core/machine: Add the missing delimiter in cpu_slot_to_string() Yanan Wang
2021-10-19  7:55 ` wangyanan (Y)
2021-10-19  8:23 ` Laurent Vivier
2021-10-26 12:55   ` wangyanan (Y)
2021-10-26 13:08     ` Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).