s390x/pci: introduce S390PCIBusDevice qdev
commit3e5cfba3ca0a3b1010faa171518b0bf69effb2d9
authorYi Min Zhao <zyimin@linux.vnet.ibm.com>
Wed, 11 May 2016 07:10:06 +0000 (11 15:10 +0800)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Mon, 11 Jul 2016 07:48:05 +0000 (11 09:48 +0200)
tree41d4659325bbfc25cf20f65e7feb84af456add37
parent67d5cd9722b230027d3d4267ae6069c5d8a65463
s390x/pci: introduce S390PCIBusDevice qdev

To support definitions of s390 pci attributes in Qemu cmdline, we have
to make current S390PCIBusDevice struct inherit DeviceState and add
three properties for it. Currently we only support definitions of uid
and fid.

'uid' is optionally defined by users, identifies a zpci device and
must be defined with a 16-bit and non-zero unique value.

'fid' ranges from 0x0 to 0xFFFFFFFF. For fid property, we introduce a
new PropertyInfo by the name of s390_pci_fid_propinfo with our special
setter and getter. As 'fid' is optional, introduce 'fid_defined' to
track whether the user specified a fid.

'target' field is to direct qemu to find the corresponding generic PCI
device. It is equal to the 'id' value of one of generic pci devices.
If the user doesn't specify 'id' parameter for a generic pci device,
its 'id' value will be generated automatically and use this value as
'target' to create an associated zpci device.

If the user did not specify 'uid' or 'fid', values are generated
automatically. 'target' is required.

In addition, if a pci device has no associated zpci device, the code
will generate a zpci device automatically for it.

Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
hw/s390x/s390-pci-bus.c
hw/s390x/s390-pci-bus.h