From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5EQY-0004Nv-Fi for qemu-devel@nongnu.org; Mon, 20 Jan 2014 07:58:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5EQT-0006oE-Tb for qemu-devel@nongnu.org; Mon, 20 Jan 2014 07:58:06 -0500 Received: from mail-qe0-x234.google.com ([2607:f8b0:400d:c02::234]:46063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5EQT-0006nc-Oi for qemu-devel@nongnu.org; Mon, 20 Jan 2014 07:58:01 -0500 Received: by mail-qe0-f52.google.com with SMTP id a11so4085617qen.39 for ; Mon, 20 Jan 2014 04:58:01 -0800 (PST) Sender: Paolo Bonzini Message-ID: <52DD1D54.8010102@redhat.com> Date: Mon, 20 Jan 2014 13:57:56 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1389718554-2387-1-git-send-email-imammedo@redhat.com> <1389718554-2387-10-git-send-email-imammedo@redhat.com> <20140120113639.GC11565@redhat.com> <20140120134502.05da1ffa@nial.usersys.redhat.com> In-Reply-To: <20140120134502.05da1ffa@nial.usersys.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 9/9] hw/pci: switch to a generic hotplug handling for PCIDevice List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: peter.crosthwaite@xilinx.com, marcel.a@redhat.com, "Michael S. Tsirkin" , qemu-devel@nongnu.org, aliguori@amazon.com, afaerber@suse.de Il 20/01/2014 13:45, Igor Mammedov ha scritto: > On Mon, 20 Jan 2014 13:36:39 +0200 > "Michael S. Tsirkin" 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