1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00

udev-builtin: logs when needs reloading

This commit is contained in:
Yu Watanabe 2022-07-15 12:41:26 +09:00
parent e9d1fae3bb
commit 009b2c3ac1
3 changed files with 21 additions and 7 deletions

View 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 = {

View 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 = {

View 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 = {