diff --git a/lib/device/dev-ext-udev-constants.h b/lib/device/dev-ext-udev-constants.h index 5b9a09627..168f8f1e8 100644 --- a/lib/device/dev-ext-udev-constants.h +++ b/lib/device/dev-ext-udev-constants.h @@ -36,6 +36,9 @@ #define DEV_EXT_UDEV_DEVTYPE "DEVTYPE" #define DEV_EXT_UDEV_DEVTYPE_DISK "disk" +/* the list of symlinks associated with device node */ +#define DEV_EXT_UDEV_DEVLINKS "DEVLINKS" + /* * DEV_EXT_UDEV_MPATH_DEVICE_PATH is set by multipath in udev db * with value either 0 or 1. The same functionality as diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c index f1828f41b..32471aab7 100644 --- a/lib/device/dev-type.c +++ b/lib/device/dev-type.c @@ -1024,8 +1024,13 @@ int udev_dev_is_mpath_component(struct device *dev) return 0; } +#ifdef HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED if ((initialized = udev_device_get_is_initialized(udev_device))) break; +#else + if ((initialized = (udev_device_get_property_value(udev_device, DEV_EXT_UDEV_DEVLINKS) != NULL))) + break; +#endif log_debug("Device %s not initialized in udev database (%u/%u, %u microseconds).", dev_name(dev), i + 1, UDEV_DEV_IS_MPATH_COMPONENT_ITERATION_COUNT,