On 18/11/2020 09.50, Markus Armbruster wrote: > Markus Armbruster <arm...@redhat.com> writes: > > [...] >> qdev_device_add() looks like a bus-less device is usable if the machine >> provides a hotplug handler for it. Commit 03fcbd9dc5 "qdev: Check for >> the availability of a hotplug controller before adding a device" seems >> to be pertinent. > > Nope. A hotplug handler is only required for hot plug (d'oh!), not for > cold plug. > > I wonder whether bus-less devices should default to .user_creatable = > false like sysbus devices, and for the same reasons. > > To actually *do* something, a physical device requires some connection > to the rest of the world. Same for a virtual device (at least the ones > that model physical devices).
I know at least two virtual devices that are bus-less and cold-pluggable: hw/ppc/spapr_rng.c and hw/watchdog/wdt_diag288.c ... but we could certainly mark them with user_creatable = true manually if we decide that bus-less devices should be handled differently by default. Thomas