Hotplug events for block devices?
In looking at the boot process of a 2.5.64 kernel (with DEBUG defined in drivers/base/hotplug.c), I can see hotplug events for each of my ATA disks as they are added to the "ide" bus in sysfs. So far so good.
However, I'd like to be able to receive hotplug events for _all_ block devices, regardless of connection type or anything else. In fact, I'd like to receive hotplug events for all block device _minors_ as well, so when the kernel scans (or receives) partition information that would generate events as well. The event would only have to indicate add/remove, "block", and the DEVPATH to the device node in sysfs.
Currently, the "whole disk" block devices appear in /sys/block, but the partitions don't seem to appear anywhere in sysfs. However, it appears that the "block" directory is a sysfs "subsystem", not a class, so no hotplug events are generated when the block subsystem adds/removes devices.
How should this be accomplished? Should the "block" subsystem really be a sysfs "class"?
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 10 lines · Kevin P. Fleming
In looking at the boot process of a 2.5.64 kernel (with DEBUG defined in
drivers/base/hotplug.c), I can see hotplug events for each of my ATA disks as they are added to the "ide" bus in sysfs. So far so good.However, I'd like to be able to receive hotplug events for _all_ block devices, regardless of connection type or anything else. In fact, I'd like to receive hotplug events for all block device _minors_ as well, so when the kernel scans (or receives) partition information that would generate events as well. The event would only have to indicate add/remove, "block", and the DEVPATH to the device node in sysfs.
Yes, that would be very good, and has been on my list of things to do for quite some time.
Quoted 7 lines
Currently, the "whole disk" block devices appear in
/sys/block, but the partitions don't seem to appear anywhere in sysfs. However, it appears that the "block" directory is a sysfs "subsystem", not a class, so no hotplug events are generated when the block subsystem adds/removes devices.How should this be accomplished? Should the "block" subsystem really be a sysfs "class"?
No, that would get pretty messy :)
What needs to happen is for us to get hotplug events for all kobjects in the system, or possibly all ksets to keep things down to a dull roar. I had a patch around here before the last kobject shakeup, but haven't worked on it since then.
If you want to work on this, I'd appreciate it.
Hm, in looking at the code, it should probably be done for struct subsystem objects, which should catch the existing driver core stuff too...
thanks,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 10 lines
Quoted 7 lines
However, I'd like to be able to receive hotplug events for _all_ block devices, regardless of connection type or anything else. In fact, I'd like to receive hotplug events for all block device _minors_ as well, so when the kernel scans (or receives) partition information that would generate events as well. The event would only have to indicate add/remove, "block", and the DEVPATH to the device node in sysfs.
Yes, that would be very good, and has been on my list of things to do for quite some time.
How do you construct a sensible DEVPATH for iSCSI or nbd ? How do you notify about the loss or gain of an IO path as opposed to a whole device?
Regards
Oliver
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 8 lines · Oliver Neukum
Quoted 8 lines
Quoted 7 lines
However, I'd like to be able to receive hotplug events for _all_ block devices, regardless of connection type or anything else. In fact, I'd like to receive hotplug events for all block device _minors_ as well, so when the kernel scans (or receives) partition information that would generate events as well. The event would only have to indicate add/remove, "block", and the DEVPATH to the device node in sysfs.
Quoted 6 lines
Quoted 2 lines
Yes, that would be very good, and has been on my list of things to do for quite some time.
How do you construct a sensible DEVPATH for iSCSI or nbd ? How do you notify about the loss or gain of an IO path as opposed to a whole device?
When those device types show up in sysfs, those kinds of problems will have already been solved.
In other words, not our problem :)
thanks,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel