]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
s390x/css: introduce read-only property type for device ids
authorDong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Tue, 14 Feb 2017 03:04:02 +0000 (04:04 +0100)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Fri, 21 Apr 2017 07:32:09 +0000 (09:32 +0200)
Let's introduce a read-only property type that handles device ids of the
CssDevId type used for channel devices for future use. e.g. exposing the
busid of an I/O subchannel that is assigned to a ccw device.

Signed-off-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
hw/s390x/css.c
include/hw/s390x/css.h

index 37caa98195b4470a9517923ef1c8e1bce7cbe52d..f966ce2d15580fb28e6a9da1df407816cc7489e0 100644 (file)
@@ -1894,6 +1894,13 @@ PropertyInfo css_devid_propinfo = {
     .set = set_css_devid,
 };
 
+PropertyInfo css_devid_ro_propinfo = {
+    .name = "str",
+    .description = "Read-only identifier of an I/O device in the channel "
+                   "subsystem, example: fe.1.23ab",
+    .get = get_css_devid,
+};
+
 SubchDev *css_create_virtual_sch(CssDevId bus_id, Error **errp)
 {
     uint16_t schid = 0;
index c96c8620578a98fa1d0ac8a5ff65292b34c5c7a4..e88f24b8680c12facfdcb86244af7966f92dccd1 100644 (file)
@@ -172,6 +172,11 @@ extern PropertyInfo css_devid_propinfo;
 #define DEFINE_PROP_CSS_DEV_ID(_n, _s, _f) \
     DEFINE_PROP(_n, _s, _f, css_devid_propinfo, CssDevId)
 
+extern PropertyInfo css_devid_ro_propinfo;
+
+#define DEFINE_PROP_CSS_DEV_ID_RO(_n, _s, _f) \
+    DEFINE_PROP(_n, _s, _f, css_devid_ro_propinfo, CssDevId)
+
 /**
  * Create a subchannel for the given bus id.
  *