udev: downgrade ENOMEDIUM warnings

I noticed similar warnings in many VM boots:
  fedora (udev-worker)[475]: sr0: Failed to open device node: No medium found
This particular one is from src/udev/udev-builtin-uaccess.c:125, but I think the
same principle should be used in all places: if we are ignoring errors that the
device has been removed, we should also ignore ENOMEDIUM.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2025-07-24 10:42:50 +02:00
parent b0ca060e05
commit 56631ac8df
10 changed files with 20 additions and 13 deletions
+7
View File
@@ -212,6 +212,13 @@ static inline bool ERRNO_IS_NEG_DEVICE_ABSENT(intmax_t r) {
}
_DEFINE_ABS_WRAPPER(DEVICE_ABSENT);
/* Device is absent or "empty". We get -ENOMEDIUM from CD/DVD devices, also in VMs. */
static inline bool ERRNO_IS_NEG_DEVICE_ABSENT_OR_EMPTY(intmax_t r) {
return ERRNO_IS_NEG_DEVICE_ABSENT(r) ||
r == -ENOMEDIUM;
}
_DEFINE_ABS_WRAPPER(DEVICE_ABSENT_OR_EMPTY);
/* Quite often we want to handle cases where the backing FS doesn't support extended attributes at all and
* where it simply doesn't have the requested xattr the same way */
static inline bool ERRNO_IS_NEG_XATTR_ABSENT(intmax_t r) {