[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/30] virtio-pci: replace BusState.allow_hotplug wi
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 15/30] virtio-pci: replace BusState.allow_hotplug with hotplug_handler |
Date: |
Wed, 24 Sep 2014 11:48:04 +0000 |
Although virtio-pci-bus is internal object of composite
virtio-pci device and it doesn't participate in
-device/device_add hotplug flow, it's required by
bus_add_child() that bus must be hotpluggable to
be able to add child at runtime.
Set parent of virtio-pci-bus as NOP hotplug controller,
so that bus_add_child() would allow to add child
device during hotplug time when BusState.allow_hotplug
is dropped.
Signed-off-by: Igor Mammedov <address@hidden>
---
hw/virtio/virtio-pci.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index f560814..0486b25 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1070,6 +1070,10 @@ static const TypeInfo virtio_pci_info = {
.class_init = virtio_pci_class_init,
.class_size = sizeof(VirtioPCIClass),
.abstract = true,
+ .interfaces = (InterfaceInfo[]) {
+ { TYPE_HOTPLUG_HANDLER },
+ { }
+ }
};
/* virtio-blk-pci */
@@ -1543,13 +1547,11 @@ static void virtio_pci_bus_new(VirtioBusState *bus,
size_t bus_size,
VirtIOPCIProxy *dev)
{
DeviceState *qdev = DEVICE(dev);
- BusState *qbus;
char virtio_bus_name[] = "virtio-bus";
qbus_create_inplace(bus, bus_size, TYPE_VIRTIO_PCI_BUS, qdev,
virtio_bus_name);
- qbus = BUS(bus);
- qbus->allow_hotplug = 1;
+ qbus_set_hotplug_handler(BUS(bus), qdev, &error_abort);
}
static void virtio_pci_bus_class_init(ObjectClass *klass, void *data)
--
1.8.3.1
- Re: [Qemu-devel] [PATCH 13/30] qdev: hotplug: set handler only if HOTPLUG_HANDLER interface is supported, (continued)
[Qemu-devel] [PATCH 15/30] virtio-pci: replace BusState.allow_hotplug with hotplug_handler,
Igor Mammedov <=
[Qemu-devel] [PATCH 17/30] virtio-mmio: drop useless bus->allow_hotplug = 0, Igor Mammedov, 2014/09/24
[Qemu-devel] [PATCH 18/30] s390x: drop not used allow_hotplug in event-facility, Igor Mammedov, 2014/09/24
[Qemu-devel] [PATCH 19/30] s390x: convert s390-virtio to hotplug handler API, Igor Mammedov, 2014/09/24
[Qemu-devel] [PATCH 20/30] s390x: convert virtio-ccw to hotplug handler API, Igor Mammedov, 2014/09/24