platform: fetch objects via the event socket
authorThomas Haller <thaller@redhat.com>
Sun, 10 May 2015 08:02:31 +0000 (10:02 +0200)
committerThomas Haller <thaller@redhat.com>
Wed, 17 Jun 2015 09:41:43 +0000 (11:41 +0200)
commit051cf8bbde9b73cdb3718be94e78237758b451ff
treeb12f855fa96e8a3ef7e1c5ff0ad2fedbb9bd5e13
parent3377cd7e180959f3265d0b91f630bbb73436bb09
platform: fetch objects via the event socket

Use the event socket to request object via NLM_F_DUMP.

No longer use 'priv->nlh' socket to fetch objects.
Instead fetch them via the priv->nlh_event socket that also
provides asynchronous events when objects change.

That way, the events are in sync with our explicit requests
and we can directly use the events. Previously, the events were
only used to indicate that a refetch must happen, so that every
event triggered a complete dump of all addresses/routes.

We still use 'priv->nlh' to make synchronous requests such as
adding/changing/deleting objects. That means, after we send a
request, we must make sure that the result manifested itself
at 'nlh_event' socket and the platform cache.
That's why we sometimes still must force a dump to sync changes.
That could be improved by using only one netlink socket so that
we would wait for the ACK of our request.

While not yet perfect, this already significantly reduces the number of
fetches. Additionally, before, whenever requesting a dump of addresses
or routes (which we did much more often, search for "get_kernel_object for type"
log lines), we always dumped IPv4 and IPv6 together. Now only request
the addr-family in question.

https://bugzilla.gnome.org/show_bug.cgi?id=747985
https://bugzilla.redhat.com/show_bug.cgi?id=1211133
src/platform/nm-fake-platform.c
src/platform/nm-linux-platform.c
src/platform/tests/test-cleanup.c
src/platform/tests/test-link.c
valgrind.suppressions