qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Replace calls to object_child_foreach() with ob


From: Ernest Esene
Subject: Re: [Qemu-devel] [PATCH] Replace calls to object_child_foreach() with object_child_foreach_recursive()
Date: Sun, 31 Mar 2019 22:48:46 +0100
User-agent: Mutt/1.11.4 (2019-03-13)

On Fri, Mar 29, 2019 at 10:47:22AM +0000, Stefan Hajnoczi wrote:
> On Tue, Mar 26, 2019 at 10:12:56AM +0100, Paolo Bonzini wrote:
> > On 26/03/19 08:43, Stefan Hajnoczi wrote:
> > > On Sun, Mar 10, 2019 at 02:39:13AM +0100, Ernest Esene wrote:
> > >> Replace calls to object_child_foreach() with 
> > >> object_child_foreach_recursive()
> > >> when applicable: nvdimm_device_list, nmi_monitor_handle, 
> > >> find_sysbus_device,
> > >> pc_dimm_slot2bitmap, build_dimm_list.
> > > 
> > > Ernest or Paolo: What is the rationale for this change?
> > 
> > The change could have been described better probably...  The idea is
> > that for example nvdimm_device_list could just stop invoking
> > object_child_foreach, because recursion is handled by
> > nvdimm_get_device_list:
> > 
> > >> @@ -41,7 +41,7 @@ static int nvdimm_device_list(Object *obj, void 
> > >> *opaque)
> > >>          *list = g_slist_append(*list, DEVICE(obj));
> > >>      }
> > >>  
> > >> -    object_child_foreach(obj, nvdimm_device_list, opaque);
> > >> +    object_child_foreach_recursive(obj, nvdimm_device_list, opaque);
> > >>      return 0;
> > >>  }
> > >>  
> > >> @@ -56,7 +56,8 @@ static GSList *nvdimm_get_device_list(void)
> > >>  {
> > >>      GSList *list = NULL;
> > >>  
> > >> -    object_child_foreach(qdev_get_machine(), nvdimm_device_list, &list);
> > >> +    object_child_foreach_recursive(qdev_get_machine(),
> > >> +                                   nvdimm_device_list, &list);
> > >>      return list;
> > >>  }
> 
> Thanks, that makes sense!
> 
> Ernest: If you want to continue with this task, please make the changes
> Paolo has suggested and update the commit description to say that
> manually calling object_child_foreach() is unnecessary for children
> since a single object_child_foreach_recursive() call can be used
> instead.
> 
> Thanks,
> Stefan

Thank you Stefan and Paolo, I shall do it.

-Ernest


Attachment: signature.asc
Description: PGP signature


reply via email to

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