mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 09:08:18 +02:00
core: log the content of "/var/lib/NetworkManager/no-auto-default.state"
To understand why a profile gets not created, it's necessary to see the content of "/var/lib/NetworkManager/no-auto-default.state". Log it.
This commit is contained in:
parent
efa51ba9a2
commit
54de101f6e
6 changed files with 31 additions and 7 deletions
|
|
@ -166,7 +166,7 @@ print_config (NMConfigCmdLineOptions *config_cli)
|
|||
|
||||
config_data = nm_config_get_data (config);
|
||||
fprintf (stdout, "# NetworkManager configuration: %s\n", nm_config_data_get_config_description (config_data));
|
||||
nm_config_data_log (config_data, "", "", stdout);
|
||||
nm_config_data_log (config_data, "", "", nm_config_get_no_auto_default_file (config), stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -373,7 +373,7 @@ main (int argc, char *argv[])
|
|||
nm_config_get_first_start (config) ? "for the first time" : "after a restart");
|
||||
|
||||
nm_log_info (LOGD_CORE, "Read config: %s", nm_config_data_get_config_description (nm_config_get_data (config)));
|
||||
nm_config_data_log (nm_config_get_data (config), "CONFIG: ", " ", NULL);
|
||||
nm_config_data_log (nm_config_get_data (config), "CONFIG: ", " ", nm_config_get_no_auto_default_file (config), NULL);
|
||||
|
||||
if (error_invalid_logging_config) {
|
||||
nm_log_warn (LOGD_CORE, "config: invalid logging configuration: %s", error_invalid_logging_config->message);
|
||||
|
|
|
|||
|
|
@ -82,8 +82,12 @@ typedef struct {
|
|||
int autoconnect_retries_default;
|
||||
|
||||
struct {
|
||||
|
||||
/* from /var/lib/NetworkManager/no-auto-default.state */
|
||||
char **arr;
|
||||
GSList *specs;
|
||||
|
||||
/* from main.no-auto-default setting in NetworkManager.conf. */
|
||||
GSList *specs_config;
|
||||
} no_auto_default;
|
||||
|
||||
|
|
@ -601,6 +605,7 @@ void
|
|||
nm_config_data_log (const NMConfigData *self,
|
||||
const char *prefix,
|
||||
const char *key_prefix,
|
||||
const char *no_auto_default_file,
|
||||
/* FILE* */ gpointer print_stream)
|
||||
{
|
||||
const NMConfigDataPrivate *priv;
|
||||
|
|
@ -693,6 +698,16 @@ nm_config_data_log (const NMConfigData *self,
|
|||
}
|
||||
}
|
||||
|
||||
_LOG (stream, prefix, "");
|
||||
_LOG (stream, prefix, "# no-auto-default file \"%s\"", no_auto_default_file);
|
||||
{
|
||||
gs_free char *msg = NULL;
|
||||
|
||||
msg = nm_utils_g_slist_strlist_join (priv->no_auto_default.specs, ",");
|
||||
if (msg)
|
||||
_LOG (stream, prefix, "# no-auto-default specs \"%s\"", msg);
|
||||
}
|
||||
|
||||
#undef _LOG
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,9 +111,10 @@ NMConfigData *nm_config_data_new_update_no_auto_default (const NMConfigData *bas
|
|||
NMConfigChangeFlags nm_config_data_diff (NMConfigData *old_data, NMConfigData *new_data);
|
||||
|
||||
void nm_config_data_log (const NMConfigData *self,
|
||||
const char *prefix,
|
||||
const char *key_prefix,
|
||||
/* FILE* */ gpointer print_stream);
|
||||
const char *prefix,
|
||||
const char *key_prefix,
|
||||
const char *no_auto_default_file,
|
||||
/* FILE* */ gpointer print_stream);
|
||||
|
||||
const char *nm_config_data_get_config_main_file (const NMConfigData *config_data);
|
||||
const char *nm_config_data_get_config_description (const NMConfigData *config_data);
|
||||
|
|
|
|||
|
|
@ -331,6 +331,12 @@ nm_config_get_first_start (NMConfig *config)
|
|||
return NM_CONFIG_GET_PRIVATE (config)->cli.first_start;
|
||||
}
|
||||
|
||||
const char *
|
||||
nm_config_get_no_auto_default_file (NMConfig *config)
|
||||
{
|
||||
return NM_CONFIG_GET_PRIVATE (config)->no_auto_default_file;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static char **
|
||||
|
|
@ -2690,7 +2696,7 @@ _set_config_data (NMConfig *self, NMConfigData *new_data, NMConfigChangeFlags re
|
|||
_LOGI ("signal: %s (%s)",
|
||||
nm_config_change_flags_to_string (changes, NULL, 0),
|
||||
nm_config_data_get_config_description (new_data));
|
||||
nm_config_data_log (new_data, "CONFIG: ", " ", NULL);
|
||||
nm_config_data_log (new_data, "CONFIG: ", " ", priv->no_auto_default_file, NULL);
|
||||
priv->config_data = new_data;
|
||||
} else if (had_new_data)
|
||||
_LOGI ("signal: %s (no changes from disk)", nm_config_change_flags_to_string (changes, NULL, 0));
|
||||
|
|
|
|||
|
|
@ -150,6 +150,8 @@ gboolean nm_config_get_is_debug (NMConfig *config);
|
|||
|
||||
gboolean nm_config_get_first_start (NMConfig *config);
|
||||
|
||||
const char *nm_config_get_no_auto_default_file (NMConfig *config);
|
||||
|
||||
void nm_config_set_values (NMConfig *self,
|
||||
GKeyFile *keyfile_intern_new,
|
||||
gboolean allow_write,
|
||||
|
|
|
|||
|
|
@ -524,7 +524,7 @@ test_config_confdir (void)
|
|||
g_assert_cmpstr (value, ==, "VAL5");
|
||||
g_free (value);
|
||||
|
||||
nm_config_data_log (nm_config_get_data_orig (config), ">>> TEST: ", " ", NULL);
|
||||
nm_config_data_log (nm_config_get_data_orig (config), ">>> TEST: ", " ", "/test/file/name", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue