From 7257c5ec8387338d55ea6688803f5aaeb4fb8a8d Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 8 Dec 2017 17:12:46 +0100 Subject: [PATCH] libnm: disable g_warning() from library Printing a g_warning() from the library is not helpful. Client-side, libnm should support newer server versions and changing formats. To support forward-compatibility, it should parse the received GVariant best-effort like, without complaining. Server-side, libnm-core should return errors when receiving invalid configuration. It must not maintain forward-compatibility, only backward-compatibility -- which is implemented by handling old and newer formats. But never should server allow a configuration that is invalid. Currently, the libnm API cannot yet fail at this point. Hence, it cannot return an error. It would need a strict and relaxed parsing mode. Until that exists, just comment out the warnings. (cherry picked from commit 7cd2b6178d737466d98b59a4ce62663cef8f8625) --- libnm-core/nm-setting-tc-config.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libnm-core/nm-setting-tc-config.c b/libnm-core/nm-setting-tc-config.c index 2a49e42d04..240250c8df 100644 --- a/libnm-core/nm-setting-tc-config.c +++ b/libnm-core/nm-setting-tc-config.c @@ -1262,13 +1262,13 @@ _qdiscs_from_variant (GVariant *value) if ( !g_variant_lookup (qdisc_var, "kind", "&s", &kind) || !g_variant_lookup (qdisc_var, "parent", "u", &parent)) { - g_warning ("Ignoring invalid qdisc"); + //g_warning ("Ignoring invalid qdisc"); goto next; } qdisc = nm_tc_qdisc_new (kind, parent, &error); if (!qdisc) { - g_warning ("Ignoring invalid qdisc: %s", error->message); + //g_warning ("Ignoring invalid qdisc: %s", error->message); g_clear_error (&error); goto next; } @@ -1417,13 +1417,13 @@ _tfilters_from_variant (GVariant *value) if ( !g_variant_lookup (tfilter_var, "kind", "&s", &kind) || !g_variant_lookup (tfilter_var, "parent", "u", &parent)) { - g_warning ("Ignoring invalid tfilter"); + //g_warning ("Ignoring invalid tfilter"); goto next; } tfilter = nm_tc_tfilter_new (kind, parent, &error); if (!tfilter) { - g_warning ("Ignoring invalid tfilter: %s", error->message); + //g_warning ("Ignoring invalid tfilter: %s", error->message); g_clear_error (&error); goto next; } @@ -1436,13 +1436,13 @@ _tfilters_from_variant (GVariant *value) if (action_var) { if (!g_variant_lookup (action_var, "kind", "&s", &action_kind)) { - g_warning ("Ignoring tfilter with invalid action"); + //g_warning ("Ignoring tfilter with invalid action"); goto next; } action = nm_tc_action_new (action_kind, &error); if (!action) { - g_warning ("Ignoring tfilter with invalid action: %s", error->message); + //g_warning ("Ignoring tfilter with invalid action: %s", error->message); g_clear_error (&error); goto next; }