Problem
When I integrate the device mapper within kata-agent whose builtin rootfs without udev, something goes wrong with the devicemapper crate. The original UdevSync::begin() unconditionally checked udev_running() as its very first step. When udev was not running (e.g., in minimal VMs, containers, kata-agent guest VMs), it returned a hard error:
if !udev_running() {
return Err(DmError::Core(errors::Error::UdevSync(
"Udev daemon is not running: unable to create devices.".to_string(),
)));
}
This error blocked all DM ioctl operations, including those that do not require udev synchronization (e.g., DM_VERSION_CMD, DM_LIST_DEVICES_CMD, DM_DEV_CREATE_CMD, DM_TABLE_LOAD_CMD, DM_DEV_STATUS_CMD).
Additionally, even if a caller set DM_UDEV_DISABLE_LIBRARY_FALLBACK, the flag was never checked because the !udev_running() check came first.
Problem
When I integrate the device mapper within kata-agent whose builtin rootfs without udev, something goes wrong with the devicemapper crate. The original
UdevSync::begin()unconditionally checkedudev_running()as its very first step. When udev was not running (e.g., in minimal VMs, containers, kata-agent guest VMs), it returned a hard error:This error blocked all DM ioctl operations, including those that do not require udev synchronization (e.g.,
DM_VERSION_CMD,DM_LIST_DEVICES_CMD,DM_DEV_CREATE_CMD,DM_TABLE_LOAD_CMD,DM_DEV_STATUS_CMD).Additionally, even if a caller set
DM_UDEV_DISABLE_LIBRARY_FALLBACK, the flag was never checked because the!udev_running()check came first.