<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/NetworkManager.git/src, branch lr/api-docs</title>
<subtitle>gitlab.freedesktop.org: NetworkManager/NetworkManager.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/'/>
<entry>
<title>device: track system interface state in NMDevice</title>
<updated>2017-03-16T17:27:33+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-03-13T14:34:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=850c977953e4de3c8bbee64a3d2e8726c971761c'/>
<id>850c977953e4de3c8bbee64a3d2e8726c971761c</id>
<content type='text'>
When deciding whether to touch a device we sometimes look at whether
the active connection is external/assumed. In many cases however,
there is no active connection around (e.g. while moving the device
from state unmanaged to disconnected before assuming).
So in most cases we instead look at the device-state-reason to decide
whether to touch the interface (see nm_device_state_reason_check()).

Often it's desirable to have no state and passing data as function
arguments. However, the state reason has to be passed along several hops
(e.g. a queued state change). Or a change to a master/slave can affect
the slave/master, where we pass on the state reason. Or an intermediate
event might invalidate a previous state reason. Passing the state
whether to touch a device or not as a state-reason is cumbersome
and limited.

Instead, the device should be aware of whats going on. Add a
sys-iface-state with:
  - SYS_IFACE_STATE_EXTERNAL: meaning, NM should not touch it
  - SYS_IFACE_STATE_ASSUME: meaning, NM is gracefully taking over
  - SYS_IFACE_STATE_MANAGED: meaning, the device is managed by NM
  - SYS_IFACE_STATE_REMOVED: the device no longer exists

This replaces most checks of nm_device_state_reason_check() and
nm_active_connection_get_activation_type() by instead looking at
the sys-iface-state of the device.

This patch probably has still issues, but the previous behavior was
not very clear either. We will need to identify those issues in future
tests and tweak the behavior. At least, now there is one flag that
describes how to behave.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When deciding whether to touch a device we sometimes look at whether
the active connection is external/assumed. In many cases however,
there is no active connection around (e.g. while moving the device
from state unmanaged to disconnected before assuming).
So in most cases we instead look at the device-state-reason to decide
whether to touch the interface (see nm_device_state_reason_check()).

Often it's desirable to have no state and passing data as function
arguments. However, the state reason has to be passed along several hops
(e.g. a queued state change). Or a change to a master/slave can affect
the slave/master, where we pass on the state reason. Or an intermediate
event might invalidate a previous state reason. Passing the state
whether to touch a device or not as a state-reason is cumbersome
and limited.

Instead, the device should be aware of whats going on. Add a
sys-iface-state with:
  - SYS_IFACE_STATE_EXTERNAL: meaning, NM should not touch it
  - SYS_IFACE_STATE_ASSUME: meaning, NM is gracefully taking over
  - SYS_IFACE_STATE_MANAGED: meaning, the device is managed by NM
  - SYS_IFACE_STATE_REMOVED: the device no longer exists

This replaces most checks of nm_device_state_reason_check() and
nm_active_connection_get_activation_type() by instead looking at
the sys-iface-state of the device.

This patch probably has still issues, but the previous behavior was
not very clear either. We will need to identify those issues in future
tests and tweak the behavior. At least, now there is one flag that
describes how to behave.
</pre>
</div>
</content>
</entry>
<entry>
<title>manager: always cleanup volatile settings-connection on active-connection removal</title>
<updated>2017-03-16T17:27:33+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-03-16T15:14:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=9395f163f46d925b1de51f591e1f27f94cab2d67'/>
<id>9395f163f46d925b1de51f591e1f27f94cab2d67</id>
<content type='text'>
This is not only relevant if the active connection is
assumed/external.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is not only relevant if the active connection is
assumed/external.
</pre>
</div>
</content>
</entry>
<entry>
<title>manager: simplify searching assumed connection</title>
<updated>2017-03-16T17:27:33+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-03-13T13:48:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=72de503d3918506b17caba3265c593f433037d85'/>
<id>72de503d3918506b17caba3265c593f433037d85</id>
<content type='text'>
Now we only search for a candiate with matching UUID. No need to
first lookup all activatable connections, just find the candidate
by UUID and see if it is activatable.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now we only search for a candiate with matching UUID. No need to
first lookup all activatable connections, just find the candidate
by UUID and see if it is activatable.
</pre>
</div>
</content>
</entry>
<entry>
<title>manager: cleanup find_ac_for_connection() in "nm-manager.c"</title>
<updated>2017-03-16T17:27:33+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-03-13T13:01:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=02f6bfeae26a58adc9257247c0ac31d0e741dac7'/>
<id>02f6bfeae26a58adc9257247c0ac31d0e741dac7</id>
<content type='text'>
- rename find_ac_for_connection() to
  active_connection_find_first_by_connection().
  This function has the unexpected(?) behavior to either
  search by the @connection using pointer identity, or
  by looking up the UUID (depending on whether @connection
  is a NMSettingsConnection).

