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
8 There are two functions currently for device-mapper events. The first function
9 listed creates the event and the second function sends the event(s).
11 void dm_path_uevent(enum dm_uevent_type event_type, struct dm_target *ti,
12 const char *path, unsigned nr_valid_paths)
14 void dm_send_uevents(struct list_head *events, struct kobject *kobj)
17 The variables added to the uevent environment are:
19 Variable Name: DM_TARGET
20 Uevent Action(s): KOBJ_CHANGE
23 Value: Name of device-mapper target that generated the event.
25 Variable Name: DM_ACTION
26 Uevent Action(s): KOBJ_CHANGE
29 Value: Device-mapper specific action that caused the uevent action.
30 PATH_FAILED - A path has failed.
31 PATH_REINSTATED - A path has been reinstated.
33 Variable Name: DM_SEQNUM
34 Uevent Action(s): KOBJ_CHANGE
35 Type: unsigned integer
36 Description: A sequence number for this specific device-mapper device.
37 Value: Valid unsigned integer range.
39 Variable Name: DM_PATH
40 Uevent Action(s): KOBJ_CHANGE
42 Description: Major and minor number of the path device pertaining to this
44 Value: Path name in the form of "Major:Minor"
46 Variable Name: DM_NR_VALID_PATHS
47 Uevent Action(s): KOBJ_CHANGE
48 Type: unsigned integer
50 Value: Valid unsigned integer range.
52 Variable Name: DM_NAME
53 Uevent Action(s): KOBJ_CHANGE
55 Description: Name of the device-mapper device.
58 Variable Name: DM_UUID
59 Uevent Action(s): KOBJ_CHANGE
61 Description: UUID of the device-mapper device.
62 Value: UUID. (Empty string if there isn't one.)
64 An example of the uevents generated as captured by udevmonitor is shown
68 UEVENT[1192521009.711215] change@/block/dm-3
78 DM_UUID=mpath-35333333000002328
84 UEVENT[1192521132.989927] change@/block/dm-3
89 DM_ACTION=PATH_REINSTATED
94 DM_UUID=mpath-35333333000002328