diff options
author | Thomas Haller <thaller@redhat.com> | 2014-10-22 14:40:12 +0200 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-12-11 09:38:44 -0600 |
commit | e5745c5d60e05171f2ac799b9eebe27182052ff7 (patch) | |
tree | 853cfab719560c6612f765bcbe447509ad1aca24 | |
parent | 278da3aa0f03328977ebc277d75db173621684fa (diff) | |
download | NetworkManager-e5745c5d60e05171f2ac799b9eebe27182052ff7.tar.gz |
fixup! core: move virtual interface name handling into device plugins
Saves 16 copies of these static arrays.
-rw-r--r-- | src/devices/nm-device-factory.c | 3 | ||||
-rw-r--r-- | src/devices/nm-device-factory.h | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/devices/nm-device-factory.c b/src/devices/nm-device-factory.c index 09819bd877..b86d42089e 100644 --- a/src/devices/nm-device-factory.c +++ b/src/devices/nm-device-factory.c @@ -29,6 +29,9 @@ #include "nm-device-factory.h" #include "nm-logging.h" +const NMLinkType _nm_device_factory_no_default_links[] = { NM_LINK_TYPE_NONE }; +const char *_nm_device_factory_no_default_settings[] = { NULL }; + enum { DEVICE_ADDED, COMPONENT_ADDED, diff --git a/src/devices/nm-device-factory.h b/src/devices/nm-device-factory.h index 3d18eab622..52504439a2 100644 --- a/src/devices/nm-device-factory.h +++ b/src/devices/nm-device-factory.h @@ -215,17 +215,17 @@ gboolean nm_device_factory_emit_component_added (NMDeviceFactory *factory, #define NM_DEVICE_FACTORY_DECLARE_SETTING_TYPES(...) \ { static const char *_df_settings[] = { __VA_ARGS__, NULL }; *out_setting_types = _df_settings; } +extern const NMLinkType _nm_device_factory_no_default_links[]; +extern const char *_nm_device_factory_no_default_settings[]; + #define NM_DEVICE_FACTORY_DECLARE_TYPES(...) \ static void \ get_supported_types (NMDeviceFactory *factory, \ const NMLinkType **out_link_types, \ const char ***out_setting_types) \ { \ - static const NMLinkType default_links[] = { NM_LINK_TYPE_NONE }; \ - static const char *default_settings[] = { NULL }; \ - \ - *out_link_types = default_links; \ - *out_setting_types = default_settings; \ + *out_link_types = _nm_device_factory_no_default_links; \ + *out_setting_types = _nm_device_factory_no_default_settings; \ \ { __VA_ARGS__; } \ } \ |