Skip to contentSkip to conversation

sysfs support for xen linux

RFC PATCH Mike D. Day 2 participants 2 messages Jan 10, 2006 – Jan 11, 2006

lore
Share & tools
lore
#0 lore raw
Quoted 1 line · Keir Fraser

xen_sysfs.c looks to contain a lot of code that I would expect to be part of a generic sysfs library. Does every subsystem that uses sysfs really have to implement all that stuff for itself?

No, they don't. Drivers get sysfs attributes by using the driver core (registering a subsystem, defining attributes, etc.).

However, if all you want to do is create and remove files under /sys (without using all the driver core), there is no simple way to do so (at least not that I could find). I am assuming that folks will want something that works like /proc does now.

I wrote xen_sysfs.c to provide simple sysfs interfaces for non-drivers. It seems as though it would be a crime against nature to write a device driver just to create a file under /sys.

Quoted 1 line

(I am not a sysfs expert, by the way :-) .

Neither am I, but perhaps some such person will give feedback. :-)

Mike

Signature · 4 lines
Mike D. Day
STSM and Architect, Open Virtualization
IBM Linux Technology Center
[email protected]
#1 lore raw
Quoted 5 lines · Mike D. Day

No, they don't. Drivers get sysfs attributes by using the driver core (registering a subsystem, defining attributes, etc.).

However, if all you want to do is create and remove files under /sys (without using all the driver core), there is no simple way to do so (at least not that I could find). I am assuming that folks will want something that works like /proc does now.

I wrote xen_sysfs.c to provide simple sysfs interfaces for non-drivers. It seems as though it would be a crime against nature to write a device driver just to create a file under /sys.

Well, here's a question, and I really don't know the answer: It of course makes sense that the kernel maintainers want drivers to install themselves under /sys, and fit in with the whole kobject and hotplug infrastructure. But, for a few odds-and-ends special files that don't really relate to a device, is /proc also out of bounds these days? Seems to me that the kernel proc interfaces were designed to have a few random files thrown at them, in a way that the sysfs interfaces aren't. If the argument is really that random special files are a bad idea, that would continue to hold regardless of whether we move e.g., /proc/xen/privcmd to /sys.

-- Keir