s390x: register I/O adapters per ISC during init
commitdde522bbc5feb2862afb243bb49c590fe65dce66
authorFei Li <sherrylf@linux.vnet.ibm.com>
Thu, 24 Nov 2016 10:10:39 +0000 (24 11:10 +0100)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Fri, 21 Apr 2017 07:32:09 +0000 (21 09:32 +0200)
tree1823392ac35c26189f22d92b262af2a1bd783f0f
parentbc66d6cbca780c5b8c237b9d355caa8274e5b312
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 <sherrylf@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
hw/s390x/css-bridge.c
hw/s390x/css.c
hw/s390x/s390-pci-bus.c
hw/s390x/s390-pci-inst.c
hw/s390x/virtio-ccw.c
include/hw/s390x/css.h