* [PATCH V2] xen: export device state to sysfs
@ 2018-08-28 14:56 Joe Jin
2018-08-28 16:53 ` Boris Ostrovsky
2018-08-28 16:53 ` Boris Ostrovsky
0 siblings, 2 replies; 8+ messages in thread
From: Joe Jin @ 2018-08-28 14:56 UTC (permalink / raw)
To: Boris Ostrovsky, Juergen Gross, Konrad Rzeszutek Wilk
Cc: linux-kernel, xen-devel, Joe Jin
Export device state to sysfs to allow for easier get device state.
Signed-off-by: Joe Jin <joe.jin@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
Documentation/ABI/stable/sysfs-bus-xen-backend | 9 +++++++++
drivers/xen/xenbus/xenbus_probe.c | 9 +++++++++
2 files changed, 18 insertions(+)
diff --git a/Documentation/ABI/stable/sysfs-bus-xen-backend b/Documentation/ABI/stable/sysfs-bus-xen-backend
index 3d5951c8bf5f..e8b60bd766f7 100644
--- a/Documentation/ABI/stable/sysfs-bus-xen-backend
+++ b/Documentation/ABI/stable/sysfs-bus-xen-backend
@@ -73,3 +73,12 @@ KernelVersion: 3.0
Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Description:
Number of sectors written by the frontend.
+
+What: /sys/bus/xen-backend/devices/*/state
+Date: August 2018
+KernelVersion: 4.19
+Contact: Joe Jin <joe.jin@oracle.com>
+Description:
+ The state of the device. One of: 'Unknown',
+ 'Initialising', 'Initialised', 'Connected', 'Closing',
+ 'Closed', 'Reconfiguring', 'Reconfigured'.
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index f2088838f690..5b471889d723 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -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,
};
--
2.15.2 (Apple Git-101.1)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH V2] xen: export device state to sysfs
2018-08-28 14:56 [PATCH V2] xen: export device state to sysfs Joe Jin
@ 2018-08-28 16:53 ` Boris Ostrovsky
2018-08-28 17:14 ` Joe Jin
2018-08-28 17:14 ` Joe Jin
2018-08-28 16:53 ` Boris Ostrovsky
1 sibling, 2 replies; 8+ messages in thread
From: Boris Ostrovsky @ 2018-08-28 16:53 UTC (permalink / raw)
To: Joe Jin, Juergen Gross, Konrad Rzeszutek Wilk; +Cc: linux-kernel, xen-devel
On 08/28/2018 10:56 AM, Joe Jin wrote:
> Export device state to sysfs to allow for easier get device state.
>
> Signed-off-by: Joe Jin <joe.jin@oracle.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
> Documentation/ABI/stable/sysfs-bus-xen-backend | 9 +++++++++
> drivers/xen/xenbus/xenbus_probe.c | 9 +++++++++
> 2 files changed, 18 insertions(+)
>
> diff --git a/Documentation/ABI/stable/sysfs-bus-xen-backend b/Documentation/ABI/stable/sysfs-bus-xen-backend
> index 3d5951c8bf5f..e8b60bd766f7 100644
> --- a/Documentation/ABI/stable/sysfs-bus-xen-backend
Won't this show up in the frontend as well?
-boris
> +++ b/Documentation/ABI/stable/sysfs-bus-xen-backend
> @@ -73,3 +73,12 @@ KernelVersion: 3.0
> Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Description:
> Number of sectors written by the frontend.
> +
> +What: /sys/bus/xen-backend/devices/*/state
> +Date: August 2018
> +KernelVersion: 4.19
> +Contact: Joe Jin <joe.jin@oracle.com>
> +Description:
> + The state of the device. One of: 'Unknown',
> + 'Initialising', 'Initialised', 'Connected', 'Closing',
> + 'Closed', 'Reconfiguring', 'Reconfigured'.
> diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
> index f2088838f690..5b471889d723 100644
> --- a/drivers/xen/xenbus/xenbus_probe.c
> +++ b/drivers/xen/xenbus/xenbus_probe.c
> @@ -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,
> };
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH V2] xen: export device state to sysfs
2018-08-28 14:56 [PATCH V2] xen: export device state to sysfs Joe Jin
2018-08-28 16:53 ` Boris Ostrovsky
@ 2018-08-28 16:53 ` Boris Ostrovsky
1 sibling, 0 replies; 8+ messages in thread
From: Boris Ostrovsky @ 2018-08-28 16:53 UTC (permalink / raw)
To: Joe Jin, Juergen Gross, Konrad Rzeszutek Wilk; +Cc: xen-devel, linux-kernel
On 08/28/2018 10:56 AM, Joe Jin wrote:
> Export device state to sysfs to allow for easier get device state.
>
> Signed-off-by: Joe Jin <joe.jin@oracle.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
> Documentation/ABI/stable/sysfs-bus-xen-backend | 9 +++++++++
> drivers/xen/xenbus/xenbus_probe.c | 9 +++++++++
> 2 files changed, 18 insertions(+)
>
> diff --git a/Documentation/ABI/stable/sysfs-bus-xen-backend b/Documentation/ABI/stable/sysfs-bus-xen-backend
> index 3d5951c8bf5f..e8b60bd766f7 100644
> --- a/Documentation/ABI/stable/sysfs-bus-xen-backend
Won't this show up in the frontend as well?
-boris
> +++ b/Documentation/ABI/stable/sysfs-bus-xen-backend
> @@ -73,3 +73,12 @@ KernelVersion: 3.0
> Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Description:
> Number of sectors written by the frontend.
> +
> +What: /sys/bus/xen-backend/devices/*/state
> +Date: August 2018
> +KernelVersion: 4.19
> +Contact: Joe Jin <joe.jin@oracle.com>
> +Description:
> + The state of the device. One of: 'Unknown',
> + 'Initialising', 'Initialised', 'Connected', 'Closing',
> + 'Closed', 'Reconfiguring', 'Reconfigured'.
> diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
> index f2088838f690..5b471889d723 100644
> --- a/drivers/xen/xenbus/xenbus_probe.c
> +++ b/drivers/xen/xenbus/xenbus_probe.c
> @@ -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,
> };
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH V2] xen: export device state to sysfs
2018-08-28 16:53 ` Boris Ostrovsky
@ 2018-08-28 17:14 ` Joe Jin
2018-08-28 22:26 ` Boris Ostrovsky
2018-08-28 22:26 ` Boris Ostrovsky
2018-08-28 17:14 ` Joe Jin
1 sibling, 2 replies; 8+ messages in thread
From: Joe Jin @ 2018-08-28 17:14 UTC (permalink / raw)
To: Boris Ostrovsky, Juergen Gross, Konrad Rzeszutek Wilk
Cc: linux-kernel, xen-devel
On 8/28/18 9:53 AM, Boris Ostrovsky wrote:
> On 08/28/2018 10:56 AM, Joe Jin wrote:
>> Export device state to sysfs to allow for easier get device state.
>>
>> Signed-off-by: Joe Jin <joe.jin@oracle.com>
>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Cc: Juergen Gross <jgross@suse.com>
>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> ---
>> Documentation/ABI/stable/sysfs-bus-xen-backend | 9 +++++++++
>> drivers/xen/xenbus/xenbus_probe.c | 9 +++++++++
>> 2 files changed, 18 insertions(+)
>>
>> diff --git a/Documentation/ABI/stable/sysfs-bus-xen-backend b/Documentation/ABI/stable/sysfs-bus-xen-backend
>> index 3d5951c8bf5f..e8b60bd766f7 100644
>> --- a/Documentation/ABI/stable/sysfs-bus-xen-backend
>
>
> Won't this show up in the frontend as well?
Yes it will, current there is no any ABI document for xen-frontend.
Thanks,
Joe
>
> -boris
>
>> +++ b/Documentation/ABI/stable/sysfs-bus-xen-backend
>> @@ -73,3 +73,12 @@ KernelVersion: 3.0
>> Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> Description:
>> Number of sectors written by the frontend.
>> +
>> +What: /sys/bus/xen-backend/devices/*/state
>> +Date: August 2018
>> +KernelVersion: 4.19
>> +Contact: Joe Jin <joe.jin@oracle.com>
>> +Description:
>> + The state of the device. One of: 'Unknown',
>> + 'Initialising', 'Initialised', 'Connected', 'Closing',
>> + 'Closed', 'Reconfiguring', 'Reconfigured'.
>> diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
>> index f2088838f690..5b471889d723 100644
>> --- a/drivers/xen/xenbus/xenbus_probe.c
>> +++ b/drivers/xen/xenbus/xenbus_probe.c
>> @@ -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,
>> };
>>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH V2] xen: export device state to sysfs
2018-08-28 16:53 ` Boris Ostrovsky
2018-08-28 17:14 ` Joe Jin
@ 2018-08-28 17:14 ` Joe Jin
1 sibling, 0 replies; 8+ messages in thread
From: Joe Jin @ 2018-08-28 17:14 UTC (permalink / raw)
To: Boris Ostrovsky, Juergen Gross, Konrad Rzeszutek Wilk
Cc: xen-devel, linux-kernel
On 8/28/18 9:53 AM, Boris Ostrovsky wrote:
> On 08/28/2018 10:56 AM, Joe Jin wrote:
>> Export device state to sysfs to allow for easier get device state.
>>
>> Signed-off-by: Joe Jin <joe.jin@oracle.com>
>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Cc: Juergen Gross <jgross@suse.com>
>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> ---
>> Documentation/ABI/stable/sysfs-bus-xen-backend | 9 +++++++++
>> drivers/xen/xenbus/xenbus_probe.c | 9 +++++++++
>> 2 files changed, 18 insertions(+)
>>
>> diff --git a/Documentation/ABI/stable/sysfs-bus-xen-backend b/Documentation/ABI/stable/sysfs-bus-xen-backend
>> index 3d5951c8bf5f..e8b60bd766f7 100644
>> --- a/Documentation/ABI/stable/sysfs-bus-xen-backend
>
>
> Won't this show up in the frontend as well?
Yes it will, current there is no any ABI document for xen-frontend.
Thanks,
Joe
>
> -boris
>
>> +++ b/Documentation/ABI/stable/sysfs-bus-xen-backend
>> @@ -73,3 +73,12 @@ KernelVersion: 3.0
>> Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> Description:
>> Number of sectors written by the frontend.
>> +
>> +What: /sys/bus/xen-backend/devices/*/state
>> +Date: August 2018
>> +KernelVersion: 4.19
>> +Contact: Joe Jin <joe.jin@oracle.com>
>> +Description:
>> + The state of the device. One of: 'Unknown',
>> + 'Initialising', 'Initialised', 'Connected', 'Closing',
>> + 'Closed', 'Reconfiguring', 'Reconfigured'.
>> diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
>> index f2088838f690..5b471889d723 100644
>> --- a/drivers/xen/xenbus/xenbus_probe.c
>> +++ b/drivers/xen/xenbus/xenbus_probe.c
>> @@ -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,
>> };
>>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH V2] xen: export device state to sysfs
2018-08-28 17:14 ` Joe Jin
2018-08-28 22:26 ` Boris Ostrovsky
@ 2018-08-28 22:26 ` Boris Ostrovsky
1 sibling, 0 replies; 8+ messages in thread
From: Boris Ostrovsky @ 2018-08-28 22:26 UTC (permalink / raw)
To: Joe Jin, Juergen Gross, Konrad Rzeszutek Wilk; +Cc: linux-kernel, xen-devel
On 08/28/2018 01:14 PM, Joe Jin wrote:
> On 8/28/18 9:53 AM, Boris Ostrovsky wrote:
>> On 08/28/2018 10:56 AM, Joe Jin wrote:
>>> Export device state to sysfs to allow for easier get device state.
>>>
>>> Signed-off-by: Joe Jin <joe.jin@oracle.com>
>>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>>> Cc: Juergen Gross <jgross@suse.com>
>>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>> ---
>>> Documentation/ABI/stable/sysfs-bus-xen-backend | 9 +++++++++
>>> drivers/xen/xenbus/xenbus_probe.c | 9 +++++++++
>>> 2 files changed, 18 insertions(+)
>>>
>>> diff --git a/Documentation/ABI/stable/sysfs-bus-xen-backend b/Documentation/ABI/stable/sysfs-bus-xen-backend
>>> index 3d5951c8bf5f..e8b60bd766f7 100644
>>> --- a/Documentation/ABI/stable/sysfs-bus-xen-backend
>>
>> Won't this show up in the frontend as well?
> Yes it will, current there is no any ABI document for xen-frontend.
>
True.
Applied to for-linus-19b.
-boris
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH V2] xen: export device state to sysfs
2018-08-28 17:14 ` Joe Jin
@ 2018-08-28 22:26 ` Boris Ostrovsky
2018-08-28 22:26 ` Boris Ostrovsky
1 sibling, 0 replies; 8+ messages in thread
From: Boris Ostrovsky @ 2018-08-28 22:26 UTC (permalink / raw)
To: Joe Jin, Juergen Gross, Konrad Rzeszutek Wilk; +Cc: xen-devel, linux-kernel
On 08/28/2018 01:14 PM, Joe Jin wrote:
> On 8/28/18 9:53 AM, Boris Ostrovsky wrote:
>> On 08/28/2018 10:56 AM, Joe Jin wrote:
>>> Export device state to sysfs to allow for easier get device state.
>>>
>>> Signed-off-by: Joe Jin <joe.jin@oracle.com>
>>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>>> Cc: Juergen Gross <jgross@suse.com>
>>> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>> ---
>>> Documentation/ABI/stable/sysfs-bus-xen-backend | 9 +++++++++
>>> drivers/xen/xenbus/xenbus_probe.c | 9 +++++++++
>>> 2 files changed, 18 insertions(+)
>>>
>>> diff --git a/Documentation/ABI/stable/sysfs-bus-xen-backend b/Documentation/ABI/stable/sysfs-bus-xen-backend
>>> index 3d5951c8bf5f..e8b60bd766f7 100644
>>> --- a/Documentation/ABI/stable/sysfs-bus-xen-backend
>>
>> Won't this show up in the frontend as well?
> Yes it will, current there is no any ABI document for xen-frontend.
>
True.
Applied to for-linus-19b.
-boris
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH V2] xen: export device state to sysfs
@ 2018-08-28 14:56 Joe Jin
0 siblings, 0 replies; 8+ messages in thread
From: Joe Jin @ 2018-08-28 14:56 UTC (permalink / raw)
To: Boris Ostrovsky, Juergen Gross, Konrad Rzeszutek Wilk
Cc: xen-devel, Joe Jin, linux-kernel
Export device state to sysfs to allow for easier get device state.
Signed-off-by: Joe Jin <joe.jin@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
Documentation/ABI/stable/sysfs-bus-xen-backend | 9 +++++++++
drivers/xen/xenbus/xenbus_probe.c | 9 +++++++++
2 files changed, 18 insertions(+)
diff --git a/Documentation/ABI/stable/sysfs-bus-xen-backend b/Documentation/ABI/stable/sysfs-bus-xen-backend
index 3d5951c8bf5f..e8b60bd766f7 100644
--- a/Documentation/ABI/stable/sysfs-bus-xen-backend
+++ b/Documentation/ABI/stable/sysfs-bus-xen-backend
@@ -73,3 +73,12 @@ KernelVersion: 3.0
Contact: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Description:
Number of sectors written by the frontend.
+
+What: /sys/bus/xen-backend/devices/*/state
+Date: August 2018
+KernelVersion: 4.19
+Contact: Joe Jin <joe.jin@oracle.com>
+Description:
+ The state of the device. One of: 'Unknown',
+ 'Initialising', 'Initialised', 'Connected', 'Closing',
+ 'Closed', 'Reconfiguring', 'Reconfigured'.
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index f2088838f690..5b471889d723 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -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,
};
--
2.15.2 (Apple Git-101.1)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-08-28 22:25 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-28 14:56 [PATCH V2] xen: export device state to sysfs Joe Jin
2018-08-28 16:53 ` Boris Ostrovsky
2018-08-28 17:14 ` Joe Jin
2018-08-28 22:26 ` Boris Ostrovsky
2018-08-28 22:26 ` Boris Ostrovsky
2018-08-28 17:14 ` Joe Jin
2018-08-28 16:53 ` Boris Ostrovsky
2018-08-28 14:56 Joe Jin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.