aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2014-09-26 09:28:27 +0000
committerAndreas Färber <afaerber@suse.de>2014-10-15 05:03:13 +0200
commit2f4f60351782c22744ae7c7de6afcefbe66f28a4 (patch)
tree09f09faa19d6f8eb62066f575f2a2c9802ae3bce /hw/virtio
parent0ddef15b0432fbcb65429e17b32231e18aa103c9 (diff)
downloadqemu-2f4f60351782c22744ae7c7de6afcefbe66f28a4.zip
qemu-2f4f60351782c22744ae7c7de6afcefbe66f28a4.tar.gz
qemu-2f4f60351782c22744ae7c7de6afcefbe66f28a4.tar.bz2
virtio-mmio: Drop useless bus->allow_hotplug = 0
Bus by default is not hotpluggable. virtio-mmio-bus and its parent types do not set allow_hotplug anywhere explicitly, so remove not needed field access and wrapper along with it. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/virtio')
-rw-r--r--hw/virtio/virtio-mmio.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c
index 18c6e5b..2450c13 100644
--- a/hw/virtio/virtio-mmio.c
+++ b/hw/virtio/virtio-mmio.c
@@ -89,9 +89,6 @@ typedef struct {
VirtioBusState bus;
} VirtIOMMIOProxy;
-static void virtio_mmio_bus_new(VirtioBusState *bus, size_t bus_size,
- VirtIOMMIOProxy *dev);
-
static uint64_t virtio_mmio_read(void *opaque, hwaddr offset, unsigned size)
{
VirtIOMMIOProxy *proxy = (VirtIOMMIOProxy *)opaque;
@@ -362,7 +359,8 @@ static void virtio_mmio_realizefn(DeviceState *d, Error **errp)
VirtIOMMIOProxy *proxy = VIRTIO_MMIO(d);
SysBusDevice *sbd = SYS_BUS_DEVICE(d);
- virtio_mmio_bus_new(&proxy->bus, sizeof(proxy->bus), proxy);
+ qbus_create_inplace(&proxy->bus, sizeof(proxy->bus), TYPE_VIRTIO_MMIO_BUS,
+ d, NULL);
sysbus_init_irq(sbd, &proxy->irq);
memory_region_init_io(&proxy->iomem, OBJECT(d), &virtio_mem_ops, proxy,
TYPE_VIRTIO_MMIO, 0x200);
@@ -393,17 +391,6 @@ static const TypeInfo virtio_mmio_info = {
/* virtio-mmio-bus. */
-static void virtio_mmio_bus_new(VirtioBusState *bus, size_t bus_size,
- VirtIOMMIOProxy *dev)
-{
- DeviceState *qdev = DEVICE(dev);
- BusState *qbus;
-
- qbus_create_inplace(bus, bus_size, TYPE_VIRTIO_MMIO_BUS, qdev, NULL);
- qbus = BUS(bus);
- qbus->allow_hotplug = 0;
-}
-
static void virtio_mmio_bus_class_init(ObjectClass *klass, void *data)
{
BusClass *bus_class = BUS_CLASS(klass);