Commit 264624f9 authored by Beniamino Galvani's avatar Beniamino Galvani

device: re-apply sriov_numvfs after SIGHUP

parent 32975b6a
......@@ -296,7 +296,7 @@ typedef struct _NMDevicePrivate {
guint link_disconnected_id;
guint carrier_defer_id;
guint carrier_wait_id;
gulong ignore_carrier_id;
gulong config_changed_id;
guint32 mtu;
guint32 ip6_mtu;
guint32 mtu_initial;
......@@ -2836,17 +2836,20 @@ device_init_sriov_num_vfs (NMDevice *self)
}
static void
config_changed_update_ignore_carrier (NMConfig *config,
NMConfigData *config_data,
NMConfigChangeFlags changes,
NMConfigData *old_data,
NMDevice *self)
config_changed (NMConfig *config,
NMConfigData *config_data,
NMConfigChangeFlags changes,
NMConfigData *old_data,
NMDevice *self)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
if ( priv->state <= NM_DEVICE_STATE_DISCONNECTED
|| priv->state > NM_DEVICE_STATE_ACTIVATED)
priv->ignore_carrier = nm_config_data_get_ignore_carrier (config_data, self);
if (NM_FLAGS_HAS (changes, NM_CONFIG_CHANGE_VALUES))
device_init_sriov_num_vfs (self);
}
static void
......@@ -2981,10 +2984,10 @@ realize_start_setup (NMDevice *self,
/* Note: initial hardware address must be read before calling get_ignore_carrier() */
config = nm_config_get ();
priv->ignore_carrier = nm_config_data_get_ignore_carrier (nm_config_get_data (config), self);
if (!priv->ignore_carrier_id) {
priv->ignore_carrier_id = g_signal_connect (config,
if (!priv->config_changed_id) {
priv->config_changed_id = g_signal_connect (config,
NM_CONFIG_SIGNAL_CONFIG_CHANGED,
G_CALLBACK (config_changed_update_ignore_carrier),
G_CALLBACK (config_changed),
self);
}
......@@ -3202,7 +3205,7 @@ nm_device_unrealize (NMDevice *self, gboolean remove_resources, GError **error)
priv->capabilities |= NM_DEVICE_GET_CLASS (self)->get_generic_capabilities (self);
_notify (self, PROP_CAPABILITIES);
nm_clear_g_signal_handler (nm_config_get (), &priv->ignore_carrier_id);
nm_clear_g_signal_handler (nm_config_get (), &priv->config_changed_id);
priv->real = FALSE;
_notify (self, PROP_REAL);
......@@ -13727,7 +13730,7 @@ dispose (GObject *object)
arp_cleanup (self);
nm_clear_g_signal_handler (nm_config_get (), &priv->ignore_carrier_id);
nm_clear_g_signal_handler (nm_config_get (), &priv->config_changed_id);
dispatcher_cleanup (self);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment