diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2015-05-11 17:04:11 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-05-11 19:28:13 +0200 |
commit | 26aeb12749c6b81bd0e3b7aee8fe2b639353b102 (patch) | |
tree | b08708dae66fd520f390f38d862eeb3e956452e6 | |
parent | d6aef9c188468224d6e1dd670844c3f0e7482c35 (diff) | |
download | NetworkManager-26aeb12749c6b81bd0e3b7aee8fe2b639353b102.tar.gz |
linux-platforms: don't enumerate devices via udev if udevd is not running
We'd be able to do so for already existing devices, but not for devices that
are added afterwards, since gudev is hardwired not to listen for events from
kernel.
-rw-r--r-- | src/platform/nm-linux-platform.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index f0d9e699f1..7f700c2b32 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -1118,6 +1118,12 @@ init_link (NMPlatform *platform, NMPlatformLink *info, struct rtnl_link *rtnllin if (!info->driver) info->driver = "unknown"; + /* Only demand further initialization (udev rules ran, device has + * a stable name now) in case udev is running (not in a container). */ + if ( !info->initialized + && access ("/sys", W_OK) != 0) + info->initialized = TRUE; + return TRUE; } @@ -4738,11 +4744,7 @@ setup_devices (NMPlatform *platform) enumerator = g_udev_enumerator_new (priv->udev_client); g_udev_enumerator_add_match_subsystem (enumerator, "net"); - /* Demand that the device is initialized (udev rules ran, - * device has a stable name now) in case udev is running - * (not in a container). */ - if (access ("/sys", W_OK) == 0) - g_udev_enumerator_add_match_is_initialized (enumerator); + g_udev_enumerator_add_match_is_initialized (enumerator); devices = g_udev_enumerator_execute (enumerator); for (iter = devices; iter; iter = g_list_next (iter)) { |