core/dbus: debug log unix file descriptor when closing private dbus connection

Signed-off-by: Thomas Haller <thaller@redhat.com>
libnm: remove unused variable NMObjectPrivate:private_connection

Signed-off-by: Thomas Haller <thaller@redhat.com>
libnm: assert for interface name in _nm_object_class_add_interface()

Signed-off-by: Thomas Haller <thaller@redhat.com>
libnm: add NMObject:dbus-connection property to inject DBUS connection

Commit b732380d1eb86d4278578559b0ec00990202e3fc removed the gobject
property "NMObject:connection". However, this property is still needed
to inject the DBUS connection when creating new proxy objects. Without it,
we call _nm_dbus_new_connection() in the constructor for every proxy NMObject.

In case of non-private connections, g_bus_get_sync() already returns the same
connection. However for private connections, g_dbus_connection_new_for_address_sync()
would create a separate DBUS connection.

https://bugzilla.gnome.org/show_bug.cgi?id=737725

Signed-off-by: Thomas Haller <thaller@redhat.com>
libnm: share private DBUS connection

Cache the private DBUS connection and reuse it. Otherwise we end up
creating several private connnections, as an NMObject instance creates
a new connection (unless it is passed in as NMObject:dbus-connection
property).

We already pass the existing "parent" DBUS connection when creating
the proxy objects. However, when creating two independent objects
(e.g. nm_client_new() and nm_remote_settings_new()), their private
DBUS connections were not shared.

Implement this sharing inside nm-dbus-helpers.c

https://bugzilla.gnome.org/show_bug.cgi?id=737725

Signed-off-by: Thomas Haller <thaller@redhat.com>
libnm: merge branch 'th/bgo737725-libnm-private-dbus-connection'

https://bugzilla.gnome.org/show_bug.cgi?id=737725

Signed-off-by: Thomas Haller <thaller@redhat.com>
contrib/rpm: detect ppp version based on installed package

Also fixes build failure if user had no /sbin/pppd in its $PATH.

https://bugzilla.gnome.org/show_bug.cgi?id=736954

Signed-off-by: Thomas Haller <thaller@redhat.com>
build: fix compilation with GLib 2.32
bond: fix setting bond option 'lacp_rate'

Setting 'lacp_rate' is only possible in '802.3ad' (4) mode.
Otherwise writing to sysctl fails and results in the following
error log:

    <error> [1412337854.026285] [platform/nm-linux-platform.c:2093] sysctl_set(): sysctl: failed to set '/sys/class/net/nm-bond/bonding/lacp_rate' to '0': (13) Permission denied
    <warn>  (nm-bond): failed to set bonding attribute 'lacp_rate' to '0'

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1061702

Fixes: 47555449fa1b66604ea6645eb6fd97fc131cbc9e
Signed-off-by: Thomas Haller <thaller@redhat.com>
libnm: fix properties-changed debug logging

The code was mistakenly still using G_VALUE_TYPE_NAME() instead of
g_variant_get_type_string().

Also, refer to the properties with standard gtk-doc punctuation:
"TypeName:property-name".
libnm: reorganize demarshal_generic(), make unrecognized type a warning

Redo the HANDLE_TYPE macro in demarshal_generic() in a more
syntactically-sane way (both to help the editor with indentation and
to make it not look so weird).

Also, if demarshal_generic() is asked to handle a property of a type
that it doesn't know how to handle, that's a programmer error, so do a
g_warning() in that case (as opposed to being asked to demarshal a
value of the wrong D-Bus type, which could just be a bug in the peer
that sent the data, so that stays as a debug message).
libnm: make use of GParamSpecFlags and GParamSpecEnum

Make enum- and flags-valued properties use GParamSpecEnum and
GParamSpecFlags, for better introspectability/bindability.

This requires no changes outside libnm-core/libnm since the expected
data size is still the same with g_object_get()/g_object_set(), and
GLib will internally convert between int/uint and enum/flags GValues
when using g_object_get_property()/g_object_set_property().
libnm-core: make NMSettingSerial:parity an enum

NMSettingSerial:parity was defined as a char-typed property that could
have the (case-sensitive!) values 'n', 'E', or 'o'. This is zany. Add
an NMSettingSerialParity enum, and use that instead.
libnm: make use of GParamSpecFlags and GParamSpecEnum (bgo #737485)
bluez: split out errors

We'll use them from more places than nm nm-bt-device.c in the future.
device: drop leftover bad assert

NetworkManager:ERROR:devices/nm-device.c:7089:nm_device_update_hw_address: assertion failed: (hwaddrlen <= sizeof (priv->hw_addr))
Aborted (core dumped)

Breaks 32-bit, works on 64-bit by dumb luck.

https://bugzilla.gnome.org/show_bug.cgi?id=737900

Fixes: b019348fdde223f39c91150e6b7a11e366fade63
Signed-off-by: Thomas Haller <thaller@redhat.com>
libnm, libnm-glib: clarify nm_client_activate_connection() semantics

nm_client_activate_connection() and
nm_client_add_and_activate_connection() return when the activation has
*started*, not when it *finishes*. Clarify this a bit more in the
libnm docs, and copy that clarification to libnm-glib as well.

https://bugzilla.gnome.org/show_bug.cgi?id=736233
logging: add new logging level "TRACE"

Signed-off-by: Thomas Haller <thaller@redhat.com>
core/dbus: log messages in nm-dbus-manager.c with "TRACE" priority

The messages logged by nm-dbus-manager.c are not very useful, but amount to
a significant part of DEBUG logging. Log those messages with the lower TRACE priority.

Signed-off-by: Thomas Haller <thaller@redhat.com>
logging: merge branch 'th/bgo737593_log_trace'

https://bugzilla.gnome.org/show_bug.cgi?id=737593

Signed-off-by: Thomas Haller <thaller@redhat.com>