5 The device-mapper uevent code adds the capability to device-mapper to create
6 and send kobject uevents (uevents). Previously device-mapper events were only
7 available through the ioctl interface. The advantage of the uevents interface
8 is the event contains environment attributes providing increased context for
9 the event avoiding the need to query the state of the device-mapper device after
10 the event is received.
12 There are two functions currently for device-mapper events. The first function
13 listed creates the event and the second function sends the event(s)::
15 void dm_path_uevent(enum dm_uevent_type event_type, struct dm_target *ti,
16 const char *path, unsigned nr_valid_paths)
18 void dm_send_uevents(struct list_head *events, struct kobject *kobj)
21 The variables added to the uevent environment are:
23 Variable Name: DM_TARGET
24 ------------------------
25 :Uevent Action(s): KOBJ_CHANGE
28 :Value: Name of device-mapper target that generated the event.
30 Variable Name: DM_ACTION
31 ------------------------
32 :Uevent Action(s): KOBJ_CHANGE
35 :Value: Device-mapper specific action that caused the uevent action.
36 PATH_FAILED - A path has failed;
37 PATH_REINSTATED - A path has been reinstated.
39 Variable Name: DM_SEQNUM
40 ------------------------
41 :Uevent Action(s): KOBJ_CHANGE
42 :Type: unsigned integer
43 :Description: A sequence number for this specific device-mapper device.
44 :Value: Valid unsigned integer range.
46 Variable Name: DM_PATH
47 ----------------------
48 :Uevent Action(s): KOBJ_CHANGE
50 :Description: Major and minor number of the path device pertaining to this
52 :Value: Path name in the form of "Major:Minor"
54 Variable Name: DM_NR_VALID_PATHS
55 --------------------------------
56 :Uevent Action(s): KOBJ_CHANGE
57 :Type: unsigned integer
59 :Value: Valid unsigned integer range.
61 Variable Name: DM_NAME
62 ----------------------
63 :Uevent Action(s): KOBJ_CHANGE
65 :Description: Name of the device-mapper device.
68 Variable Name: DM_UUID
69 ----------------------
70 :Uevent Action(s): KOBJ_CHANGE
72 :Description: UUID of the device-mapper device.
73 :Value: UUID. (Empty string if there isn't one.)
75 An example of the uevents generated as captured by udevmonitor is shown
80 UEVENT[1192521009.711215] change@/block/dm-3
90 DM_UUID=mpath-35333333000002328
97 UEVENT[1192521132.989927] change@/block/dm-3
102 DM_ACTION=PATH_REINSTATED
107 DM_UUID=mpath-35333333000002328