diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-10-22 12:40:08 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-10-23 22:44:07 +0900 |
commit | 133432cc1522e0fff52f40b2d8167974dea3f95e (patch) | |
tree | 49145eb91150b36baec446584c23813cc050e747 | |
parent | 7bd33dbd6ee6372846f8e894f883f86c51b3addb (diff) | |
download | systemd-133432cc1522e0fff52f40b2d8167974dea3f95e.tar.gz systemd-133432cc1522e0fff52f40b2d8167974dea3f95e.tar.bz2 systemd-133432cc1522e0fff52f40b2d8167974dea3f95e.zip |
gpt-auto-generator: use log_device_*()
-rw-r--r-- | src/gpt-auto-generator/gpt-auto-generator.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index 08fdd960ba..f0d06ffacf 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -12,6 +12,7 @@ #include "blkid-util.h" #include "blockdev-util.h" #include "btrfs-util.h" +#include "device-util.h" #include "dirent-util.h" #include "dissect-image.h" #include "efivars.h" @@ -461,42 +462,42 @@ static int open_parent(dev_t devnum, int *ret) { if (sd_device_get_devname(d, &name) < 0) { r = sd_device_get_syspath(d, &name); if (r < 0) { - log_debug_errno(r, "Device %u:%u does not have a name, ignoring: %m", major(devnum), minor(devnum)); + log_device_debug_errno(d, r, "Device %u:%u does not have a name, ignoring: %m", major(devnum), minor(devnum)); return 0; } } r = sd_device_get_parent(d, &parent); if (r < 0) { - log_debug_errno(r, "%s: not a partitioned device, ignoring: %m", name); + log_device_debug_errno(d, r, "Not a partitioned device, ignoring: %m"); return 0; } /* Does it have a devtype? */ r = sd_device_get_devtype(parent, &devtype); if (r < 0) { - log_debug_errno(r, "%s: parent doesn't have a device type, ignoring: %m", name); + log_device_debug_errno(parent, r, "Parent doesn't have a device type, ignoring: %m"); return 0; } /* Is this a disk or a partition? We only care for disks... */ if (!streq(devtype, "disk")) { - log_debug("%s: parent isn't a raw disk, ignoring.", name); + log_device_debug(parent, "Parent isn't a raw disk, ignoring."); return 0; } /* Does it have a device node? */ r = sd_device_get_devname(parent, &node); if (r < 0) { - log_debug_errno(r, "%s: parent device does not have device node, ignoring: %m", name); + log_device_debug_errno(parent, r, "Parent device does not have device node, ignoring: %m"); return 0; } - log_debug("%s: root device %s.", name, node); + log_device_debug(d, "Root device %s.", node); r = sd_device_get_devnum(parent, &pn); if (r < 0) { - log_debug_errno(r, "%s: parent device is not a proper block device, ignoring: %m", name); + log_device_debug_errno(parent, r, "Parent device is not a proper block device, ignoring: %m"); return 0; } |