From dde522bbc5feb2862afb243bb49c590fe65dce66 Mon Sep 17 00:00:00 2001 From: Fei Li Date: Thu, 24 Nov 2016 11:10:39 +0100 Subject: s390x: register I/O adapters per ISC during init The I/O adapters should exist as soon as the bus/infrastructure exists, and not only when the guest is actually trying to do something with them. While the lazy allocation was not wrong, allocating at init time is cleaner, both for the architecture and the code. Let's adjust this by having each device type (currently for PCI and virtio-ccw) register the adapters for each ISC (as now we don't know which ISC the guest will use) as soon as it initializes. Use a two-dimensional array io_adapters[type][isc] to store adapters in ChannelSubSys, so that we can conveniently get the adapter id by the helper function css_get_adapter_id(type, isc). Signed-off-by: Fei Li Signed-off-by: Cornelia Huck --- hw/s390x/css-bridge.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hw/s390x/css-bridge.c') diff --git a/hw/s390x/css-bridge.c b/hw/s390x/css-bridge.c index 9a7f7ee60c..b54ac01d37 100644 --- a/hw/s390x/css-bridge.c +++ b/hw/s390x/css-bridge.c @@ -107,6 +107,9 @@ VirtualCssBus *virtual_css_bus_init(void) /* Enable hotplugging */ qbus_set_hotplug_handler(bus, dev, &error_abort); + css_register_io_adapters(CSS_IO_ADAPTER_VIRTIO, true, false, + &error_abort); + return cbus; } -- cgit 1.4.1