📄 dm-uevent.txt
字号:
The device-mapper uevent code adds the capability to device-mapper to createand send kobject uevents (uevents). Previously device-mapper events were onlyavailable through the ioctl interface. The advantage of the uevents interfaceis the event contains environment attributes providing increased context forthe event avoiding the need to query the state of the device-mapper device afterthe event is received.There are two functions currently for device-mapper events. The first functionlisted creates the event and the second function sends the event(s).void dm_path_uevent(enum dm_uevent_type event_type, struct dm_target *ti, const char *path, unsigned nr_valid_paths)void dm_send_uevents(struct list_head *events, struct kobject *kobj)The variables added to the uevent environment are:Variable Name: DM_TARGETUevent Action(s): KOBJ_CHANGEType: stringDescription:Value: Name of device-mapper target that generated the event.Variable Name: DM_ACTIONUevent Action(s): KOBJ_CHANGEType: stringDescription:Value: Device-mapper specific action that caused the uevent action. PATH_FAILED - A path has failed. PATH_REINSTATED - A path has been reinstated.Variable Name: DM_SEQNUMUevent Action(s): KOBJ_CHANGEType: unsigned integerDescription: A sequence number for this specific device-mapper device.Value: Valid unsigned integer range.Variable Name: DM_PATHUevent Action(s): KOBJ_CHANGEType: stringDescription: Major and minor number of the path device pertaining to thisevent.Value: Path name in the form of "Major:Minor"Variable Name: DM_NR_VALID_PATHSUevent Action(s): KOBJ_CHANGEType: unsigned integerDescription:Value: Valid unsigned integer range.Variable Name: DM_NAMEUevent Action(s): KOBJ_CHANGEType: stringDescription: Name of the device-mapper device.Value: NameVariable Name: DM_UUIDUevent Action(s): KOBJ_CHANGEType: stringDescription: UUID of the device-mapper device.Value: UUID. (Empty string if there isn't one.)An example of the uevents generated as captured by udevmonitor is shownbelow.1.) Path failure.UEVENT[1192521009.711215] change@/block/dm-3ACTION=changeDEVPATH=/block/dm-3SUBSYSTEM=blockDM_TARGET=multipathDM_ACTION=PATH_FAILEDDM_SEQNUM=1DM_PATH=8:32DM_NR_VALID_PATHS=0DM_NAME=mpath2DM_UUID=mpath-35333333000002328MINOR=3MAJOR=253SEQNUM=11302.) Path reinstate.UEVENT[1192521132.989927] change@/block/dm-3ACTION=changeDEVPATH=/block/dm-3SUBSYSTEM=blockDM_TARGET=multipathDM_ACTION=PATH_REINSTATEDDM_SEQNUM=2DM_PATH=8:32DM_NR_VALID_PATHS=1DM_NAME=mpath2DM_UUID=mpath-35333333000002328MINOR=3MAJOR=253SEQNUM=1131
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -