After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778610 - Minor fixes for NmObject D-Bus connection handling
Minor fixes for NmObject D-Bus connection handling
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: nm-review
 
 
Reported: 2017-02-14 14:26 UTC by Philip Withnall
Modified: 2017-02-15 15:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libnm-glib: Add some missing precondition assertions (3.04 KB, patch)
2017-02-14 14:26 UTC, Philip Withnall
none Details | Review
nm-object: Defer assignment of default D-Bus connection (2.02 KB, patch)
2017-02-14 14:26 UTC, Philip Withnall
none Details | Review

Description Philip Withnall 2017-02-14 14:26:32 UTC
A few fixes I made while debugging an issue with the system bus in unit tests on a project I work on.
Comment 1 Philip Withnall 2017-02-14 14:26:37 UTC
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>
Comment 2 Philip Withnall 2017-02-14 14:26:44 UTC
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>
Comment 3 Thomas Haller 2017-02-15 15:35:33 UTC
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.