summaryrefslogtreecommitdiff
path: root/src/devices/nm-device-macvlan.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-07-10 09:26:42 +0200
committerThomas Haller <thaller@redhat.com>2018-07-24 09:39:09 +0200
commit2ce416796772205e006c0a66188e0379465f0bfa (patch)
tree25c201e8cfadcfd6878df5b2dcfff7939862b2a4 /src/devices/nm-device-macvlan.c
parentc9883b85a246502f1a9cb4704b51707635c4d7b8 (diff)
downloadNetworkManager-2ce416796772205e006c0a66188e0379465f0bfa.tar.gz
device: replace NM_DEVICE_CLASS_DECLARE_TYPES() macro by explicit initialization
It seems to me the NM_DEVICE_CLASS_DECLARE_TYPES() macro confuses more than helping. Let's explicitly initialize the two fields, albeit with another helper macro NM_DEVICE_DEFINE_LINK_TYPES() to get the list of link-types right. For consistency, also leave nop-lines like device_class->connection_type_supported = NULL; device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES (); because all NMDevice class init methods should have this same boiler plate code and to make it explicit that this is intended. And there are only 3 occurences where this actually comes into play.
Diffstat (limited to 'src/devices/nm-device-macvlan.c')
-rw-r--r--src/devices/nm-device-macvlan.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/devices/nm-device-macvlan.c b/src/devices/nm-device-macvlan.c
index 51ac225ef4..a0e9e06acc 100644
--- a/src/devices/nm-device-macvlan.c
+++ b/src/devices/nm-device-macvlan.c
@@ -495,13 +495,14 @@ nm_device_macvlan_class_init (NMDeviceMacvlanClass *klass)
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
- NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_MACVLAN_SETTING_NAME, NM_LINK_TYPE_MACVLAN, NM_LINK_TYPE_MACVTAP);
-
object_class->get_property = get_property;
object_class->set_property = set_property;
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_macvlan);
+ device_class->connection_type_supported = NM_SETTING_MACVLAN_SETTING_NAME;
+ device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES (NM_LINK_TYPE_MACVLAN, NM_LINK_TYPE_MACVTAP);
+
device_class->act_stage1_prepare = act_stage1_prepare;
device_class->check_connection_compatible = check_connection_compatible;
device_class->complete_connection = complete_connection;