]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-builtin: logs when needs reloading
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 15 Jul 2022 03:41:26 +0000 (12:41 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 23 Jul 2022 06:05:22 +0000 (15:05 +0900)
src/udev/udev-builtin-hwdb.c
src/udev/udev-builtin-kmod.c
src/udev/udev-builtin-net_setup_link.c

index 1241c08f2c5c94a7ada757cfeec6949fcab1e88e..1924fcc4ad4d4a8155d90ed02481d27f329013d8 100644 (file)
@@ -208,7 +208,12 @@ static void builtin_hwdb_exit(void) {
 
 /* called every couple of seconds during event activity; 'true' if config has changed */
 static bool builtin_hwdb_validate(void) {
-        return hwdb_validate(hwdb);
+        if (hwdb_validate(hwdb)) {
+                log_debug("hwdb needs reloading.");
+                return true;
+        }
+
+        return false;
 }
 
 const UdevBuiltin udev_builtin_hwdb = {
index bc6a11f2410637576ec463f870f38667db723d2e..85afd3b6ec92852eeb251f32f66bc2def4bd02ec 100644 (file)
@@ -43,7 +43,7 @@ static int builtin_kmod_init(void) {
         if (!ctx)
                 return -ENOMEM;
 
-        log_debug("Load module index");
+        log_debug("Loading kernel module index.");
         kmod_set_log_fn(ctx, udev_kmod_log, NULL);
         kmod_load_resources(ctx);
         return 0;
@@ -51,16 +51,21 @@ static int builtin_kmod_init(void) {
 
 /* called on udev shutdown and reload request */
 static void builtin_kmod_exit(void) {
-        log_debug("Unload module index");
+        log_debug("Unload kernel module index.");
         ctx = kmod_unref(ctx);
 }
 
 /* called every couple of seconds during event activity; 'true' if config has changed */
 static bool builtin_kmod_validate(void) {
-        log_debug("Validate module index");
         if (!ctx)
                 return false;
-        return (kmod_validate_resources(ctx) != KMOD_RESOURCES_OK);
+
+        if (kmod_validate_resources(ctx) != KMOD_RESOURCES_OK) {
+                log_debug("Kernel module index needs reloading.");
+                return true;
+        }
+
+        return false;
 }
 
 const UdevBuiltin udev_builtin_kmod = {
index d4095c7684ce0054948befaf7aa49fd14a541367..bad4e994b9d3afeae0c90abf5de72bec71d382aa 100644 (file)
@@ -75,11 +75,15 @@ static void builtin_net_setup_link_exit(void) {
 }
 
 static bool builtin_net_setup_link_validate(void) {
-        log_debug("Check if link configuration needs reloading.");
         if (!ctx)
                 return false;
 
-        return link_config_should_reload(ctx);
+        if (link_config_should_reload(ctx)) {
+                log_debug("Link configuration context needs reloading.");
+                return true;
+        }
+
+        return false;
 }
 
 const UdevBuiltin udev_builtin_net_setup_link = {