s390x/css: introduce property type for device ids
commit06e686eaab344b1d38125e49abeb31a416428201
authorCornelia Huck <cornelia.huck@de.ibm.com>
Fri, 1 Apr 2016 11:42:04 +0000 (1 13:42 +0200)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Tue, 14 Jun 2016 11:34:50 +0000 (14 13:34 +0200)
tree1e90fe3dfbe9956b46698b8dc4ae56984454785f
parentc1755b14fade16f02d3e10a487a03741a2f317ce
s390x/css: introduce property type for device ids

Let's introduce a CssDevId to handle device ids of the xx.x.xxxx
type used for channel devices. This has some benefits:

- We can use them in virtio-ccw and split the validity checks for
  a channel device id in general from the constraint checking
  within the virtio-ccw scope.
- We can reuse the device id type for future non-virtio channel
  devices.

While we're at it, improve the validity checks and disallow e.g.
trailing characters.

Suggested-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Acked-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
hw/s390x/css.c
hw/s390x/virtio-ccw.c
hw/s390x/virtio-ccw.h
include/hw/s390x/css.h