qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 9/9] hw/pci: switch to a generic hotplug handlin


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 9/9] hw/pci: switch to a generic hotplug handling for PCIDevice
Date: Mon, 20 Jan 2014 13:57:56 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

Il 20/01/2014 13:45, Igor Mammedov ha scritto:
> On Mon, 20 Jan 2014 13:36:39 +0200
> "Michael S. Tsirkin" <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]