On Thu, 25 Sep 2014 16:32:37 +0200 Cornelia Huck <cornelia.h...@de.ibm.com> wrote:
> On Thu, 25 Sep 2014 15:11:10 +0200 > Igor Mammedov <imamm...@redhat.com> wrote: > > > On Thu, 25 Sep 2014 13:08:38 +0200 > > Cornelia Huck <cornelia.h...@de.ibm.com> wrote: > > > > So, to summarize, what happened before was > > > > > > bridge device <--- (simple unplug invoked for dev) > > simple unplug should not exits for above device > > Yes. I'm not sure why it does. > > > > > > -> virtual bus > > > -> virtio proxy device <--- virtio unplug invoked for dev > > > > > -> virtio bus > > > -> virtio device > > > > > > which your patch changed to > > > > > > bridge device > > > -> virtual bus <--- simple unplug invoked for virtio proxy dev > > > -> virtio proxy device > > > -> virtio bus <--- (virtio unplug invoked for virtio dev) > > > -> virtio device > > > > > > Am I understanding this correctly? > > Let's try other way around: > > > > bridge device (virtual_css_bridge) - non hotpluggable sysbus device > > -> virtual bus (VIRTUAL_CSS_BUS) > > -> virtio proxy device | > > -> virtio bus |- virtio_ccw_device_foo composite device managed > > with > > -> virtio device | device_add/del command > > > > internal "virtio device" is the only child of "virtio bus" and it's not > > supposed > > to be managed via device_add/del. > > This makes sense; I'm wondering why virtio-bus had allow_hotplug set > before, though. it was due to behavior of bus_add_child() which required bus to be hotplugggable. > > > > > So to unplug "virtio proxy device" we should call virtio_ccw_busdev_unplug > > stored in "bridge device" with "virtual bus" using bridge as > > hotplug-handler. > > > > does following patch work for you? > > It does react as expected with a simple device_add/device_del (your > patches applied up to patch 19 with this one on top). Thanks for confirmation, I'll amend s390-virtio in similar manner for V2