summaryrefslogtreecommitdiff
path: root/src/devices/ovs/nm-device-ovs-bridge.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/ovs/nm-device-ovs-bridge.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/ovs/nm-device-ovs-bridge.c')
-rw-r--r--src/devices/ovs/nm-device-ovs-bridge.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/devices/ovs/nm-device-ovs-bridge.c b/src/devices/ovs/nm-device-ovs-bridge.c
index 67dbb38fa3..e55d48d677 100644
--- a/src/devices/ovs/nm-device-ovs-bridge.c
+++ b/src/devices/ovs/nm-device-ovs-bridge.c
@@ -150,10 +150,11 @@ nm_device_ovs_bridge_class_init (NMDeviceOvsBridgeClass *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_OVS_BRIDGE_SETTING_NAME);
-
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_ovs_bridge);
+ device_class->connection_type_supported = NM_SETTING_OVS_BRIDGE_SETTING_NAME;
+ device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES ();
+
device_class->is_master = TRUE;
device_class->get_type_description = get_type_description;
device_class->create_and_realize = create_and_realize;