Il 20/01/2014 13:45, Igor Mammedov ha scritto: > On Mon, 20 Jan 2014 13:36:39 +0200 > "Michael S. Tsirkin" <m...@redhat.com> wrote: > >> On Tue, Jan 14, 2014 at 05:55:54PM +0100, Igor Mammedov wrote: >>> make qdev_unplug()/device_set_realized() to call hotplug handler's >>> plug/unplug methods if available and remove not needed anymore >>> hot(un)plug handling from PCIDevice. >>> >>> In case if hotplug handler is not available, revert to the legacy >>> hotplug method. >> >> When isn't it available? >> For buses other than PCI? > For example scsi virtio usb buses. > Paolo said he would convert scsi bus to this interface once series is in. > > Eventually all hotluggable buses will/should be converted to new interface > so that we could get rid of legacy implementation.
There are just 2 interesting implementations apart from PCI and SCSI: hw/ide/piix.c: dc->unplug = pci_piix3_xen_ide_unplug; hw/pci/pci.c: k->unplug = pci_unplug_device; hw/s390x/virtio-ccw.c: dc->unplug = virtio_ccw_busdev_unplug; hw/scsi/scsi-bus.c: k->unplug = scsi_qdev_unplug; Then, all that remains is these four: hw/char/virtio-serial-bus.c: k->unplug = qdev_simple_unplug_cb; hw/s390x/event-facility.c: dc->unplug = qdev_simple_unplug_cb; hw/s390x/s390-virtio-bus.c: dc->unplug = qdev_simple_unplug_cb; hw/usb/bus.c: k->unplug = qdev_simple_unplug_cb; but we can just inline qdev_simple_unplug_cb in the caller. Paolo