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: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH v2 1/3] numa: move numa global variable nb_numa_nodes into MachineState
Date: Thu, 18 Apr 2019 11:26:24 -0300
User-agent: Mutt/1.10.1 (2018-07-13)

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.

-- 
Eduardo



reply via email to

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