Skip to content

Commit

Permalink
udev/net_id: update log messages
Browse files Browse the repository at this point in the history
This also downgrades the log level of a message to debug.
  • Loading branch information
yuwata committed Aug 23, 2024
1 parent 8c6f484 commit 02b88d6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/udev/udev-builtin-net_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ static int names_pci_onboard(sd_device *dev, sd_device *pci_dev, const char *pre
if (snprintf_ok(str, sizeof str, "%so%u%s%s", prefix, idx, strempty(port), strempty(suffix)))
udev_builtin_add_property(dev, mode, "ID_NET_NAME_ONBOARD", str);

log_device_debug(dev, "Onboard index identifier: index=%u port=%s %s %s",
log_device_debug(dev, "PCI onboard index identifier: index=%u port=%s %s %s",
idx, strna(port),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), empty_to_na(str));

Expand Down Expand Up @@ -580,7 +580,7 @@ static int get_device_firmware_node_sun(sd_device *dev, uint32_t *ret) {
uint32_t sun;
r = safe_atou32(attr, &sun);
if (r < 0)
return log_device_warning_errno(dev, r, "Failed to parse firmware_node/sun '%s', ignoring: %m", attr);
return log_device_debug_errno(dev, r, "Failed to parse firmware_node/sun '%s', ignoring: %m", attr);
if (sun == 0)
return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EINVAL), "firmware_node/sun == 0, ignoring: %m");

Expand All @@ -604,12 +604,12 @@ static int pci_get_slot_from_firmware_node_sun(sd_device *dev, uint32_t *ret) {

r = sd_device_get_parent_with_subsystem_devtype(dev, "pci", NULL, &slot_dev);
if (r < 0)
return log_device_debug_errno(dev, r, "Failed to find pci parent, ignoring: %m");
return log_device_debug_errno(dev, r, "Failed to find parent PCI device, ignoring: %m");

if (is_pci_bridge(slot_dev) && is_pci_multifunction(dev) <= 0)
return log_device_debug_errno(dev, SYNTHETIC_ERRNO(ESTALE),
"Not using slot information because the parent pcieport "
"is a bridge and the PCI device is not multifunction.");
return log_device_debug_errno(
dev, SYNTHETIC_ERRNO(ESTALE),
"Not using slot information because the parent PCI slot is a bridge and the PCI device is not multifunction.");

/* Try getting the ACPI _SUN from the parent pcieport */
if (get_device_firmware_node_sun(slot_dev, ret) >= 0)
Expand Down Expand Up @@ -708,7 +708,7 @@ static int names_pci_slot(sd_device *dev, sd_device *pci_dev, const char *prefix
prefix, strempty(domain), slot, strempty(func), strempty(port), strempty(suffix)))
udev_builtin_add_property(dev, mode, "ID_NET_NAME_SLOT", str);

log_device_debug(dev, "Slot identifier: domain=%s slot=%"PRIu32" func=%s port=%s %s %s",
log_device_debug(dev, "PCI slot identifier: domain=%s slot=%"PRIu32" func=%s port=%s %s %s",
strna(domain), slot, strna(func), strna(port),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), empty_to_na(str));

Expand Down Expand Up @@ -924,7 +924,7 @@ static int names_devicetree(sd_device *dev, const char *prefix, EventMode mode)
char str[ALTIFNAMSIZ];
if (snprintf_ok(str, sizeof str, "%sd%u", prefix, i))
udev_builtin_add_property(dev, mode, "ID_NET_NAME_ONBOARD", str);
log_device_debug(dev, "devicetree identifier: alias_index=%u %s \"%s\"",
log_device_debug(dev, "Devicetree identifier: alias_index=%u %s \"%s\"",
i, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), str + strlen(prefix));
return 0;
}
Expand Down Expand Up @@ -1027,7 +1027,7 @@ static int names_usb(sd_device *dev, const char *prefix, EventMode mode) {

r = sd_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_interface", &usbdev);
if (r < 0)
return log_device_debug_errno(dev, r, "Could not find usb parent device: %m");
return log_device_debug_errno(dev, r, "Could not find USB parent device: %m");

r = get_usb_specifier(usbdev, &suffix);
if (r < 0)
Expand Down Expand Up @@ -1066,7 +1066,7 @@ static int get_bcma_specifier(sd_device *dev, char **ret) {
r = sscanf(sysname, "bcma%*u:%u", &core);
if (r != 1)
return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EINVAL),
"Failed to parse bcma device information.");
"Failed to parse BCMA device information.");

/* suppress the common core == 0 */
if (core > 0 && asprintf(&buf, "b%u", core) < 0)
Expand All @@ -1089,11 +1089,11 @@ static int names_bcma(sd_device *dev, const char *prefix, EventMode mode) {

r = sd_device_get_parent_with_subsystem_devtype(dev, "bcma", NULL, &bcmadev);
if (r < 0)
return log_device_debug_errno(dev, r, "Could not get bcma parent device: %m");
return log_device_debug_errno(dev, r, "Could not get BCMA parent device: %m");

r = sd_device_get_parent_with_subsystem_devtype(bcmadev, "pci", NULL, &pcidev);
if (r < 0)
return log_device_debug_errno(dev, r, "Could not get pci parent device: %m");
return log_device_debug_errno(dev, r, "Could not get PCI parent device: %m");

r = get_bcma_specifier(bcmadev, &suffix);
if (r < 0)
Expand Down

0 comments on commit 02b88d6

Please sign in to comment.