qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] qdev_get_machine() can return something non-NULL but not TYPE_MACHINE
@ 2017-09-04 16:36 Peter Maydell
  2017-09-04 19:38 ` Igor Mammedov
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2017-09-04 16:36 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Igor Mammedov, Paolo Bonzini

I just got bitten by qdev_get_machine()'s behaviour on the user-only
emulators, where it can return something that isn't NULL and isn't
an instance of TYPE_MACHINE either.

It looks like maybe this can happen in some cases in softmmu too,
judging by the way that qdev_get_hotplug_handler() does an
object_dynamic_cast() check that it really got back a TYPE_MACHINE.

Is this intentional? Does anything rely on qdev_get_machine()
returning something odd like this?

In the code I have which ran into this I can just make it do an
object_dynamic_cast() check like the hotplug_handler code does,
but if the current implementation is intentional we should
probably document that this is what you're supposed to do.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-09-12  9:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-04 16:36 [Qemu-devel] qdev_get_machine() can return something non-NULL but not TYPE_MACHINE Peter Maydell
2017-09-04 19:38 ` Igor Mammedov
2017-09-05  9:08   ` Peter Maydell
2017-09-11 12:10     ` Igor Mammedov
2017-09-11 13:33       ` Peter Maydell
2017-09-12  7:40         ` Igor Mammedov
2017-09-12  9:11           ` Peter Maydell
2017-09-12  9:53             ` Igor Mammedov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).