diff options
author | Thomas Haller <thaller@redhat.com> | 2014-11-14 22:15:27 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-11-14 22:15:27 +0100 |
commit | a16a73b58e6d671c7c823b7e50aaa108813040c2 (patch) | |
tree | fe970f44bc3a422602a38c20be637b7cbe6a69c6 | |
parent | 757ca24b92b5da6706b181e9ea7e3069658e0ba3 (diff) | |
parent | e5da7aa41c449d9a8bad5f90df18c2c752a7fbc9 (diff) | |
download | NetworkManager-nm-1-0-integration.tar.gz |
Merge branch 'danw/settings-doc-build-bgo740035' into nm-1-0-integrationnm-1-0-integration
Conflicts:
libnm-util/Makefile.am
-rw-r--r-- | libnm-util/Makefile.am | 13 | ||||
-rw-r--r-- | src/devices/adsl/nm-device-adsl.c | 4 | ||||
-rw-r--r-- | src/devices/bluetooth/nm-device-bt.c | 7 | ||||
-rw-r--r-- | src/devices/nm-device-private.h | 3 | ||||
-rw-r--r-- | src/devices/nm-device.c | 15 | ||||
-rw-r--r-- | src/devices/wwan/nm-device-modem.c | 7 | ||||
-rw-r--r-- | src/tests/config/nm-test-device.c | 11 | ||||
-rw-r--r-- | src/tests/config/test-config.c | 3 |
8 files changed, 44 insertions, 19 deletions
diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index f0a885afcd..51864df15e 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -191,21 +191,24 @@ if BUILD_SETTING_DOCS noinst_DATA = nm-setting-docs.xml nm-keyfile-docs.xml nm-ifcfg-rh-docs.xml -nm-setting-docs.xml: generate-setting-docs.py NetworkManager-1.0.gir NetworkManager-1.0.typelib libnm-util.la +docs_sources = $(filter-out $(BUILT_SOURCES),$(libnm_util_la_csources)) + +nm-setting-docs.xml: generate-setting-docs.py $(docs_sources) | NetworkManager-1.0.gir NetworkManager-1.0.typelib libnm-util.la export GI_TYPELIB_PATH=$(abs_builddir)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH}; \ export LD_LIBRARY_PATH=$(abs_builddir)/.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}; \ $(srcdir)/generate-setting-docs.py \ --gir $(builddir)/NetworkManager-1.0.gir \ --output $@ -nm-keyfile-docs.xml: generate-plugin-docs.pl $(libnm_util_la_csources) +nm-keyfile-docs.xml: generate-plugin-docs.pl $(docs_sources) $(srcdir)/generate-plugin-docs.pl keyfile $(srcdir) $@ -nm-ifcfg-rh-docs.xml: generate-plugin-docs.pl $(libnm_util_la_csources) +nm-ifcfg-rh-docs.xml: generate-plugin-docs.pl $(docs_sources) $(srcdir)/generate-plugin-docs.pl ifcfg-rh $(srcdir) $@ -endif +CLEANFILES += $(noinst_DATA) +EXTRA_DIST += $(noinst_DATA) -DISTCLEANFILES += nm-setting-docs.xml nm-keyfile-docs.xml nm-ifcfg-rh-docs.xml +endif EXTRA_DIST += generate-setting-docs.py generate-plugin-docs.pl diff --git a/src/devices/adsl/nm-device-adsl.c b/src/devices/adsl/nm-device-adsl.c index fac6ce0e6f..e664ff4850 100644 --- a/src/devices/adsl/nm-device-adsl.c +++ b/src/devices/adsl/nm-device-adsl.c @@ -76,7 +76,9 @@ typedef struct { static guint32 get_generic_capabilities (NMDevice *dev) { - return (NM_DEVICE_CAP_CARRIER_DETECT | NM_DEVICE_CAP_NONSTANDARD_CARRIER); + return ( NM_DEVICE_CAP_CARRIER_DETECT + | NM_DEVICE_CAP_NONSTANDARD_CARRIER + | NM_DEVICE_CAP_IS_NON_KERNEL); } static gboolean diff --git a/src/devices/bluetooth/nm-device-bt.c b/src/devices/bluetooth/nm-device-bt.c index 0a1f591540..2cf2794da6 100644 --- a/src/devices/bluetooth/nm-device-bt.c +++ b/src/devices/bluetooth/nm-device-bt.c @@ -124,6 +124,12 @@ get_connection_bt_type (NMConnection *connection) return NM_BT_CAPABILITY_NONE; } +static guint32 +get_generic_capabilities (NMDevice *device) +{ + return NM_DEVICE_CAP_IS_NON_KERNEL; +} + static gboolean can_auto_connect (NMDevice *device, NMConnection *connection, @@ -1179,6 +1185,7 @@ nm_device_bt_class_init (NMDeviceBtClass *klass) object_class->dispose = dispose; object_class->finalize = finalize; + device_class->get_generic_capabilities = get_generic_capabilities; device_class->can_auto_connect = can_auto_connect; device_class->deactivate = deactivate; device_class->act_stage2_config = act_stage2_config; diff --git a/src/devices/nm-device-private.h b/src/devices/nm-device-private.h index 16c4d03885..fd87fd77a1 100644 --- a/src/devices/nm-device-private.h +++ b/src/devices/nm-device-private.h @@ -37,8 +37,9 @@ enum NMActStageReturn { }; #define NM_DEVICE_CAP_NONSTANDARD_CARRIER 0x80000000 +#define NM_DEVICE_CAP_IS_NON_KERNEL 0x40000000 -#define NM_DEVICE_CAP_INTERNAL_MASK 0x80000000 +#define NM_DEVICE_CAP_INTERNAL_MASK 0xc0000000 void nm_device_set_ip_iface (NMDevice *self, const char *iface); diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 501f17c339..a5afdfd75b 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -7845,6 +7845,9 @@ constructor (GType type, if (NM_DEVICE_GET_CLASS (self)->get_generic_capabilities) priv->capabilities |= NM_DEVICE_GET_CLASS (self)->get_generic_capabilities (self); + if (priv->ifindex <= 0 && !device_has_capability (self, NM_DEVICE_CAP_IS_NON_KERNEL)) + _LOGW (LOGD_HW, "failed to look up interface index"); + device_get_driver_info (self, priv->iface, &priv->driver_version, &priv->firmware_version); /* Watch for external IP config changes */ @@ -8043,18 +8046,8 @@ set_property (GObject *object, guint prop_id, case PROP_IFACE: if (g_value_get_string (value)) { g_free (priv->iface); - priv->ifindex = 0; priv->iface = g_value_dup_string (value); - - /* Only look up the ifindex if it appears to be an actual kernel - * interface name. eg Bluetooth devices won't have one until we know - * the IP interface. - */ - if (priv->iface && !strchr (priv->iface, ':')) { - priv->ifindex = nm_platform_link_get_ifindex (priv->iface); - if (priv->ifindex <= 0) - _LOGW (LOGD_HW, "failed to look up interface index"); - } + priv->ifindex = nm_platform_link_get_ifindex (priv->iface); } break; case PROP_DRIVER: diff --git a/src/devices/wwan/nm-device-modem.c b/src/devices/wwan/nm-device-modem.c index 3eb570c465..f681e59ca1 100644 --- a/src/devices/wwan/nm-device-modem.c +++ b/src/devices/wwan/nm-device-modem.c @@ -373,6 +373,12 @@ device_state_changed (NMDevice *device, } } +static guint32 +get_generic_capabilities (NMDevice *device) +{ + return NM_DEVICE_CAP_IS_NON_KERNEL; +} + static gboolean check_connection_compatible (NMDevice *device, NMConnection *connection) { @@ -701,6 +707,7 @@ nm_device_modem_class_init (NMDeviceModemClass *mclass) object_class->set_property = set_property; object_class->constructed = constructed; + device_class->get_generic_capabilities = get_generic_capabilities; device_class->check_connection_compatible = check_connection_compatible; device_class->check_connection_available = check_connection_available; device_class->complete_connection = complete_connection; diff --git a/src/tests/config/nm-test-device.c b/src/tests/config/nm-test-device.c index 8f9c431cc2..63067b25f6 100644 --- a/src/tests/config/nm-test-device.c +++ b/src/tests/config/nm-test-device.c @@ -67,10 +67,17 @@ finalize (GObject *object) g_object_class->finalize (object); } +static guint32 +get_generic_capabilities (NMDevice *device) +{ + return NM_DEVICE_CAP_IS_NON_KERNEL; +} + static void nm_test_device_class_init (NMTestDeviceClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); + NMDeviceClass *device_class = NM_DEVICE_CLASS (klass); g_object_class = g_type_class_peek (G_TYPE_OBJECT); @@ -78,13 +85,15 @@ nm_test_device_class_init (NMTestDeviceClass *klass) object_class->constructed = constructed; object_class->dispose = dispose; object_class->finalize = finalize; + + device_class->get_generic_capabilities = get_generic_capabilities; } NMDevice * nm_test_device_new (const char *hwaddr) { return g_object_new (NM_TYPE_TEST_DEVICE, - NM_DEVICE_IFACE, "dummy:", + NM_DEVICE_IFACE, "dummy", NM_DEVICE_HW_ADDRESS, hwaddr, NULL); } diff --git a/src/tests/config/test-config.c b/src/tests/config/test-config.c index fff2d2a092..808fc670b3 100644 --- a/src/tests/config/test-config.c +++ b/src/tests/config/test-config.c @@ -26,6 +26,7 @@ #include <nm-config.h> #include "nm-test-device.h" +#include "nm-fake-platform.h" static void setup_config (const char *config_file, const char *config_dir, ...) @@ -287,6 +288,8 @@ main (int argc, char **argv) g_test_init (&argc, &argv, NULL); + nm_fake_platform_setup (); + g_test_add_func ("/config/simple", test_config_simple); g_test_add_func ("/config/non-existent", test_config_non_existent); g_test_add_func ("/config/parse-error", test_config_parse_error); |