Details
- Reviewers
mav bcr - Group Reviewers
Doc Committers
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Aren't the existing events enough:
!system=DEVFS subsystem=CDEV type=CREATE cdev=md0
!system=DEVFS subsystem=CDEV type=MEDIACHANGE cdev=md0
!system=DEVFS subsystem=CDEV type=DESTROY cdev=md0
I won't object too hard, but for me it still looks redundant. But if you go that way, MEDIACHANGE event should be either duplicated too or changed to a new style.
Hm, changing it would probably break someone's config, but duplicating could make sense. Especially given that it's not yet documented, so I'll just document the GEOM variant, not DEVFS, as it makes more sense this way.
One question, though: in which cases does it work? Card readers? Optical drives?
Any correctly implemented removable medium SCSI devices: optical drives, card readers, floppies, ...
Docs part looks good to me
sys/geom/geom_dev.c | ||
---|---|---|
332 | Not sure that is matters, I can't think of any devices with names nearly this long, but buf here (g_dev_taste) is buf[64], whereas above in g_dev_destroy, it is buf[63 + 6] |
Forget about it for now. It can be easily done in a different way, simply running on any device creation and checking whether it's disk-like or not by calling diskinfo(1) and checking return status, and it's not an optimal solution (optimal would be to signal only devices with zero access counts, but that would cause infinite loop between devd callback and geom notification).
Reclaim. It cannot be done in a different way - diskinfo trick is ok, but only for device creation; won't help on destruction - and with this patch we also get notifications (mediachange, to be exact) after eg "newfs /dev/md0", which is exactly what we want.
So remind me why we can't use DEVfs again?
sbin/devd/devd.conf.5 | ||
---|---|---|
44 | Might want to use February 1, 2015 here. | |
381 | Why can't you query the device from DEVFS and see if it is a geom or not? | |
sys/geom/geom_dev.c | ||
180 | You send this event before you destroy the device. You should send it after the device is gone. | |
188 | Here. | |
215 | Again, seems redundantly repetitive. Does DEVFS ever send a media change event on a non GEOM? | |
333 | Assuming this is needed at all, this at least is in the right place. |
Because I need notification about GEOM nodes - _all_ nodes, including partitions or whatever.eli, and _only_ GEOM nodes, ie nothing non-disk-like. I also need notification about those nodes disappearing - I could check whether something is disk-like device on node creation, but not after its destruction.