Lines Matching +full:uuid +full:- +full:dev
1 // SPDX-License-Identifier: CDDL-1.0
10 * or https://opensource.org/licenses/CDDL-1.0.
46 #define DEV_BYID_PATH "/dev/disk/by-id/"
49 udev_device_get_devid(struct udev_device *dev, char *bufptr, size_t buflen) in udev_device_get_devid() argument
55 /* The bus based by-id path is preferred */ in udev_device_get_devid()
56 bus = udev_device_get_property_value(dev, "ID_BUS"); in udev_device_get_devid()
62 * For multipath nodes use the persistent uuid based identifier in udev_device_get_devid()
64 * Example: 'dm-uuid-mpath-35000c5006304de3f' in udev_device_get_devid()
66 dm_uuid = udev_device_get_property_value(dev, "DM_UUID"); in udev_device_get_devid()
68 (void) snprintf(bufptr, buflen, "dm-uuid-%s", dm_uuid); in udev_device_get_devid()
75 * locate the bus specific by-id link in udev_device_get_devid()
77 * Example: 'scsi-MG03SCA300_350000494a8cb3d67-part1' in udev_device_get_devid()
79 (void) snprintf(devbyid, sizeof (devbyid), "%s%s-", DEV_BYID_PATH, bus); in udev_device_get_devid()
80 entry = udev_device_get_devlinks_list_entry(dev); in udev_device_get_devid()
87 (void) stpncpy(bufptr, name, buflen - 1); in udev_device_get_devid()
88 bufptr[buflen - 1] = '\0'; in udev_device_get_devid()
101 * # ./devname2devid /dev/sda1
102 * devid scsi-350000394a8caede4-part1
104 * # ./devname2devid /dev/dm-1
105 * devid: 'dm-uuid-mpath-35000c5006304de3f'
111 * 0 - means success
112 * 1 - means failure
119 struct udev_device *dev = NULL; in main() local
142 if ((dev = udev_device_new_from_subsystem_sysname(udev, "block", in main()
148 if ((ret = udev_device_get_devid(dev, devid, sizeof (devid))) != 0) { in main()
149 udev_device_unref(dev); in main()
157 udev_device_unref(dev); in main()