[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 39/46] hw/s390x/css-bridge: Realize sysbus device before accessing
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 39/46] hw/s390x/css-bridge: Realize sysbus device before accessing it |
Date: |
Thu, 19 Oct 2023 23:18:04 +0200 |
qbus_new() should not be called on unrealized device.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20231019071611.98885-10-philmd@linaro.org>
---
hw/s390x/css-bridge.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hw/s390x/css-bridge.c b/hw/s390x/css-bridge.c
index 4017081d49..15d26efc95 100644
--- a/hw/s390x/css-bridge.c
+++ b/hw/s390x/css-bridge.c
@@ -95,7 +95,6 @@ static const TypeInfo virtual_css_bus_info = {
VirtualCssBus *virtual_css_bus_init(void)
{
- VirtualCssBus *cbus;
BusState *bus;
DeviceState *dev;
@@ -103,19 +102,19 @@ VirtualCssBus *virtual_css_bus_init(void)
dev = qdev_new(TYPE_VIRTUAL_CSS_BRIDGE);
object_property_add_child(qdev_get_machine(), TYPE_VIRTUAL_CSS_BRIDGE,
OBJECT(dev));
- sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
/* Create bus on bridge device */
bus = qbus_new(TYPE_VIRTUAL_CSS_BUS, dev, "virtual-css");
- cbus = VIRTUAL_CSS_BUS(bus);
/* Enable hotplugging */
qbus_set_hotplug_handler(bus, OBJECT(dev));
+ sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
+
css_register_io_adapters(CSS_IO_ADAPTER_VIRTIO, true, false,
0, &error_abort);
- return cbus;
+ return VIRTUAL_CSS_BUS(bus);
}
/***************** Virtual-css Bus Bridge Device ********************/
--
2.41.0
- [PULL 29/46] hw/intc/spapr_xive: Do not use SysBus API to map local MMIO region, (continued)
- [PULL 29/46] hw/intc/spapr_xive: Do not use SysBus API to map local MMIO region, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 30/46] hw/audio/pcspk: Inline pcspk_init(), Philippe Mathieu-Daudé, 2023/10/19
- [PULL 31/46] hw/i386/amd_iommu: Do not use SysBus API to map local MMIO region, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 32/46] hw/i386/intel_iommu: Do not use SysBus API to map local MMIO region, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 33/46] hw/misc/allwinner-dramc: Move sysbus_mmio_map call from init -> realize, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 34/46] hw/misc/allwinner-dramc: Do not use SysBus API to map local MMIO region, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 35/46] hw/pci-host/bonito: Do not use SysBus API to map local MMIO region, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 36/46] hw/acpi: Realize ACPI_GED sysbus device before accessing it, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 37/46] hw/arm/virt: Realize ARM_GICV2M sysbus device before accessing it, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 38/46] hw/isa: Realize ISA bridge device before accessing it, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 39/46] hw/s390x/css-bridge: Realize sysbus device before accessing it,
Philippe Mathieu-Daudé <=
- [PULL 40/46] hw/virtio/virtio-pmem: Replace impossible check by assertion, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 41/46] hw/block/vhost-user-blk: Use DEVICE() / VIRTIO_DEVICE() macros, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 42/46] hw/display/virtio-gpu: Use VIRTIO_DEVICE() macro, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 43/46] hw/scsi/virtio-scsi: Use VIRTIO_SCSI_COMMON() macro, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 44/46] hw/dma: Declare link using static DEFINE_PROP_LINK() macro, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 45/46] hw/net: Declare link using static DEFINE_PROP_LINK() macro, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 46/46] ui/input: Constify QemuInputHandler structure, Philippe Mathieu-Daudé, 2023/10/19
- Re: [PULL 00/46] Misc HW/UI patches for 2023-10-19, Philippe Mathieu-Daudé, 2023/10/20
- Re: [PULL 00/46] Misc HW/UI patches for 2023-10-19, Stefan Hajnoczi, 2023/10/20