xen: export device state to sysfs
PATCH 1/1 xen: export device state to sysfs
Export device state to sysfs to allow for easier get device state.
Boris Ostrovsky <[email protected]>
Juergen Gross <[email protected]>
--- drivers/xen/xenbus/xenbus_probe.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/xen/xenbus/xenbus_probe.c +9 -0
@@ -402,10 +402,19 @@ static ssize_t modalias_show(struct device *dev, }static DEVICE_ATTR_RO (modalias); +static ssize_t state_show (struct device *dev, +struct device_attribute *attr,char *buf) +{ +return sprintf (buf,"%s\n" , +xenbus_strstate (to_xenbus_device (dev)->state)); +} +static DEVICE_ATTR_RO (state); +static struct attribute *xenbus_dev_attrs[] = { &dev_attr_nodename.attr, &dev_attr_devtype.attr, &dev_attr_modalias.attr, + &dev_attr_state.attr,NULL , };
Signature · 1 line
2.15.2 (Apple Git-101.1)
Juergen Gross
maintainerQuoted 5 lines · Joe Jin
Export device state to sysfs to allow for easier get device state.
Signed-off-by Joe Jin <[email protected]>Boris Ostrovsky <[email protected]>
Juergen Gross <[email protected]>
Please add the related documentation to
Documentation/ABI/stable/sysfs-bus-xen-backend
Juergen
Quoted 19 lines
--- drivers/xen/xenbus/xenbus_probe.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/xen/xenbus/xenbus_probe.c +6
-0@@ -402,10 +402,19 @@ static ssize_t modalias_show(struct device *dev, }static DEVICE_ATTR_RO (modalias); +static ssize_t state_show (struct device *dev, +struct device_attribute *attr,char *buf) +{ +return sprintf (buf,"%s\n" , +xenbus_strstate (to_xenbus_device (dev)->state)); +}
drivers/xen/xenbus/xenbus_probe.c static ssize_t modalias_show(struct device *dev, · line 420
Quoted 10 lines
drivers/xen/xenbus/xenbus_probe.c +3
-0+static DEVICE_ATTR_RO (state); +static struct attribute *xenbus_dev_attrs[] = { &dev_attr_nodename.attr, &dev_attr_devtype.attr, &dev_attr_modalias.attr, + &dev_attr_state.attr,NULL , };
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Juergen Gross
maintainerQuoted 5 lines · Joe Jin
Export device state to sysfs to allow for easier get device state.
Signed-off-by Joe Jin <[email protected]>Boris Ostrovsky <[email protected]>
Juergen Gross <[email protected]>
Please add the related documentation to
Documentation/ABI/stable/sysfs-bus-xen-backend
Juergen
Quoted 29 lines
--- drivers/xen/xenbus/xenbus_probe.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/xen/xenbus/xenbus_probe.c +9
-0@@ -402,10 +402,19 @@ static ssize_t modalias_show(struct device *dev, }static DEVICE_ATTR_RO (modalias); +static ssize_t state_show (struct device *dev, +struct device_attribute *attr,char *buf) +{ +return sprintf (buf,"%s\n" , +xenbus_strstate (to_xenbus_device (dev)->state)); +} +static DEVICE_ATTR_RO (state); +static struct attribute *xenbus_dev_attrs[] = { &dev_attr_nodename.attr, &dev_attr_devtype.attr, &dev_attr_modalias.attr, + &dev_attr_state.attr,NULL , };