[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 85/86] numa: make exit() usage consistent
From: |
Thomas Huth |
Subject: |
Re: [PATCH v2 85/86] numa: make exit() usage consistent |
Date: |
Fri, 17 Jan 2020 09:26:49 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 17/01/2020 09.06, Philippe Mathieu-Daudé wrote:
> Hi Thomas,
>
> On 1/16/20 5:43 PM, Thomas Huth wrote:
>> On 15/01/2020 16.07, Igor Mammedov wrote:
>>> Signed-off-by: Igor Mammedov <address@hidden>
>>> ---
>>> CC: address@hidden
>>> ---
>>> hw/core/numa.c | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/hw/core/numa.c b/hw/core/numa.c
>>> index 3177066..47d5ea1 100644
>>> --- a/hw/core/numa.c
>>> +++ b/hw/core/numa.c
>>> @@ -718,7 +718,7 @@ void numa_complete_configuration(MachineState *ms)
>>> /* Report large node IDs first, to make mistakes easier to
>>> spot */
>>> if (!numa_info[i].present) {
>>> error_report("numa: Node ID missing: %d", i);
>>> - exit(1);
>>> + exit(EXIT_FAILURE);
>>> }
>>> }
>>> @@ -759,7 +759,7 @@ void numa_complete_configuration(MachineState *ms)
>>> error_report("total memory for NUMA nodes (0x%" PRIx64 ")"
>>> " should equal RAM size (0x" RAM_ADDR_FMT
>>> ")",
>>> numa_total, ram_size);
>>> - exit(1);
>>> + exit(EXIT_FAILURE);
>>> }
>>> if (!numa_uses_legacy_mem()) {
>>
>> Please don't. We've had exit(1) vs. exit(EXIT_FAILURE) discussions in
>> the past already, and IIRC there was no clear conclusion which one we
>> want to use. There are examples of changes to the numeric value in our
>> git history (see d54e4d7659ebecd0e1fa7ffc3e954197e09f8a1f for example),
>> and example of the other way round (see 4d1275c24d5d64d22ec4a30ce1b6a0
>> for example).
>>
>> Your patch series here is already big enough, so I suggest to drop this
>> patch from the series. If you want to change this, please suggest an
>> update to CODING_STYLE.rst first so that we agree upon one style for
>> exit() ... otherwise somebody else might change this back into numeric
>> values in a couple of months just because they have a different taste.
>
> TBH I find your suggestion a bit harsh. If you noticed this, it means
> you care about finding a consensus about which style the project should
> use, but then you ask Igor to update to CODING_STYLE to restart the
> discussion until we get an agreement, so he can apply his patch.
>
> If this patch were single, this could be understandable. Now considering
> the series size, as you suggested, as the patch author I'd obviously
> drop my patch and stay away of modifying a 'exit()' line forever.
>
> Maybe it is a good opportunity to restart the discussion and settle on a
> position, update CODING_STYLE.rst, do a global cleanup, update
> checkpatch to keep the code clean.
> As I don't remember such discussions, they might predate my involvement
> with the project. Do you mind starting a thread with pointers to the
> previous discussions?
Honestly, I don't care much whether we use exit(EXIT_FAILURE) or
exit(1). But I care about having less code churn, so that "git blame"
stays somewhat usable in the course of time, i.e. I really like to avoid
that we include such ping-pong patches where every author changes such
lines to their current taste.
Thus if someone really cares to change such matter-of-taste code lines,
I think it's fair to ask them to update CODING_STYLE first. Otherwise,
yes, please just leave the exit() lines as they are to avoid unnecessary
code churn.
Thanks,
Thomas
- Re: [libvirt] [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types, (continued)
Re: [PATCH v2 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types, David Gibson, 2020/01/15
[PATCH v2 85/86] numa: make exit() usage consistent, Igor Mammedov, 2020/01/15
[PATCH v2 86/86] numa: remove deprecated implicit RAM distribution between nodes, Igor Mammedov, 2020/01/15
[PATCH v2 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups, Igor Mammedov, 2020/01/15
- Re: [PATCH v2 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups, Thomas Huth, 2020/01/16
- Re: [PATCH v2 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups, Igor Mammedov, 2020/01/16
- Re: [PATCH v2 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups, Thomas Huth, 2020/01/17
- Re: [PATCH v2 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups, Igor Mammedov, 2020/01/17
- Re: [PATCH v2 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups, Thomas Huth, 2020/01/17
- Re: [PATCH v2 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups, Igor Mammedov, 2020/01/17
Re: [PATCH v2 00/86] refactor main RAM allocation to use hostmem backend, no-reply, 2020/01/15