diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2021-12-20 07:36:44 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2021-12-23 09:29:35 +0100 |
commit | 34c8dcce374a55b48d2e9f8a32e42ad69f47b356 (patch) | |
tree | 64195f701f39fb140d1c685ca709eb6624666267 | |
parent | 25e705c361c5edbf152c5a2570c0038faa4195cf (diff) |
core: log variant properties in connection diffbg/log-variant-props
Properly print properties containing a GVariant (as those backed by
a gendata hashtable).
For example, before:
++ ethtool.ring-rx-mini = ???
After:
++ ethtool.ring-rx-mini = 0
https://bugzilla.redhat.com/show_bug.cgi?id=2034086
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1051
-rw-r--r-- | src/core/nm-core-utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c index 00d9f2e54e..908cfd8912 100644 --- a/src/core/nm-core-utils.c +++ b/src/core/nm-core-utils.c @@ -2215,6 +2215,8 @@ _log_connection_get_property(NMSetting *setting, const char *name) s = g_strdup_printf("'%s'", escaped); g_free(escaped); } + } else if (G_VALUE_HOLDS_VARIANT(&val)) { + s = g_variant_print(g_value_get_variant(&val), FALSE); } else { s = g_strdup_value_contents(&val); if (s == NULL) |