manager: don't consider by-user change flag for creating unrealized device

This effectively reverts commit [1].

The by-user argument is not very clear what it means. Is a "nmcli
connection load $FILENAME" a user-action? How about reload?

I don't know whether the problem that this was supposed to fix is still
present. But in any case, the condition here seems not right. It's
already hard to understand when and how we generate unrealized devices.

If the condition from commit [1] should be prevented, then it must happen
somehow differently. In the example, the offending connection is a generated
volatile profile with the device being sys-face-state "external". Of course,
we should not generate devices for such profiles nor autoactivating them.
So adding a device for a volatile connection is always wrong. Don't do that,
which should avoid the original problem.

[1] commit a8a4eb1418 ('manager: don't create the virtual devices on all connection changes')
This commit is contained in:
Thomas Haller 2019-06-20 09:07:45 +02:00
parent d1f269ab36
commit f8a20d0a09

View file

@ -2064,8 +2064,14 @@ static void
connection_changed (NMManager *self,
NMSettingsConnection *sett_conn)
{
NMConnection *connection;
NMDevice *device;
NMConnection *connection = nm_settings_connection_get_connection (sett_conn);
if (NM_FLAGS_HAS (nm_settings_connection_get_flags (sett_conn),
NM_SETTINGS_CONNECTION_INT_FLAGS_VOLATILE))
return;
connection = nm_settings_connection_get_connection (sett_conn);
if (!nm_connection_is_virtual (connection))
return;
@ -2094,8 +2100,7 @@ connection_updated_cb (NMSettings *settings,
gboolean by_user,
NMManager *self)
{
if (by_user)
connection_changed (self, sett_conn);
connection_changed (self, sett_conn);
}
/*****************************************************************************/