diff options
author | Thomas Haller <thaller@redhat.com> | 2017-01-02 16:06:51 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-01-04 14:18:01 +0100 |
commit | 0bb84d1b854a8e370d433d37cdb3d708ed477d03 (patch) | |
tree | 3798e28d35483eb923c2c7e307c02df8393394fb | |
parent | 7e4120860f98fce5f30a8ae439ba1c4b74c4a886 (diff) | |
download | NetworkManager-0bb84d1b854a8e370d433d37cdb3d708ed477d03.tar.gz |
device/ethernet: refactor loading s390 subchannels during realize
Instead of overwriting constructed(), update the s390 subchannels via
realize_start_notify(). This makes more sense and is also more similar
to what other device implementations do.
-rw-r--r-- | src/devices/nm-device-ethernet.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c index da366c93f6..7e84b49025 100644 --- a/src/devices/nm-device-ethernet.c +++ b/src/devices/nm-device-ethernet.c @@ -260,18 +260,6 @@ _update_s390_subchannels (NMDeviceEthernet *self) } static void -constructed (GObject *object) -{ - const NMPlatformLink *pllink; - - G_OBJECT_CLASS (nm_device_ethernet_parent_class)->constructed (object); - - pllink = nm_platform_link_get (NM_PLATFORM_GET, nm_device_get_ifindex ((NMDevice *) object)); - if (pllink && pllink->initialized) - _update_s390_subchannels ((NMDeviceEthernet *) object); -} - -static void clear_secrets_tries (NMDevice *device) { NMActRequest *req; @@ -1679,13 +1667,23 @@ carrier_changed (NMDevice *device, gboolean carrier) } static void -link_changed (NMDevice *device, const NMPlatformLink *pllink) +link_changed (NMDevice *device, + const NMPlatformLink *pllink) { NM_DEVICE_CLASS (nm_device_ethernet_parent_class)->link_changed (device, pllink); if (pllink->initialized) _update_s390_subchannels ((NMDeviceEthernet *) device); } +static void +realize_start_notify (NMDevice *device, + const NMPlatformLink *pllink) +{ + NM_DEVICE_CLASS (nm_device_ethernet_parent_class)->realize_start_notify (device, pllink); + if (pllink->initialized) + _update_s390_subchannels ((NMDeviceEthernet *) device); +} + static gboolean is_available (NMDevice *device, NMDeviceCheckDevAvailableFlags flags) { @@ -1772,7 +1770,6 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass) NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_WIRED_SETTING_NAME, NM_LINK_TYPE_ETHERNET) - object_class->constructed = constructed; object_class->dispose = dispose; object_class->finalize = finalize; object_class->get_property = get_property; @@ -1792,6 +1789,7 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass) parent_class->update_connection = update_connection; parent_class->carrier_changed = carrier_changed; parent_class->link_changed = link_changed; + parent_class->realize_start_notify = realize_start_notify; parent_class->is_available = is_available; parent_class->state_changed = device_state_changed; |