s390x/sclp: properly guard pci-specific functions
commit80b7a265362c870f95fb5ca1f7e7a02c0fa0db3e
authorCornelia Huck <cohuck@redhat.com>
Thu, 6 Jul 2017 15:13:14 +0000 (6 17:13 +0200)
committerCornelia Huck <cohuck@redhat.com>
Wed, 30 Aug 2017 16:23:25 +0000 (30 18:23 +0200)
tree854932d6cc1e81fea496caae0224d09935cac791
parentd32bd032d8fde41281aae34c16a4aa97e9acfeac
s390x/sclp: properly guard pci-specific functions

If we do not provide zpci, pci reconfiguration via sclp is not available
either. I/O adapter configuration, however, should always be present.

Rename the values that refer to I/O adapter configuration (instead of only
pci) to make things clearer.

Move length checking of the sccb for I/O adapter configuration into the
common sclp code (out of the pci code). This also fixes an issue that
the pci code would refer to a field in the sccb before checking whether
it was actually long enough.

Check for the adapter type in the sccb and return unrecognized adapter
type if the guest tries to issue I/O adapter configure/deconfigure for
a type other than pci or for pci if the zpci facility is not provided.

Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
hw/s390x/s390-pci-bus.c
hw/s390x/s390-pci-bus.h
hw/s390x/sclp.c
include/hw/s390x/sclp.h