brintos

brintos / linux-shallow public Read only

0
0
Text · 2.9 KiB · 4a8ee8d Raw
111 lines · plain
1====================2device-mapper uevent3====================4 5The device-mapper uevent code adds the capability to device-mapper to create6and send kobject uevents (uevents).  Previously device-mapper events were only7available through the ioctl interface.  The advantage of the uevents interface8is the event contains environment attributes providing increased context for9the event avoiding the need to query the state of the device-mapper device after10the event is received.11 12There are two functions currently for device-mapper events.  The first function13listed creates the event and the second function sends the event(s)::14 15  void dm_path_uevent(enum dm_uevent_type event_type, struct dm_target *ti,16                      const char *path, unsigned nr_valid_paths)17 18  void dm_send_uevents(struct list_head *events, struct kobject *kobj)19 20 21The variables added to the uevent environment are:22 23Variable Name: DM_TARGET24------------------------25:Uevent Action(s): KOBJ_CHANGE26:Type: string27:Description:28:Value: Name of device-mapper target that generated the event.29 30Variable Name: DM_ACTION31------------------------32:Uevent Action(s): KOBJ_CHANGE33:Type: string34:Description: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.38 39Variable Name: DM_SEQNUM40------------------------41:Uevent Action(s): KOBJ_CHANGE42:Type: unsigned integer43:Description: A sequence number for this specific device-mapper device.44:Value: Valid unsigned integer range.45 46Variable Name: DM_PATH47----------------------48:Uevent Action(s): KOBJ_CHANGE49:Type: string50:Description: Major and minor number of the path device pertaining to this51	      event.52:Value: Path name in the form of "Major:Minor"53 54Variable Name: DM_NR_VALID_PATHS55--------------------------------56:Uevent Action(s): KOBJ_CHANGE57:Type: unsigned integer58:Description:59:Value: Valid unsigned integer range.60 61Variable Name: DM_NAME62----------------------63:Uevent Action(s): KOBJ_CHANGE64:Type: string65:Description: Name of the device-mapper device.66:Value: Name67 68Variable Name: DM_UUID69----------------------70:Uevent Action(s): KOBJ_CHANGE71:Type: string72:Description: UUID of the device-mapper device.73:Value: UUID. (Empty string if there isn't one.)74 75An example of the uevents generated as captured by udevmonitor is shown76below77 781.) Path failure::79 80	UEVENT[1192521009.711215] change@/block/dm-381	ACTION=change82	DEVPATH=/block/dm-383	SUBSYSTEM=block84	DM_TARGET=multipath85	DM_ACTION=PATH_FAILED86	DM_SEQNUM=187	DM_PATH=8:3288	DM_NR_VALID_PATHS=089	DM_NAME=mpath290	DM_UUID=mpath-3533333300000232891	MINOR=392	MAJOR=25393	SEQNUM=113094 952.) Path reinstate::96 97	UEVENT[1192521132.989927] change@/block/dm-398	ACTION=change99	DEVPATH=/block/dm-3100	SUBSYSTEM=block101	DM_TARGET=multipath102	DM_ACTION=PATH_REINSTATED103	DM_SEQNUM=2104	DM_PATH=8:32105	DM_NR_VALID_PATHS=1106	DM_NAME=mpath2107	DM_UUID=mpath-35333333000002328108	MINOR=3109	MAJOR=253110	SEQNUM=1131111