dm-uevent.txt 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. The device-mapper uevent code adds the capability to device-mapper to create
  2. and send kobject uevents (uevents). Previously device-mapper events were only
  3. available through the ioctl interface. The advantage of the uevents interface
  4. is the event contains environment attributes providing increased context for
  5. the event avoiding the need to query the state of the device-mapper device after
  6. the event is received.
  7. There are two functions currently for device-mapper events. The first function
  8. listed creates the event and the second function sends the event(s).
  9. void dm_path_uevent(enum dm_uevent_type event_type, struct dm_target *ti,
  10. const char *path, unsigned nr_valid_paths)
  11. void dm_send_uevents(struct list_head *events, struct kobject *kobj)
  12. The variables added to the uevent environment are:
  13. Variable Name: DM_TARGET
  14. Uevent Action(s): KOBJ_CHANGE
  15. Type: string
  16. Description:
  17. Value: Name of device-mapper target that generated the event.
  18. Variable Name: DM_ACTION
  19. Uevent Action(s): KOBJ_CHANGE
  20. Type: string
  21. Description:
  22. Value: Device-mapper specific action that caused the uevent action.
  23. PATH_FAILED - A path has failed.
  24. PATH_REINSTATED - A path has been reinstated.
  25. Variable Name: DM_SEQNUM
  26. Uevent Action(s): KOBJ_CHANGE
  27. Type: unsigned integer
  28. Description: A sequence number for this specific device-mapper device.
  29. Value: Valid unsigned integer range.
  30. Variable Name: DM_PATH
  31. Uevent Action(s): KOBJ_CHANGE
  32. Type: string
  33. Description: Major and minor number of the path device pertaining to this
  34. event.
  35. Value: Path name in the form of "Major:Minor"
  36. Variable Name: DM_NR_VALID_PATHS
  37. Uevent Action(s): KOBJ_CHANGE
  38. Type: unsigned integer
  39. Description:
  40. Value: Valid unsigned integer range.
  41. Variable Name: DM_NAME
  42. Uevent Action(s): KOBJ_CHANGE
  43. Type: string
  44. Description: Name of the device-mapper device.
  45. Value: Name
  46. Variable Name: DM_UUID
  47. Uevent Action(s): KOBJ_CHANGE
  48. Type: string
  49. Description: UUID of the device-mapper device.
  50. Value: UUID. (Empty string if there isn't one.)
  51. An example of the uevents generated as captured by udevmonitor is shown
  52. below.
  53. 1.) Path failure.
  54. UEVENT[1192521009.711215] change@/block/dm-3
  55. ACTION=change
  56. DEVPATH=/block/dm-3
  57. SUBSYSTEM=block
  58. DM_TARGET=multipath
  59. DM_ACTION=PATH_FAILED
  60. DM_SEQNUM=1
  61. DM_PATH=8:32
  62. DM_NR_VALID_PATHS=0
  63. DM_NAME=mpath2
  64. DM_UUID=mpath-35333333000002328
  65. MINOR=3
  66. MAJOR=253
  67. SEQNUM=1130
  68. 2.) Path reinstate.
  69. UEVENT[1192521132.989927] change@/block/dm-3
  70. ACTION=change
  71. DEVPATH=/block/dm-3
  72. SUBSYSTEM=block
  73. DM_TARGET=multipath
  74. DM_ACTION=PATH_REINSTATED
  75. DM_SEQNUM=2
  76. DM_PATH=8:32
  77. DM_NR_VALID_PATHS=1
  78. DM_NAME=mpath2
  79. DM_UUID=mpath-35333333000002328
  80. MINOR=3
  81. MAJOR=253
  82. SEQNUM=1131