lkml.org 
[lkml]   [2015]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] livepatch: add sysfs interface /sys/kernel/livepatch/state
On Wed, 17 Jun 2015, Li Bin wrote:

> The added sysfs interface /sys/kernel/livepatch/state is read-only,
> it shows the patches that have been applied, incluing the stack index
> and the state of each patch.
>
> $ cat /sys/kernel/livepatch/state
> Index Patch State
> -----------------------------------------------
> 1 klp_test1 enabled
> 2 klp_test2 enabled
> 3 klp_test3 enabled
> -----------------------------------------------
>
> $ echo 0 > /sys/kernel/livepatch/klp_test3/enabled
> $ cat /sys/kernel/livepatch/state
> Index Patch State
> -----------------------------------------------
> 1 klp_test1 enabled
> 2 klp_test2 enabled
> 3 klp_test3 disabled
> -----------------------------------------------
>
> Signed-off-by: Li Bin <huawei.libin@huawei.com>
> ---

Hi,

I think we should comply with sysfs policy and keep 'one value per
attribute' as mentioned in the Documentation/filesystems/sysfs.txt:

"
Attributes should be ASCII text files, preferably with only one value
per file. It is noted that it may not be efficient to contain only one
value per file, so it is socially acceptable to express an array of
values of the same type.

Mixing types, expressing multiple lines of data, and doing fancy
formatting of data is heavily frowned upon. Doing these things may get
you publicly humiliated and your code rewritten without notice.
"
The list of applied patches can be obtained just by 'ls
/sys/kernel/livepatch' and their state is in enabled attribute in each
respective patch (no, you cannot obtain the order in the stack).

Thanks,

Miroslav Benes
SUSE Labs


\
 
 \ /
  Last update: 2015-06-17 10:41    [W:0.074 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site