Skip to content

Commit f0ccc08

Browse files
committed
Get WWN for multipath block devices
Device Mapper devices have DM_WWN set in udev in place of ID_WWN_WITH_VENDOR_EXTENSION. Reading DM_WWN allows us to see the WWN for multipath fibre channel or iSCSI block devices. Because DM_WWN contains the vendor extension, there is no corresponding change to WWNNoExtension. Signed-off-by: Zane Bitter <zbitter@redhat.com>
1 parent 3773bc3 commit f0ccc08

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/block/block_linux.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ func diskWWN(paths *linuxpath.Paths, disk string) string {
208208
if wwn, ok := info["ID_WWN"]; ok {
209209
return wwn
210210
}
211+
// Device Mapper devices get DM_WWN instead of ID_WWN_WITH_EXTENSION
212+
if wwn, ok := info["DM_WWN"]; ok {
213+
return wwn
214+
}
211215
return util.UNKNOWN
212216
}
213217

0 commit comments

Comments
 (0)