On Fri, 29 Nov 2019 at 20:05, Eduardo Habkost <ehabk...@redhat.com> wrote: > So, to summarize the current issues: > > 1) realize triggers a plug operation implicitly. > 2) unplug triggers unrealize implicitly. > > Do you expect to see use cases that will require us to implement > realize-without-plug?
I don't think so, but only because of the oddity that we put lots of devices on the 'sysbus' and claim that that's plugging them into the bus. The common case of 'realize' is where one device (say an SoC) has a bunch of child devices (like UARTs); the SoC's realize method realizes its child devices. Those devices all end up plugged into the 'sysbus' but there's no actual bus there, it's fictional and about the only thing it matters for is reset propagation (which we don't model right either). A few devices don't live on buses at all. > Similarly, do you expect use cases that will require us to > implement unplug-without-unrealize? I don't know enough about hotplug to answer this one: it's essentially what I'm hoping you'd be able to answer. I vaguely had in mind that eg the user might be able to create a 'disk' object, plug it into a SCSI bus, then unplug it from the bus without the disk and all its data evaporating, and maybe plug it back into the SCSI bus (or some other SCSI bus) later ? But I don't know anything about how we expose that kind of thing to the user via QMP/HMP. thanks -- PMM