Commit 3acb6a36 authored by Thomas Haller's avatar Thomas Haller

core: merge branch 'th/device-master-slave-bgo759027'

https://bugzilla.gnome.org/show_bug.cgi?id=759027
parents 13d931a8 f45f702a
......@@ -46,13 +46,6 @@ typedef struct {
int dummy;
} NMDeviceBondPrivate;
enum {
PROP_0,
PROP_SLAVES,
LAST_PROP
};
/******************************************************************/
static NMDeviceCapabilities
......@@ -415,7 +408,6 @@ enslave_slave (NMDevice *device,
} else
_LOGI (LOGD_BOND, "bond slave %s was enslaved", slave_iface);
g_object_notify (G_OBJECT (device), NM_DEVICE_BOND_SLAVES);
return TRUE;
}
......@@ -439,20 +431,16 @@ release_slave (NMDevice *device,
_LOGW (LOGD_BOND, "failed to release bond slave %s",
nm_device_get_ip_iface (slave));
}
} else {
_LOGI (LOGD_BOND, "bond slave %s was released",
nm_device_get_ip_iface (slave));
}
g_object_notify (G_OBJECT (device), NM_DEVICE_BOND_SLAVES);
if (configure) {
/* Kernel bonding code "closes" the slave when releasing it, (which clears
* IFF_UP), so we must bring it back up here to ensure carrier changes and
* other state is noticed by the now-released slave.
*/
if (!nm_device_bring_up (slave, TRUE, &no_firmware))
_LOGW (LOGD_BOND, "released bond slave could not be brought up.");
} else {
_LOGI (LOGD_BOND, "bond slave %s was released",
nm_device_get_ip_iface (slave));
}
}
......@@ -488,36 +476,6 @@ nm_device_bond_init (NMDeviceBond * self)
{
}
static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
GSList *list;
switch (prop_id) {
break;
case PROP_SLAVES:
list = nm_device_master_get_slaves (NM_DEVICE (object));
nm_utils_g_value_set_object_path_array (value, list, NULL, NULL);
g_slist_free (list);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
nm_device_bond_class_init (NMDeviceBondClass *klass)
{
......@@ -528,10 +486,6 @@ nm_device_bond_class_init (NMDeviceBondClass *klass)
NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_BOND_SETTING_NAME, NM_LINK_TYPE_BOND)
/* virtual methods */
object_class->get_property = get_property;
object_class->set_property = set_property;
parent_class->get_generic_capabilities = get_generic_capabilities;
parent_class->is_available = is_available;
parent_class->check_connection_compatible = check_connection_compatible;
......@@ -547,14 +501,6 @@ nm_device_bond_class_init (NMDeviceBondClass *klass)
parent_class->enslave_slave = enslave_slave;
parent_class->release_slave = release_slave;
/* properties */
g_object_class_install_property
(object_class, PROP_SLAVES,
g_param_spec_boxed (NM_DEVICE_BOND_SLAVES, "", "",
G_TYPE_STRV,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
NMDBUS_TYPE_DEVICE_BOND_SKELETON,
NULL);
......
......@@ -32,8 +32,6 @@ G_BEGIN_DECLS
#define NM_IS_DEVICE_BOND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_BOND))
#define NM_DEVICE_BOND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_BOND, NMDeviceBondClass))
#define NM_DEVICE_BOND_SLAVES "slaves"
typedef NMDevice NMDeviceBond;
typedef NMDeviceClass NMDeviceBondClass;
......
......@@ -44,13 +44,6 @@ typedef struct {
int dummy;
} NMDeviceBridgePrivate;
enum {
PROP_0,
PROP_SLAVES,
LAST_PROP
};
/******************************************************************/
static NMDeviceCapabilities
......@@ -351,8 +344,6 @@ enslave_slave (NMDevice *device,
nm_device_get_ip_iface (slave));
}
g_object_notify (G_OBJECT (device), NM_DEVICE_BRIDGE_SLAVES);
return TRUE;
}
......@@ -380,8 +371,6 @@ release_slave (NMDevice *device,
_LOGI (LOGD_BRIDGE, "bridge port %s was detached",
nm_device_get_ip_iface (slave));
}
g_object_notify (G_OBJECT (device), NM_DEVICE_BRIDGE_SLAVES);
}
static gboolean
......@@ -436,36 +425,6 @@ nm_device_bridge_init (NMDeviceBridge * self)
{
}
static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
GSList *list;
switch (prop_id) {
break;
case PROP_SLAVES:
list = nm_device_master_get_slaves (NM_DEVICE (object));
nm_utils_g_value_set_object_path_array (value, list, NULL, NULL);
g_slist_free (list);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
nm_device_bridge_class_init (NMDeviceBridgeClass *klass)
{
......@@ -476,10 +435,6 @@ nm_device_bridge_class_init (NMDeviceBridgeClass *klass)
NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_BRIDGE_SETTING_NAME, NM_LINK_TYPE_BRIDGE)
/* virtual methods */
object_class->get_property = get_property;
object_class->set_property = set_property;
parent_class->get_generic_capabilities = get_generic_capabilities;
parent_class->is_available = is_available;
parent_class->check_connection_compatible = check_connection_compatible;
......@@ -494,14 +449,6 @@ nm_device_bridge_class_init (NMDeviceBridgeClass *klass)
parent_class->enslave_slave = enslave_slave;
parent_class->release_slave = release_slave;
/* properties */
g_object_class_install_property
(object_class, PROP_SLAVES,
g_param_spec_boxed (NM_DEVICE_BRIDGE_SLAVES, "", "",
G_TYPE_STRV,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
NMDBUS_TYPE_DEVICE_BRIDGE_SKELETON,
NULL);
......
......@@ -33,8 +33,6 @@ G_BEGIN_DECLS
#define NM_IS_DEVICE_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_BRIDGE))
#define NM_DEVICE_BRIDGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_BRIDGE, NMDeviceBridgeClass))
#define NM_DEVICE_BRIDGE_SLAVES "slaves"
typedef NMDevice NMDeviceBridge;
typedef NMDeviceClass NMDeviceBridgeClass;
......
This diff is collapsed.
......@@ -61,6 +61,11 @@
#define NM_DEVICE_LLDP_NEIGHBORS "lldp-neighbors"
#define NM_DEVICE_REAL "real"
/* the "slaves" property is internal in the parent class, but exposed
* by the derived classes NMDeviceBond, NMDeviceBridge and NMDeviceTeam.
* It is thus important that the property name matches. */
#define NM_DEVICE_SLAVES "slaves" /* partially internal */
#define NM_DEVICE_TYPE_DESC "type-desc" /* Internal only */
#define NM_DEVICE_RFKILL_TYPE "rfkill-type" /* Internal only */
#define NM_DEVICE_IFINDEX "ifindex" /* Internal only */
......@@ -387,7 +392,6 @@ void nm_device_replace_vpn6_config (NMDevice *dev,
void nm_device_capture_initial_config (NMDevice *dev);
/* Master */
GSList * nm_device_master_get_slaves (NMDevice *dev);
gboolean nm_device_is_master (NMDevice *dev);
/* Slave */
......
......@@ -54,13 +54,6 @@ typedef struct {
guint teamd_dbus_watch;
} NMDeviceTeamPrivate;
enum {
PROP_0,
PROP_SLAVES,
LAST_PROP
};
static gboolean teamd_start (NMDevice *device, NMSettingTeam *s_team);
/******************************************************************/
......@@ -644,8 +637,6 @@ enslave_slave (NMDevice *device,
} else
_LOGI (LOGD_TEAM, "team port %s was enslaved", slave_iface);
g_object_notify (G_OBJECT (device), NM_DEVICE_TEAM_SLAVES);
return TRUE;
}
......@@ -666,12 +657,7 @@ release_slave (NMDevice *device,
_LOGI (LOGD_TEAM, "released team port %s", nm_device_get_ip_iface (slave));
else
_LOGW (LOGD_TEAM, "failed to release team port %s", nm_device_get_ip_iface (slave));
} else
_LOGI (LOGD_TEAM, "team port %s was released", nm_device_get_ip_iface (slave));
g_object_notify (G_OBJECT (device), NM_DEVICE_TEAM_SLAVES);
if (configure) {
/* Kernel team code "closes" the port when releasing it, (which clears
* IFF_UP), so we must bring it back up here to ensure carrier changes and
* other state is noticed by the now-released port.
......@@ -679,7 +665,8 @@ release_slave (NMDevice *device,
if (!nm_device_bring_up (slave, TRUE, &no_firmware))
_LOGW (LOGD_TEAM, "released team port %s could not be brought up",
nm_device_get_ip_iface (slave));
}
} else
_LOGI (LOGD_TEAM, "team port %s was released", nm_device_get_ip_iface (slave));
}
static gboolean
......@@ -745,36 +732,6 @@ constructed (GObject *object)
g_free (tmp_str);
}
static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
GSList *list;
switch (prop_id) {
break;
case PROP_SLAVES:
list = nm_device_master_get_slaves (NM_DEVICE (object));
nm_utils_g_value_set_object_path_array (value, list, NULL, NULL);
g_slist_free (list);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
dispose (GObject *object)
{
......@@ -801,10 +758,7 @@ nm_device_team_class_init (NMDeviceTeamClass *klass)
NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_TEAM_SETTING_NAME, NM_LINK_TYPE_TEAM)
/* virtual methods */
object_class->constructed = constructed;
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->dispose = dispose;
parent_class->create_and_realize = create_and_realize;
......@@ -822,15 +776,6 @@ nm_device_team_class_init (NMDeviceTeamClass *klass)
parent_class->enslave_slave = enslave_slave;
parent_class->release_slave = release_slave;
/* properties */
g_object_class_install_property
(object_class, PROP_SLAVES,
g_param_spec_boxed (NM_DEVICE_TEAM_SLAVES, "", "",
G_TYPE_STRV,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
NMDBUS_TYPE_DEVICE_TEAM_SKELETON,
NULL);
......
......@@ -32,8 +32,6 @@ G_BEGIN_DECLS
#define NM_IS_DEVICE_TEAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_TEAM))
#define NM_DEVICE_TEAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_TEAM, NMDeviceTeamClass))
#define NM_DEVICE_TEAM_SLAVES "slaves"
typedef NMDevice NMDeviceTeam;
typedef NMDeviceClass NMDeviceTeamClass;
......
......@@ -2204,7 +2204,7 @@ supplicant_connection_timeout_cb (gpointer user_data)
* dialogs, just retry or fail, and if we never connect the user can
* fix the password somewhere else.
*/
if (nm_settings_connection_get_timestamp (NM_SETTINGS_CONNECTION (connection), &timestamp))
if (nm_settings_connection_get_timestamp (nm_act_request_get_settings_connection (req), &timestamp))
new_secrets = !timestamp;
if (handle_auth_or_fail (self, req, new_secrets) == NM_ACT_STAGE_RETURN_POSTPONE)
......
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