Skip to contentSkip to conversation

sysfs support for xen linux

RFC PATCH Mike D. Day 4 participants 4 messages Jan 11, 2006

lore
Share & tools
lore
#0 lore raw
Quoted 1 line · Mark Williamson

My impression is was that sysfs files are mostly meant to be very simple get/set attributes and not have magic properties like the privcmd file - do any other sysfs files even support ioctls().

Yes, true. I think privcmd might be more appropriate for /proc, but would like to see how it works as a binary file under /sys. ioctl's are not supported by sysfs that I can see, so privcmd would have to be a read/write interface.

Regardless of privcmd there are numerous simple attributes related to Xen that are consistent with "zen" of sysfs. :-)

Mike

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

Yes, true. I think privcmd might be more appropriate for /proc, but would like to see how it works as a binary file under /sys. ioctl's are not supported by sysfs that I can see, so privcmd would have to be a read/write interface.

Regardless of privcmd there are numerous simple attributes related to Xen that are consistent with "zen" of sysfs. :-)

Agreed. It's an ideal place for many of the things that are in proc, and many things we'd want to add in the future.

You could possibly abuse sysfs into supporting ioctl but I'm pretty sure the kernel people would find that quite distressing ;-) I had the impression binary files under sysfs were also a no-no (all meant to be cat-able - addressing one of the other problems of /proc), but I could be mistaken.

Cheers,
Mark

Quoted 1 line

Just a question. What use is a unicyle with no seat? And no pedals!

Me: To answer a question with a question: What use is a skateboard?

Quoted 1 line

Skateboards have wheels.

Me: My wheel has a wheel!

#2 lore raw
Quoted 5 lines · Mark Williamson
Quoted 5 lines

Yes, true. I think privcmd might be more appropriate for /proc, but would like to see how it works as a binary file under /sys. ioctl's are not supported by sysfs that I can see, so privcmd would have to be a read/write interface.

Quoted 10 lines
Quoted 4 lines

Regardless of privcmd there are numerous simple attributes related to Xen that are consistent with "zen" of sysfs. :-)

Agreed. It's an ideal place for many of the things that are in proc, and many things we'd want to add in the future.

You could possibly abuse sysfs into supporting ioctl but I'm pretty sure the kernel people would find that quite distressing ;-) I had the impression binary files under sysfs were also a no-no (all meant to be cat-able - addressing one of the other problems of /proc), but I could be mistaken.

There was a discussion a while back about this.

http://permalink.gmane.org/gmane.comp.emulators.xen.devel/14273

I think the consensus was to move any ioctl interface to a char device and everything else to sysfs.

You'll probably want a proper kobject hierarchy too which means working with GKH et al to figure out where out stuff should be (/sys/hypervisor/xen??)

Regards,

Anthony Liguori

Quoted 5 lines

Cheers,
Mark

#3 lore raw
Quoted 23 lines · Anthony Liguori
Quoted 10 lines · Mark Williamson
Quoted 9 lines

Yes, true. I think privcmd might be more appropriate for /proc, but would like to see how it works as a binary file under /sys. ioctl's are not supported by sysfs that I can see, so privcmd would have to be a read/write interface.

Regardless of privcmd there are numerous simple attributes related to Xen that are consistent with "zen" of sysfs. :-)

Quoted 9 lines

Agreed. It's an ideal place for many of the things that are in proc, and many things we'd want to add in the future.

You could possibly abuse sysfs into supporting ioctl but I'm pretty sure the kernel people would find that quite distressing ;-) I had the impression binary files under sysfs were also a no-no (all meant to be cat-able - addressing one of the other problems of /proc), but I could be mistaken.

There was a discussion a while back about this.

Quoted 8 lines

http://permalink.gmane.org/gmane.comp.emulators.xen.devel/14273

I think the consensus was to move any ioctl interface to a char device and everything else to sysfs.

You'll probably want a proper kobject hierarchy too which means working with GKH et al to figure out where out stuff should be (/sys/hypervisor/xen??)

I think it would be a good idea if you included lkml in on your discussions. Why not get their opinions early rather than late?

Thanks,
Dan