[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 39/47] usb: Convert usb devices to hotplug handler AP
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 39/47] usb: Convert usb devices to hotplug handler API |
Date: |
Wed, 15 Oct 2014 05:09:13 +0200 |
From: Igor Mammedov <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
hw/usb/bus.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index da1eba9..986b2d8 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -24,10 +24,12 @@ static Property usb_props[] = {
static void usb_bus_class_init(ObjectClass *klass, void *data)
{
BusClass *k = BUS_CLASS(klass);
+ HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(klass);
k->print_dev = usb_bus_dev_print;
k->get_dev_path = usb_get_dev_path;
k->get_fw_dev_path = usb_get_fw_dev_path;
+ hc->unplug = qdev_simple_device_unplug_cb;
}
static const TypeInfo usb_bus_info = {
@@ -35,6 +37,10 @@ static const TypeInfo usb_bus_info = {
.parent = TYPE_BUS,
.instance_size = sizeof(USBBus),
.class_init = usb_bus_class_init,
+ .interfaces = (InterfaceInfo[]) {
+ { TYPE_HOTPLUG_HANDLER },
+ { }
+ }
};
static int next_usb_bus = 0;
@@ -79,9 +85,9 @@ void usb_bus_new(USBBus *bus, size_t bus_size,
USBBusOps *ops, DeviceState *host)
{
qbus_create_inplace(bus, bus_size, TYPE_USB_BUS, host, NULL);
+ qbus_set_bus_hotplug_handler(BUS(bus), &error_abort);
bus->ops = ops;
bus->busnr = next_usb_bus++;
- bus->qbus.allow_hotplug = 1; /* Yes, we can */
QTAILQ_INIT(&bus->free);
QTAILQ_INIT(&bus->used);
QTAILQ_INSERT_TAIL(&busses, bus, next);
@@ -701,7 +707,6 @@ static void usb_device_class_init(ObjectClass *klass, void
*data)
{
DeviceClass *k = DEVICE_CLASS(klass);
k->bus_type = TYPE_USB_BUS;
- k->unplug = qdev_simple_unplug_cb;
k->realize = usb_qdev_realize;
k->unrealize = usb_qdev_unrealize;
k->props = usb_props;
--
1.8.4.5
- [Qemu-devel] [PULL 34/47] scsi: Cleanup not used anymore SCSIBusInfo{hotplug, hot_unplug} fields, (continued)
- [Qemu-devel] [PULL 34/47] scsi: Cleanup not used anymore SCSIBusInfo{hotplug, hot_unplug} fields, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 32/47] scsi: Convert pvscsi HBA to hotplug handler API, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 28/47] s390x: Drop not used allow_hotplug in event-facility, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 26/47] virtio-serial: Convert to hotplug-handler API, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 33/47] scsi: Convert virtio-scsi HBA to hotplug handler API, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 36/47] usb-bot: Drop not needed "allow_hotplug = 0", Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 37/47] usb-storage: Drop not needed "allow_hotplug = 0", Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 43/47] qdev: Add description field in PropertyInfo struct, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 38/47] usb: Convert usb-ccid to hotplug handler API, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 35/47] usb-bot: Mark device as non hotpluggable, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 39/47] usb: Convert usb devices to hotplug handler API,
Andreas Färber <=
- [Qemu-devel] [PULL 42/47] qdev: device_del: Search for to be unplugged device in 'peripheral' container, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 41/47] qdev: HotplugHandler: Add support for unplugging BUS-less devices, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 45/47] qdev: Set the object property's description to the qdev property's., Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 44/47] qom: Add description field in ObjectProperty struct, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 40/47] qdev: Drop legacy hotplug fields/methods, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 46/47] qmp: Print descriptions of object properties, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 47/47] qdev: Drop legacy_name from qdev properties, Andreas Färber, 2014/10/14
- Re: [Qemu-devel] [PULL 00/47] QOM devices patch queue 2014-10-15, Peter Maydell, 2014/10/15