- Split out a active_connection_find_first() part.
  The name "find-first" makes it clear that we walk the list until
  a matching active-connection is found. That's why I added the
  max_state argument. Otherwise, it would have to be called
  "find-first-non-disconnected".

- drop nm_manager_get_connection_device(). It only had two callers.
  It also used the ambiguity of the @connection argument, but
  only one of the two callers cared about that. Meaning,
  _internal_activate_device() now explicitly does a lookup by
  the NMSettingsConnection.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- rename find_ac_for_connection() to
  active_connection_find_first_by_connection().
  This function has the unexpected(?) behavior to either
  search by the @connection using pointer identity, or
  by looking up the UUID (depending on whether @connection
  is a NMSettingsConnection).

- Split out a active_connection_find_first() part.
  The name "find-first" makes it clear that we walk the list until
  a matching active-connection is found. That's why I added the
  max_state argument. Otherwise, it would have to be called
  "find-first-non-disconnected".

- drop nm_manager_get_connection_device(). It only had two callers.
  It also used the ambiguity of the @connection argument, but
  only one of the two callers cared about that. Meaning,
  _internal_activate_device() now explicitly does a lookup by
  the NMSettingsConnection.
</pre>
</div>
</content>
</entry>
<entry>
<title>manager: merge/inline assume_connection() in recheck_assume_connection()</title>
<updated>2017-03-16T17:27:33+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-03-09T15:58:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=b152c0a19fb6661114a0ffcbf24d8fd143d048f5'/>
<id>b152c0a19fb6661114a0ffcbf24d8fd143d048f5</id>
<content type='text'>
There is only one caller of assume_connection().

The tasks there are not clearly separate and it is clearer just to
have one large recheck_assume_connection() function which proceeds
step by step, instead of breaking it into separate parts and move
them apart in the source code. The latter implies that -- unless
we forward-declare assume_connection() -- the order of definition
with assume_connection,recheck_assume_connection is contrary the
flow of the code.

Having a separate function in this case is not a simplification
so merge it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is only one caller of assume_connection().

The tasks there are not clearly separate and it is clearer just to
have one large recheck_assume_connection() function which proceeds
step by step, instead of breaking it into separate parts and move
them apart in the source code. The latter implies that -- unless
we forward-declare assume_connection() -- the order of definition
with assume_connection,recheck_assume_connection is contrary the
flow of the code.

Having a separate function in this case is not a simplification
so merge it.
</pre>
</div>
</content>
</entry>
<entry>
<title>core: once activated an assumed connection make it NM_ACTIVATION_TYPE_MANAGED</title>
<updated>2017-03-16T17:27:33+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-03-08T15:06:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=7a5e0c7fd77ecf158a668ccf979378a7ac58438f'/>
<id>7a5e0c7fd77ecf158a668ccf979378a7ac58438f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>core: upgrade EXTERNAL activation type when user saves connection</title>
<updated>2017-03-16T17:27:33+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-03-08T14:58:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=bde67825918669bc7a6eb31669ea806a960a3ac4'/>
<id>bde67825918669bc7a6eb31669ea806a960a3ac4</id>
<content type='text'>
An EXTERNAL activation type comes with a nm-generated, volatile,
in-memory connection. When the user actively modifies that connection, we
shall mark the active connection as fully managed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An EXTERNAL activation type comes with a nm-generated, volatile,
in-memory connection. When the user actively modifies that connection, we
shall mark the active connection as fully managed.
</pre>
</div>
</content>
</entry>
<entry>
<title>core: only assume connections that were managed in a previous run of NetworkManager</title>
<updated>2017-03-16T17:27:33+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-03-08T07:45:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=b32746cec365f3b71d450b1d528c609408298dae'/>
<id>b32746cec365f3b71d450b1d528c609408298dae</id>
<content type='text'>
Before, we would have the concept of assumed connections, which is used
for (1) externally configured device that NetworkManager should not
touch and (2) connections that NetworkManager should gracefully take
over after a restart (seamlessly, non-destructively).

The behavior was unclear and mixed. It wasn't clear whether the device
is in no-touch mode (1) or gracefully take-over (2).
Previous commits already introduce separate activation types EXTERNAL (1)
and ASSUME (2).

