|
|
b38b0f |
From 11e6368bca72590e49a7705b55ce031f543941d7 Mon Sep 17 00:00:00 2001
|
|
|
b38b0f |
From: Cornelia Huck <cohuck@redhat.com>
|
|
|
b38b0f |
Date: Wed, 17 Apr 2019 13:57:23 +0100
|
|
|
b38b0f |
Subject: [PATCH 06/24] hw/s390x/s390-pci-bus: Convert sysbus init function to
|
|
|
b38b0f |
realize function
|
|
|
b38b0f |
MIME-Version: 1.0
|
|
|
b38b0f |
Content-Type: text/plain; charset=UTF-8
|
|
|
b38b0f |
Content-Transfer-Encoding: 8bit
|
|
|
b38b0f |
|
|
|
b38b0f |
RH-Author: Cornelia Huck <cohuck@redhat.com>
|
|
|
b38b0f |
Message-id: <20190417135741.25297-7-cohuck@redhat.com>
|
|
|
b38b0f |
Patchwork-id: 85787
|
|
|
b38b0f |
O-Subject: [RHEL-8.1.0 qemu-kvm PATCH v2 06/24] hw/s390x/s390-pci-bus: Convert sysbus init function to realize function
|
|
|
b38b0f |
Bugzilla: 1699070
|
|
|
b38b0f |
RH-Acked-by: David Hildenbrand <david@redhat.com>
|
|
|
b38b0f |
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
|
|
b38b0f |
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
|
b38b0f |
RH-Acked-by: Jens Freimann <jfreimann@redhat.com>
|
|
|
b38b0f |
|
|
|
b38b0f |
From: Thomas Huth <thuth@redhat.com>
|
|
|
b38b0f |
|
|
|
b38b0f |
The SysBusDeviceClass->init() interface is considered as a legacy interface
|
|
|
b38b0f |
and there are currently some efforts going on to get rid of it. Thus let's
|
|
|
b38b0f |
convert the init function in the s390x code to realize() instead.
|
|
|
b38b0f |
|
|
|
b38b0f |
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
|
|
b38b0f |
Message-Id: <1538466491-2073-1-git-send-email-thuth@redhat.com>
|
|
|
b38b0f |
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
|
b38b0f |
Reviewed-by: David Hildenbrand <david@redhat.com>
|
|
|
b38b0f |
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
|
|
|
b38b0f |
(cherry picked from commit b576d582ea2b03f4eada186fff59308d22b40a6a)
|
|
|
b38b0f |
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
|
|
|
b38b0f |
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
|
|
|
b38b0f |
---
|
|
|
b38b0f |
hw/s390x/s390-pci-bus.c | 34 +++++++++++++++++++++-------------
|
|
|
b38b0f |
1 file changed, 21 insertions(+), 13 deletions(-)
|
|
|
b38b0f |
|
|
|
b38b0f |
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
|
|
|
b38b0f |
index 10da874..f253774 100644
|
|
|
b38b0f |
--- a/hw/s390x/s390-pci-bus.c
|
|
|
b38b0f |
+++ b/hw/s390x/s390-pci-bus.c
|
|
|
b38b0f |
@@ -692,27 +692,35 @@ static void s390_pci_iommu_free(S390pciState *s, PCIBus *bus, int32_t devfn)
|
|
|
b38b0f |
object_unref(OBJECT(iommu));
|
|
|
b38b0f |
}
|
|
|
b38b0f |
|
|
|
b38b0f |
-static int s390_pcihost_init(SysBusDevice *dev)
|
|
|
b38b0f |
+static void s390_pcihost_realize(DeviceState *dev, Error **errp)
|
|
|
b38b0f |
{
|
|
|
b38b0f |
PCIBus *b;
|
|
|
b38b0f |
BusState *bus;
|
|
|
b38b0f |
PCIHostState *phb = PCI_HOST_BRIDGE(dev);
|
|
|
b38b0f |
S390pciState *s = S390_PCI_HOST_BRIDGE(dev);
|
|
|
b38b0f |
+ Error *local_err = NULL;
|
|
|
b38b0f |
|
|
|
b38b0f |
DPRINTF("host_init\n");
|
|
|
b38b0f |
|
|
|
b38b0f |
- b = pci_register_root_bus(DEVICE(dev), NULL,
|
|
|
b38b0f |
- s390_pci_set_irq, s390_pci_map_irq, NULL,
|
|
|
b38b0f |
- get_system_memory(), get_system_io(), 0, 64,
|
|
|
b38b0f |
- TYPE_PCI_BUS);
|
|
|
b38b0f |
+ b = pci_register_root_bus(dev, NULL, s390_pci_set_irq, s390_pci_map_irq,
|
|
|
b38b0f |
+ NULL, get_system_memory(), get_system_io(), 0,
|
|
|
b38b0f |
+ 64, TYPE_PCI_BUS);
|
|
|
b38b0f |
pci_setup_iommu(b, s390_pci_dma_iommu, s);
|
|
|
b38b0f |
|
|
|
b38b0f |
bus = BUS(b);
|
|
|
b38b0f |
- qbus_set_hotplug_handler(bus, DEVICE(dev), NULL);
|
|
|
b38b0f |
+ qbus_set_hotplug_handler(bus, dev, &local_err);
|
|
|
b38b0f |
+ if (local_err) {
|
|
|
b38b0f |
+ error_propagate(errp, local_err);
|
|
|
b38b0f |
+ return;
|
|
|
b38b0f |
+ }
|
|
|
b38b0f |
phb->bus = b;
|
|
|
b38b0f |
|
|
|
b38b0f |
- s->bus = S390_PCI_BUS(qbus_create(TYPE_S390_PCI_BUS, DEVICE(s), NULL));
|
|
|
b38b0f |
- qbus_set_hotplug_handler(BUS(s->bus), DEVICE(s), NULL);
|
|
|
b38b0f |
+ s->bus = S390_PCI_BUS(qbus_create(TYPE_S390_PCI_BUS, dev, NULL));
|
|
|
b38b0f |
+ qbus_set_hotplug_handler(BUS(s->bus), dev, &local_err);
|
|
|
b38b0f |
+ if (local_err) {
|
|
|
b38b0f |
+ error_propagate(errp, local_err);
|
|
|
b38b0f |
+ return;
|
|
|
b38b0f |
+ }
|
|
|
b38b0f |
|
|
|
b38b0f |
s->iommu_table = g_hash_table_new_full(g_int64_hash, g_int64_equal,
|
|
|
b38b0f |
NULL, g_free);
|
|
|
b38b0f |
@@ -722,9 +730,10 @@ static int s390_pcihost_init(SysBusDevice *dev)
|
|
|
b38b0f |
QTAILQ_INIT(&s->zpci_devs);
|
|
|
b38b0f |
|
|
|
b38b0f |
css_register_io_adapters(CSS_IO_ADAPTER_PCI, true, false,
|
|
|
b38b0f |
- S390_ADAPTER_SUPPRESSIBLE, &error_abort);
|
|
|
b38b0f |
-
|
|
|
b38b0f |
- return 0;
|
|
|
b38b0f |
+ S390_ADAPTER_SUPPRESSIBLE, &local_err);
|
|
|
b38b0f |
+ if (local_err) {
|
|
|
b38b0f |
+ error_propagate(errp, local_err);
|
|
|
b38b0f |
+ }
|
|
|
b38b0f |
}
|
|
|
b38b0f |
|
|
|
b38b0f |
static int s390_pci_msix_init(S390PCIBusDevice *pbdev)
|
|
|
b38b0f |
@@ -1018,12 +1027,11 @@ static void s390_pcihost_reset(DeviceState *dev)
|
|
|
b38b0f |
|
|
|
b38b0f |
static void s390_pcihost_class_init(ObjectClass *klass, void *data)
|
|
|
b38b0f |
{
|
|
|
b38b0f |
- SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
|
|
|
b38b0f |
DeviceClass *dc = DEVICE_CLASS(klass);
|
|
|
b38b0f |
HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(klass);
|
|
|
b38b0f |
|
|
|
b38b0f |
dc->reset = s390_pcihost_reset;
|
|
|
b38b0f |
- k->init = s390_pcihost_init;
|
|
|
b38b0f |
+ dc->realize = s390_pcihost_realize;
|
|
|
b38b0f |
hc->plug = s390_pcihost_hot_plug;
|
|
|
b38b0f |
hc->unplug = s390_pcihost_hot_unplug;
|
|
|
b38b0f |
msi_nonbroken = true;
|
|
|
b38b0f |
--
|
|
|
b38b0f |
1.8.3.1
|
|
|
b38b0f |
|