Commit 767204e3 authored by Beniamino Galvani's avatar Beniamino Galvani

device: don't wait udev for devices created by us

If we created a software interface it is because we already decided
that it should be managed, and so there is no point in waiting udev to
check that the interface is not udev-unmanaged.

We still wait udev for software interfaces created externally.

(cherry picked from commit 58db6154)
parent 21ee2f50
......@@ -636,7 +636,8 @@ static void realize_start_setup (NMDevice *self,
gboolean assume_state_guess_assume,
const char *assume_state_connection_uuid,
gboolean set_nm_owned,
NMUnmanFlagOp unmanaged_user_explicit);
NMUnmanFlagOp unmanaged_user_explicit,
gboolean force_platform_init);
static void _set_mtu (NMDevice *self, guint32 mtu);
static void _commit_mtu (NMDevice *self, const NMIP4Config *config);
static void _cancel_activation (NMDevice *self);
......@@ -4082,7 +4083,8 @@ nm_device_realize_start (NMDevice *self,
assume_state_guess_assume,
assume_state_connection_uuid,
set_nm_owned,
unmanaged_user_explicit);
unmanaged_user_explicit,
FALSE);
return TRUE;
}
......@@ -4127,7 +4129,8 @@ nm_device_create_and_realize (NMDevice *self,
plink,
FALSE, /* assume_state_guess_assume */
NULL, /* assume_state_connection_uuid */
FALSE, NM_UNMAN_FLAG_OP_FORGET);
FALSE, NM_UNMAN_FLAG_OP_FORGET,
TRUE);
nm_device_realize_finish (self, plink);
if (nm_device_get_managed (self, FALSE)) {
......@@ -4244,6 +4247,8 @@ realize_start_notify (NMDevice *self,
* @set_nm_owned: if TRUE and device is a software-device, set nm-owned.
* TRUE.
* @unmanaged_user_explicit: the user-explict unmanaged flag to set.
* @force_platform_init: if TRUE the platform-init unmanaged flag is
* forcefully cleared.
*
* Update the device from backing resource properties (like hardware
* addresses, carrier states, driver/firmware info, etc). This function
......@@ -4257,7 +4262,8 @@ realize_start_setup (NMDevice *self,
gboolean assume_state_guess_assume,
const char *assume_state_connection_uuid,
gboolean set_nm_owned,
NMUnmanFlagOp unmanaged_user_explicit)
NMUnmanFlagOp unmanaged_user_explicit,
gboolean force_platform_init)
{
NMDevicePrivate *priv;
NMDeviceClass *klass;
......@@ -4266,6 +4272,7 @@ realize_start_setup (NMDevice *self,
NMDeviceCapabilities capabilities = 0;
NMConfig *config;
guint real_rate;
gboolean unmanaged;
/* plink is a NMPlatformLink type, however, we require it to come from the platform
* cache (where else would it come from?). */
......@@ -4396,9 +4403,12 @@ realize_start_setup (NMDevice *self,
nm_device_set_unmanaged_by_user_udev (self);
nm_device_set_unmanaged_by_user_conf (self);
unmanaged = plink
&& !plink->initialized
&& !force_platform_init;
nm_device_set_unmanaged_flags (self, NM_UNMANAGED_PLATFORM_INIT,
plink && !plink->initialized);
unmanaged);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment