GNOME Bugzilla – Bug 778610
Minor fixes for NmObject D-Bus connection handling
Last modified: 2017-02-15 15:35:33 UTC
A few fixes I made while debugging an issue with the system bus in unit tests on a project I work on.
Created attachment 345735 [details] [review] libnm-glib: Add some missing precondition assertions To validate the connection and path for NmObject subclass instances. Signed-off-by: Philip Withnall <withnall@endlessm.com>
Created attachment 345736 [details] [review] nm-object: Defer assignment of default D-Bus connection If no D-Bus connection is provided to the constructor of an NmObject, a default one will be assigned in set_property(). However, construction of that default D-Bus connection might fail (if our connection to the system bus is refused, for example), so priv->connection might still be NULL. This will cause the constructor to fail construction of the NmObject, which is correct, but hard to debug. Instead, move the default D-Bus connection handling into the constructor, so all the (priv->connection == NULL) handling is in the same place. Print out any error message. Signed-off-by: Philip Withnall <withnall@endlessm.com>
merged as https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=0cad8307a5beaf1f2d01837687588e59d23c5884 Thanks. note that libnm-glib is long deprecated. Usually we don't change there anything. You are encouraged to move on to libnm.so.