On Thu, Apr 25, 2019 at 11:12:29AM +0800, Like Xu wrote: > On 2019/4/25 1:21, Eduardo Habkost wrote: [...] > > > > I think we all agree that qdev_get_machine() should eventually be > > available in softmmu only. > > I think we need to make it happen to avoid calling qdev_get_machine() > in user-only mode.
Agreed. My point is that we we shouldn't need a qdev_get_machine_unchecked() function at all if we first get rid of all user-only qdev_get_machine() calls. > > > > But I don't think we agree when it would be appropriate to call > > qdev_get_machine_unchecked() instead of qdev_get_machine(). > > > > On both examples in your patch, the code checks for TYPE_MACHINE > > immediately after calling qdev_get_machine_unchecked(). If that > > code is only useful in softmmu mode, when would anybody want to > > call qdev_get_machine_unchecked() in user-only mode? > > > > -- Eduardo