On Tue, Jul 23, 2019 at 04:56:41PM +0200, Igor Mammedov wrote:
> On Tue, 16 Jul 2019 22:51:12 +0800
> Tao Xu <tao3...@intel.com> wrote:
> 
> > Add struct NumaState in MachineState and move existing numa global
> > nb_numa_nodes(renamed as "num_nodes") into NumaState. And add variable
> > numa_support into MachineClass to decide which submachines support NUMA.
> > 
> > Suggested-by: Igor Mammedov <imamm...@redhat.com>
> > Suggested-by: Eduardo Habkost <ehabk...@redhat.com>
> > Signed-off-by: Tao Xu <tao3...@intel.com>
> > ---
> > 
> > No changes in v7.
> > 
> > Changes in v6:
> >     - Rebase to upstream, move globals in arm/sbsa-ref and use
> >       numa_mem_supported
> >     - When used once or twice in the function, use
> >       ms->numa_state->num_nodes directly
> >     - Correct some mistakes
> >     - Use once monitor_printf in hmp_info_numa
> > ---
[...]
> >      if (pxb->numa_node != NUMA_NODE_UNASSIGNED &&
> > -        pxb->numa_node >= nb_numa_nodes) {
> > +        pxb->numa_node >= ms->numa_state->num_nodes) {
> this will crash if user tries to use device on machine that doesn't support 
> numa
> check that numa_state is not NULL before dereferencing 

That's exactly why the machine_num_numa_nodes() was created in
v5, but then you asked for its removal.

-- 
Eduardo

Reply via email to