On Wed, 3 Apr 2019 at 02:16, Eduardo Habkost <[email protected]> wrote: > > On Tue, Apr 02, 2019 at 11:23:42PM +0700, Peter Maydell wrote: > > One wrinkle to watch out for is code paths that are used in the > > linux-user emulator, where there is no machine at all... For instance > > cpu_common_realizefn() handles this case by explicitly checking > > whether the thing it gets back from qdev_get_machine() is a > > TYPE_MACHINE or not. > > Is there a real use case for calling qdev_get_machine() in user > mode?
In this case it's "I'm in a function which is in obj-common (so shared between user-only and system-emulation) and I need to do something if we're in system emulation mode". It could probably be restructured somehow. thanks -- PMM