Also, previously, we would for both (1) and (2) try to find a matching
connection and use it. That doesn't make sense for either.

In the external case (1), we should not pretend that an existing connection
is active. Let's always create a new in-memory connection for these
cases. Note that this means, external devices now will always generate
a connection, instead of pretending an existing one is active.

For the assume case (2), we shall not use nm_utils_match_connection() to
guess which connection might be active. It can only the one that was
active on a previous run of NetworkManager. So, use the information from
the state file and try to activate it. If that fails, it is not an
assume activation type. Note, that this means we now most of the time
don't do ASSUME anymore. Most of the time we do EXTERNAL activation
That is because the state information is only available after restart
of NetworkManager.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before, we would have the concept of assumed connections, which is used
for (1) externally configured device that NetworkManager should not
touch and (2) connections that NetworkManager should gracefully take
over after a restart (seamlessly, non-destructively).

The behavior was unclear and mixed. It wasn't clear whether the device
is in no-touch mode (1) or gracefully take-over (2).
Previous commits already introduce separate activation types EXTERNAL (1)
and ASSUME (2).

Also, previously, we would for both (1) and (2) try to find a matching
connection and use it. That doesn't make sense for either.

In the external case (1), we should not pretend that an existing connection
is active. Let's always create a new in-memory connection for these
cases. Note that this means, external devices now will always generate
a connection, instead of pretending an existing one is active.

For the assume case (2), we shall not use nm_utils_match_connection() to
guess which connection might be active. It can only the one that was
active on a previous run of NetworkManager. So, use the information from
the state file and try to activate it. If that fails, it is not an
assume activation type. Note, that this means we now most of the time
don't do ASSUME anymore. Most of the time we do EXTERNAL activation
That is because the state information is only available after restart
of NetworkManager.
</pre>
</div>
</content>
</entry>
<entry>
<title>core: track external activations types in the active-connection</title>
<updated>2017-03-16T17:27:33+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-03-08T11:22:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=bed2fa1bec3af102c60a3871d0f86a546b7c2a0c'/>
<id>bed2fa1bec3af102c60a3871d0f86a546b7c2a0c</id>
<content type='text'>
We need a distinction between external activations and assuming
connections. The former shall have the meaning of devices that are
*not* managed by NetworkManager, the latter are configurations that
are gracefully taken over after restart (but fully managed).

Express that in the activation-type of the active connection.

Also, no longer use the settings NM_SETTINGS_CONNECTION_FLAGS_VOLATILE
flag to determine whether an assumed connection is "external". These
concepts are entirely orthogonal (although in pratice, external
activations are in-memory and flagged as volatile, but the inverse
is not necessarily true).

Also change match_connection_filter() to consider all connections.
Later, we only call nm_utils_match_connection() for the connection
we want to assume -- which will be a regular settings connection,
not a generated one.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We need a distinction between external activations and assuming
connections. The former shall have the meaning of devices that are
*not* managed by NetworkManager, the latter are configurations that
are gracefully taken over after restart (but fully managed).

Express that in the activation-type of the active connection.

Also, no longer use the settings NM_SETTINGS_CONNECTION_FLAGS_VOLATILE
flag to determine whether an assumed connection is "external". These
concepts are entirely orthogonal (although in pratice, external
activations are in-memory and flagged as volatile, but the inverse
is not necessarily true).

Also change match_connection_filter() to consider all connections.
Later, we only call nm_utils_match_connection() for the connection
we want to assume -- which will be a regular settings connection,
not a generated one.
</pre>
</div>
</content>
</entry>
<entry>
<title>core/trivial: rename activation-type related checks for device and active-connection</title>
<updated>2017-03-16T17:27:33+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-03-08T07:32:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=fa015f2aab960bc4cf2da79a85b99d2cdb36e7bd'/>
<id>fa015f2aab960bc4cf2da79a85b99d2cdb36e7bd</id>
<content type='text'>
nm_device_uses_assumed_connection() basically called
nm_active_connection_get_assumed() on the device.

Rename those functions to be closer to the activation-type
flags.

The concepts of "assume", "external", and "assume_or_external"
will make sense with the following commits.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
nm_device_uses_assumed_connection() basically called
nm_active_connection_get_assumed() on the device.

Rename those functions to be closer to the activation-type
flags.

The concepts of "assume", "external", and "assume_or_external"
will make sense with the following commits.
</pre>
</div>
</content>
</entry>
</feed>
