From f8dcb9510c11055a40fd9e42448097c2751e1f2a Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 21 Oct 2014 11:41:44 -0400 Subject: [PATCH] libnm-core: don't warn about unrecognized properties b64c82a3 removed the warning in libnm-util when nm_setting_new_from_hash() sees an unrecognized property, but we were still warning in the equivalent libnm-core code. But it doesn't make sense to warn here either: we do add new properties sometimes, but we always make sure that older clients still get the information they need as well, so they can just ignore the new property. --- libnm-core/nm-setting.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/libnm-core/nm-setting.c b/libnm-core/nm-setting.c index 680db5093..f8fb3e95e 100644 --- a/libnm-core/nm-setting.c +++ b/libnm-core/nm-setting.c @@ -716,8 +716,6 @@ _nm_setting_new_from_dbus (GType setting_type, { NMSettingClass *class; NMSetting *setting; - GVariantIter iter; - const char *prop_name; const NMSettingProperty *properties; guint n_properties; guint i; @@ -736,17 +734,11 @@ _nm_setting_new_from_dbus (GType setting_type, */ class = g_type_class_ref (setting_type); - /* Check for invalid properties first. */ - g_variant_iter_init (&iter, setting_dict); - while (g_variant_iter_next (&iter, "{&sv}", &prop_name, NULL)) { - if (!nm_setting_class_find_property (class, prop_name)) { - /* Oh, we're so nice and only warn, maybe it should be a fatal error? */ - g_warning ("Ignoring invalid property '%s'", prop_name); - continue; - } - } - - /* Now build the setting object from the legitimate properties */ + /* Build the setting object from the properties we know about; we assume + * that any propreties in @setting_dict that we don't know about can + * either be ignored or else has a backward-compatibility equivalent + * that we do know about. + */ setting = (NMSetting *) g_object_new (setting_type, NULL); properties = nm_setting_class_get_properties (class, &n_properties);