Skip to content

Commit

Permalink
virtio-mmio: Drop useless bus->allow_hotplug = 0
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Igor Mammedov authored and afaerber committed Oct 15, 2014
1 parent 0ddef15 commit 2f4f603
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions hw/virtio/virtio-mmio.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 2f4f603

Please sign in to comment.