[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 24/36] s390x: convert s390-virtio to hotplug hand
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH v3 24/36] s390x: convert s390-virtio to hotplug handler API |
Date: |
Fri, 26 Sep 2014 12:08:16 +0000 |
beside of conversion, patch drops present unplug
handling, effectively disabling hot-unplug of
s390-virtio devices.
Signed-off-by: Igor Mammedov <address@hidden>
---
v3:
disable unplug, Cornelia Huck <address@hidden>
v2:
fix not working unplug
---
hw/s390x/s390-virtio-bus.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 6b6fb61..7fa47d4 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -102,7 +102,7 @@ VirtIOS390Bus *s390_virtio_bus_init(ram_addr_t *ram_size)
bus->next_ring = bus->dev_page + TARGET_PAGE_SIZE;
/* Enable hotplugging */
- _bus->allow_hotplug = 1;
+ qbus_set_hotplug_handler(_bus, dev, &error_abort);
/* Allocate RAM for VirtIO device pages (descriptors, queues, rings) */
*ram_size += S390_DEVICE_PAGES * TARGET_PAGE_SIZE;
@@ -600,7 +600,6 @@ static void virtio_s390_device_class_init(ObjectClass
*klass, void *data)
dc->init = s390_virtio_busdev_init;
dc->bus_type = TYPE_S390_VIRTIO_BUS;
- dc->unplug = qdev_simple_unplug_cb;
dc->reset = s390_virtio_busdev_reset;
}
@@ -674,6 +673,7 @@ static int s390_virtio_bridge_init(SysBusDevice *dev)
static void s390_virtio_bridge_class_init(ObjectClass *klass, void *data)
{
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
+ HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(klass);
k->init = s390_virtio_bridge_init;
}
@@ -683,6 +683,10 @@ static const TypeInfo s390_virtio_bridge_info = {
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(SysBusDevice),
.class_init = s390_virtio_bridge_class_init,
+ .interfaces = (InterfaceInfo[]) {
+ { TYPE_HOTPLUG_HANDLER },
+ { }
+ }
};
/* virtio-s390-bus */
@@ -691,13 +695,10 @@ static void virtio_s390_bus_new(VirtioBusState *bus,
size_t bus_size,
VirtIOS390Device *dev)
{
DeviceState *qdev = DEVICE(dev);
- BusState *qbus;
char virtio_bus_name[] = "virtio-bus";
qbus_create_inplace(bus, bus_size, TYPE_VIRTIO_S390_BUS,
qdev, virtio_bus_name);
- qbus = BUS(bus);
- qbus->allow_hotplug = 1;
}
static void virtio_s390_bus_class_init(ObjectClass *klass, void *data)
--
1.8.3.1
- [Qemu-devel] [PATCH v2 17/36] qdev: add wrapper to set BUS as HotplugHandler, (continued)
- [Qemu-devel] [PATCH v2 17/36] qdev: add wrapper to set BUS as HotplugHandler, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 20/36] virtio-pci: drop BusState.allow_hotplug, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 21/36] virtio-serial: convert to hotplug-handler API, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 22/36] virtio-mmio: drop useless bus->allow_hotplug = 0, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 23/36] s390x: drop not used allow_hotplug in event-facility, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v2 24/36] s390x: convert s390-virtio to hotplug handler API, Igor Mammedov, 2014/09/26
- [Qemu-devel] [PATCH v3 24/36] s390x: convert s390-virtio to hotplug handler API,
Igor Mammedov <=
- [Qemu-devel] [PATCH v4 24/36] s390x: convert s390-virtio to hotplug handler API, Igor Mammedov, 2014/09/26
[Qemu-devel] [PATCH v2 25/36] s390x: convert virtio-ccw to hotplug handler API, Igor Mammedov, 2014/09/26
[Qemu-devel] [PATCH v2 26/36] scsi: set SCSI BUS itself as default HotplugHandler, Igor Mammedov, 2014/09/26
[Qemu-devel] [PATCH v2 31/36] usb-bot: drop not needed "allow_hotplug = 0", Igor Mammedov, 2014/09/26
[Qemu-devel] [PATCH v2 33/36] usb: convert usb-ccid to hotplug handler API, Igor Mammedov, 2014/09/26
[Qemu-devel] [PATCH v2 32/36] usb-storage: drop not needed "allow_hotplug = 0", Igor Mammedov, 2014/09/26