qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/3] numa: move numa global variable nb_numa_


From: Tao Xu
Subject: Re: [Qemu-devel] [PATCH v2 1/3] numa: move numa global variable nb_numa_nodes into MachineState
Date: Fri, 19 Apr 2019 10:11:06 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 4/18/2019 10:26 PM, Eduardo Habkost wrote:
On Thu, Apr 18, 2019 at 02:46:00PM +0800, Tao Xu wrote:
The aim of this patch is to add struct NumaState in MachineState
and move existing numa global nb_numa_nodes into NumaState.
And add variable numa_support into MachineClass to decide which
submachines support NUMA.

Suggested-by: Igor Mammedov <address@hidden>
Suggested-by: Eduardo Habkost <address@hidden>
Signed-off-by: Tao Xu <address@hidden>
[...]
+    int nb_numa_nodes = ms->numa_state ? ms->numa_state->nb_numa_nodes : 0;

I see 17 occurrences of this same pattern in the patch, and I had
to double-check the ones that didn't check if ms->numa_state is
NULL.

I think a
   int machine_num_numa_nodes(MachineState *ms)
helper would be useful.

While at it, I suggest naming the nb_numa_nodes field "num_nodes"
or "nr_nodes", because it's already inside a struct called
NumaState.

Thank you for your review, I will improve these in the next version of patch.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]