Commit 6217c1e7 authored by Dan Winship's avatar Dan Winship

libnm-core: drop :interface-name properties on virtual NMSetting types

Remove the virtual :interface-name properties and their getters, and
use property overrides to do backward-compat handling when
serializing/deserializing.

Now when constructing an NMConnection from a hash, if the virtual
property is set and the NMSettingConnection property isn't, then the
override for NMSettingConnection:interface-name will set that property
to the value of the virtual interface-name. And when converting an
NMConnection to a hash, the overrides for the virtual properties will
return the value of NMSettingConnection:interface-name.
parent 40bb4028
......@@ -510,58 +510,6 @@ nm_connection_diff (NMConnection *a,
return *out_settings ? FALSE : TRUE;
}
static gboolean
_normalize_virtual_iface_name (NMConnection *self)
{
NMConnectionPrivate *priv = NM_CONNECTION_GET_PRIVATE (self);
GHashTableIter h_iter;
NMSetting *setting;
NMSettingConnection *s_con;
const char *interface_name;
char *virtual_iface_name = NULL;
gboolean was_modified = FALSE;
const char *prop_name = NULL;
/* search for settings that might need normalization of the interface name. */
g_hash_table_iter_init (&h_iter, priv->settings);
while ( !prop_name
&& g_hash_table_iter_next (&h_iter, NULL, (void **) &setting)) {
if (NM_IS_SETTING_BOND (setting))
prop_name = NM_SETTING_BOND_INTERFACE_NAME;
else if (NM_IS_SETTING_BRIDGE (setting))
prop_name = NM_SETTING_BRIDGE_INTERFACE_NAME;
else if (NM_IS_SETTING_TEAM (setting))
prop_name = NM_SETTING_TEAM_INTERFACE_NAME;
else if (NM_IS_SETTING_VLAN (setting))
prop_name = NM_SETTING_VLAN_INTERFACE_NAME;
}
if (!prop_name)
return FALSE;
s_con = nm_connection_get_setting_connection (self);
g_return_val_if_fail (s_con, FALSE);
interface_name = nm_setting_connection_get_interface_name (s_con);
/* read the potential virtual_iface_name from the setting. */
g_object_get (setting, prop_name, &virtual_iface_name, NULL);
if (g_strcmp0 (interface_name, virtual_iface_name) != 0) {
if (interface_name) {
/* interface_name is set and overwrites the virtual_iface_name. */
g_object_set (setting, prop_name, interface_name, NULL);
} else {
/* interface in NMSettingConnection must be set. */
g_object_set (s_con, NM_SETTING_CONNECTION_INTERFACE_NAME, virtual_iface_name, NULL);
}
was_modified = TRUE;
}
g_free (virtual_iface_name);
return was_modified;
}
static gboolean
_normalize_connection_type (NMConnection *self)
{
......@@ -924,7 +872,6 @@ nm_connection_normalize (NMConnection *connection,
* errors, because in that case we rather fail without touching the settings. */
was_modified |= _normalize_connection_type (connection);
was_modified |= _normalize_virtual_iface_name (connection);
was_modified |= _normalize_connection_slave_type (connection);
was_modified |= _normalize_ip_config (connection, parameters);
was_modified |= _normalize_infiniband_mtu (connection, parameters);
......
......@@ -67,13 +67,11 @@ NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_BOND)
#define NM_SETTING_BOND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BOND, NMSettingBondPrivate))
typedef struct {
char *interface_name;
GHashTable *options;
} NMSettingBondPrivate;
enum {
PROP_0,
PROP_INTERFACE_NAME,
PROP_OPTIONS,
LAST_PROP
};
......@@ -131,20 +129,6 @@ nm_setting_bond_new (void)
return (NMSetting *) g_object_new (NM_TYPE_SETTING_BOND, NULL);
}
/**
* nm_setting_bond_get_interface_name:
* @setting: the #NMSettingBond
*
* Returns: the #NMSettingBond:interface-name property of the setting
**/
const char *
nm_setting_bond_get_interface_name (NMSettingBond *setting)
{
g_return_val_if_fail (NM_IS_SETTING_BOND (setting), NULL);
return NM_SETTING_BOND_GET_PRIVATE (setting)->interface_name;
}
/**
* nm_setting_bond_get_num_options:
* @setting: the #NMSettingBond
......@@ -662,13 +646,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
}
}
return _nm_setting_verify_deprecated_virtual_iface_name (
priv->interface_name, FALSE,
NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_INTERFACE_NAME,
NM_SETTING_BOND_ERROR,
NM_SETTING_BOND_ERROR_INVALID_PROPERTY,
NM_SETTING_BOND_ERROR_MISSING_PROPERTY,
all_settings, error);
return _nm_setting_verify_required_virtual_interface_name (all_settings, error);
}
static void
......@@ -687,7 +665,6 @@ finalize (GObject *object)
{
NMSettingBondPrivate *priv = NM_SETTING_BOND_GET_PRIVATE (object);
g_free (priv->interface_name);
g_hash_table_destroy (priv->options);
G_OBJECT_CLASS (nm_setting_bond_parent_class)->finalize (object);
......@@ -707,10 +684,6 @@ set_property (GObject *object, guint prop_id,
GHashTable *new_hash;
switch (prop_id) {
case PROP_INTERFACE_NAME:
g_free (priv->interface_name);
priv->interface_name = g_value_dup_string (value);
break;
case PROP_OPTIONS:
/* Must make a deep copy of the hash table here... */
g_hash_table_remove_all (priv->options);
......@@ -729,12 +702,8 @@ get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
NMSettingBondPrivate *priv = NM_SETTING_BOND_GET_PRIVATE (object);
NMSettingBond *setting = NM_SETTING_BOND (object);
switch (prop_id) {
case PROP_INTERFACE_NAME:
g_value_set_string (value, nm_setting_bond_get_interface_name (setting));
break;
case PROP_OPTIONS:
g_value_set_boxed (value, priv->options);
break;
......@@ -759,19 +728,6 @@ nm_setting_bond_class_init (NMSettingBondClass *setting_class)
parent_class->verify = verify;
/* Properties */
/**
* NMSettingBond:interface-name:
*
* The name of the virtual in-kernel bonding network interface
**/
g_object_class_install_property
(object_class, PROP_INTERFACE_NAME,
g_param_spec_string (NM_SETTING_BOND_INTERFACE_NAME, "", "",
NULL,
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
/**
* NMSettingBond:options:
*
......@@ -786,4 +742,8 @@ nm_setting_bond_class_init (NMSettingBondClass *setting_class)
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
_nm_setting_class_add_dbus_only_property (parent_class, "interface-name", G_TYPE_STRING,
_nm_setting_get_deprecated_virtual_interface_name,
_nm_setting_set_deprecated_virtual_interface_name);
}
......@@ -57,7 +57,6 @@ typedef enum {
#define NM_SETTING_BOND_ERROR nm_setting_bond_error_quark ()
GQuark nm_setting_bond_error_quark (void);
#define NM_SETTING_BOND_INTERFACE_NAME "interface-name"
#define NM_SETTING_BOND_OPTIONS "options"
/* Valid options for the 'options' property */
......@@ -90,7 +89,6 @@ typedef struct {
GType nm_setting_bond_get_type (void);
NMSetting * nm_setting_bond_new (void);
const char * nm_setting_bond_get_interface_name (NMSettingBond *setting);
guint32 nm_setting_bond_get_num_options (NMSettingBond *setting);
gboolean nm_setting_bond_get_option (NMSettingBond *setting,
guint32 idx,
......
......@@ -65,7 +65,6 @@ NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_BRIDGE)
#define NM_SETTING_BRIDGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_BRIDGE, NMSettingBridgePrivate))
typedef struct {
char * interface_name;
GByteArray *mac_address;
gboolean stp;
guint16 priority;
......@@ -77,7 +76,6 @@ typedef struct {
enum {
PROP_0,
PROP_INTERFACE_NAME,
PROP_MAC_ADDRESS,
PROP_STP,
PROP_PRIORITY,
......@@ -101,20 +99,6 @@ nm_setting_bridge_new (void)
return (NMSetting *) g_object_new (NM_TYPE_SETTING_BRIDGE, NULL);
}
/**
* nm_setting_bridge_get_interface_name:
* @setting: the #NMSettingBridge
*
* Returns: the #NMSettingBridge:interface-name property of the setting
**/
const char *
nm_setting_bridge_get_interface_name (NMSettingBridge *setting)
{
g_return_val_if_fail (NM_IS_SETTING_BRIDGE (setting), 0);
return NM_SETTING_BRIDGE_GET_PRIVATE (setting)->interface_name;
}
/**
* nm_setting_bridge_get_mac_address:
* @setting: the #NMSettingBridge
......@@ -288,13 +272,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
error))
return FALSE;
return _nm_setting_verify_deprecated_virtual_iface_name (
priv->interface_name, FALSE,
NM_SETTING_BRIDGE_SETTING_NAME, NM_SETTING_BRIDGE_INTERFACE_NAME,
NM_SETTING_BRIDGE_ERROR,
NM_SETTING_BRIDGE_ERROR_INVALID_PROPERTY,
NM_SETTING_BRIDGE_ERROR_MISSING_PROPERTY,
all_settings, error);
return _nm_setting_verify_required_virtual_interface_name (all_settings, error);
}
static void
......@@ -307,8 +285,6 @@ finalize (GObject *object)
{
NMSettingBridgePrivate *priv = NM_SETTING_BRIDGE_GET_PRIVATE (object);
g_free (priv->interface_name);
if (priv->mac_address)
g_byte_array_free (priv->mac_address, TRUE);
......@@ -322,10 +298,6 @@ set_property (GObject *object, guint prop_id,
NMSettingBridgePrivate *priv = NM_SETTING_BRIDGE_GET_PRIVATE (object);
switch (prop_id) {
case PROP_INTERFACE_NAME:
g_free (priv->interface_name);
priv->interface_name = g_value_dup_string (value);
break;
case PROP_MAC_ADDRESS:
if (priv->mac_address)
g_byte_array_free (priv->mac_address, TRUE);
......@@ -363,9 +335,6 @@ get_property (GObject *object, guint prop_id,
NMSettingBridge *setting = NM_SETTING_BRIDGE (object);
switch (prop_id) {
case PROP_INTERFACE_NAME:
g_value_set_string (value, nm_setting_bridge_get_interface_name (setting));
break;
case PROP_MAC_ADDRESS:
g_value_set_boxed (value, nm_setting_bridge_get_mac_address (setting));
break;
......@@ -408,19 +377,6 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
parent_class->verify = verify;
/* Properties */
/**
* NMSettingBridge:interface-name:
*
* The name of the virtual in-kernel bridging network interface
**/
g_object_class_install_property
(object_class, PROP_INTERFACE_NAME,
g_param_spec_string (NM_SETTING_BRIDGE_INTERFACE_NAME, "", "",
NULL,
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
/**
* NMSettingBridge:mac-address:
*
......@@ -521,4 +477,8 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class)
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
_nm_setting_class_add_dbus_only_property (parent_class, "interface-name", G_TYPE_STRING,
_nm_setting_get_deprecated_virtual_interface_name,
_nm_setting_set_deprecated_virtual_interface_name);
}
......@@ -55,7 +55,6 @@ typedef enum {
#define NM_SETTING_BRIDGE_ERROR nm_setting_bridge_error_quark ()
GQuark nm_setting_bridge_error_quark (void);
#define NM_SETTING_BRIDGE_INTERFACE_NAME "interface-name"
#define NM_SETTING_BRIDGE_MAC_ADDRESS "mac-address"
#define NM_SETTING_BRIDGE_STP "stp"
#define NM_SETTING_BRIDGE_PRIORITY "priority"
......@@ -79,8 +78,6 @@ GType nm_setting_bridge_get_type (void);
NMSetting * nm_setting_bridge_new (void);
const char * nm_setting_bridge_get_interface_name (NMSettingBridge *setting);
const GByteArray *nm_setting_bridge_get_mac_address (NMSettingBridge *setting);
gboolean nm_setting_bridge_get_stp (NMSettingBridge *setting);
......
......@@ -949,6 +949,52 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return TRUE;
}
static gboolean
nm_setting_connection_no_interface_name (NMSetting *setting,
GHashTable *connection_hash,
const char *property,
GError **error)
{
GHashTable *setting_hash;
const char *interface_name;
GValue *value;
/* Check if there's a deprecated virtual interface-name property to steal */
setting_hash = g_hash_table_lookup (connection_hash, NM_SETTING_BOND_SETTING_NAME);
if (!setting_hash)
setting_hash = g_hash_table_lookup (connection_hash, NM_SETTING_BRIDGE_SETTING_NAME);
if (!setting_hash)
setting_hash = g_hash_table_lookup (connection_hash, NM_SETTING_TEAM_SETTING_NAME);
if (!setting_hash)
setting_hash = g_hash_table_lookup (connection_hash, NM_SETTING_VLAN_SETTING_NAME);
if (!setting_hash)
return TRUE;
/* All of the deprecated virtual interface name properties were named "interface-name". */
value = g_hash_table_lookup (setting_hash, "interface-name");
if (!value)
return TRUE;
interface_name = g_value_get_string (value);
if (!interface_name)
return TRUE;
if (!nm_utils_iface_valid_name (interface_name)) {
g_set_error_literal (error,
NM_SETTING_CONNECTION_ERROR,
NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY,
_("property is invalid"));
g_prefix_error (error, "%s.%s: ", NM_SETTING_CONNECTION_SETTING_NAME, NM_SETTING_CONNECTION_INTERFACE_NAME);
return FALSE;
}
g_object_set (G_OBJECT (setting),
NM_SETTING_CONNECTION_INTERFACE_NAME, interface_name,
NULL);
return TRUE;
}
static gboolean
compare_property (NMSetting *setting,
NMSetting *other,
......@@ -1204,6 +1250,10 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
_nm_setting_class_override_property (parent_class, NM_SETTING_CONNECTION_INTERFACE_NAME,
G_TYPE_STRING,
NULL, NULL,
nm_setting_connection_no_interface_name);
/**
* NMSettingConnection:type:
......
......@@ -101,15 +101,18 @@ NMSetting * _nm_setting_find_in_list_required (GSList *all_settings,
const char *error_prefix_setting_name,
const char *error_prefix_property_name);
NMSettingVerifyResult _nm_setting_verify_deprecated_virtual_iface_name (const char *interface_name,
gboolean allow_missing,
const char *setting_name,
const char *setting_property,
GQuark error_quark,
gint e_invalid_property,
gint e_missing_property,
GSList *all_settings,
GError **error);
NMSettingVerifyResult _nm_setting_verify_required_virtual_interface_name (GSList *all_settings,
GError **error);
gboolean _nm_setting_get_deprecated_virtual_interface_name (NMSetting *setting,
NMConnection *connection,
const char *property,
GValue *value);
gboolean _nm_setting_set_deprecated_virtual_interface_name (NMSetting *setting,
GHashTable *connection_hash,
const char *property,
const GValue *value,
GError **error);
NMSettingVerifyResult _nm_setting_verify (NMSetting *setting,
GSList *all_settings,
......
......@@ -63,13 +63,11 @@ NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_TEAM)
#define NM_SETTING_TEAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_TEAM, NMSettingTeamPrivate))
typedef struct {
char *interface_name;
char *config;
} NMSettingTeamPrivate;
enum {
PROP_0,
PROP_INTERFACE_NAME,
PROP_CONFIG,
LAST_PROP
};
......@@ -87,20 +85,6 @@ nm_setting_team_new (void)
return (NMSetting *) g_object_new (NM_TYPE_SETTING_TEAM, NULL);
}
/**
* nm_setting_team_get_interface_name:
* @setting: the #NMSettingTeam
*
* Returns: the #NMSettingTeam:interface-name property of the setting
**/
const char *
nm_setting_team_get_interface_name (NMSettingTeam *setting)
{
g_return_val_if_fail (NM_IS_SETTING_TEAM (setting), NULL);
return NM_SETTING_TEAM_GET_PRIVATE (setting)->interface_name;
}
/**
* nm_setting_team_get_config:
* @setting: the #NMSettingTeam
......@@ -118,15 +102,7 @@ nm_setting_team_get_config (NMSettingTeam *setting)
static gboolean
verify (NMSetting *setting, GSList *all_settings, GError **error)
{
NMSettingTeamPrivate *priv = NM_SETTING_TEAM_GET_PRIVATE (setting);
return _nm_setting_verify_deprecated_virtual_iface_name (
priv->interface_name, FALSE,
NM_SETTING_TEAM_SETTING_NAME, NM_SETTING_TEAM_INTERFACE_NAME,
NM_SETTING_TEAM_ERROR,
NM_SETTING_TEAM_ERROR_INVALID_PROPERTY,
NM_SETTING_TEAM_ERROR_MISSING_PROPERTY,
all_settings, error);
return _nm_setting_verify_required_virtual_interface_name (all_settings, error);
}
static void
......@@ -139,7 +115,6 @@ finalize (GObject *object)
{
NMSettingTeamPrivate *priv = NM_SETTING_TEAM_GET_PRIVATE (object);
g_free (priv->interface_name);
g_free (priv->config);
G_OBJECT_CLASS (nm_setting_team_parent_class)->finalize (object);
......@@ -152,10 +127,6 @@ set_property (GObject *object, guint prop_id,
NMSettingTeamPrivate *priv = NM_SETTING_TEAM_GET_PRIVATE (object);
switch (prop_id) {
case PROP_INTERFACE_NAME:
g_free (priv->interface_name);
priv->interface_name = g_value_dup_string (value);
break;
case PROP_CONFIG:
g_free (priv->config);
priv->config = g_value_dup_string (value);
......@@ -173,9 +144,6 @@ get_property (GObject *object, guint prop_id,
NMSettingTeam *setting = NM_SETTING_TEAM (object);
switch (prop_id) {
case PROP_INTERFACE_NAME:
g_value_set_string (value, nm_setting_team_get_interface_name (setting));
break;
case PROP_CONFIG:
g_value_set_string (value, nm_setting_team_get_config (setting));
break;
......@@ -200,19 +168,6 @@ nm_setting_team_class_init (NMSettingTeamClass *setting_class)
parent_class->verify = verify;
/* Properties */
/**
* NMSettingTeam:interface-name:
*
* The name of the virtual in-kernel team network interface
**/
g_object_class_install_property
(object_class, PROP_INTERFACE_NAME,
g_param_spec_string (NM_SETTING_TEAM_INTERFACE_NAME, "", "",
NULL,
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
/**
* NMSettingTeam:config:
*
......@@ -228,4 +183,8 @@ nm_setting_team_class_init (NMSettingTeamClass *setting_class)
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
_nm_setting_class_add_dbus_only_property (parent_class, "interface-name", G_TYPE_STRING,
_nm_setting_get_deprecated_virtual_interface_name,
_nm_setting_set_deprecated_virtual_interface_name);
}
......@@ -54,7 +54,6 @@ typedef enum {
#define NM_SETTING_TEAM_ERROR nm_setting_team_error_quark ()
GQuark nm_setting_team_error_quark (void);
#define NM_SETTING_TEAM_INTERFACE_NAME "interface-name"
#define NM_SETTING_TEAM_CONFIG "config"
typedef struct {
......@@ -72,7 +71,6 @@ GType nm_setting_team_get_type (void);
NMSetting * nm_setting_team_new (void);
const char * nm_setting_team_get_interface_name (NMSettingTeam *setting);
const char * nm_setting_team_get_config (NMSettingTeam *setting);
G_END_DECLS
......
......@@ -63,7 +63,6 @@ NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_VLAN)
#define NM_SETTING_VLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_VLAN, NMSettingVlanPrivate))
typedef struct {
char *interface_name;
char *parent;
guint32 id;
guint32 flags;
......@@ -73,7 +72,6 @@ typedef struct {
enum {
PROP_0,
PROP_INTERFACE_NAME,
PROP_PARENT,
PROP_ID,
PROP_FLAGS,
......@@ -103,19 +101,6 @@ nm_setting_vlan_new (void)
return (NMSetting *) g_object_new (NM_TYPE_SETTING_VLAN, NULL);
}
/**
* nm_setting_vlan_get_interface_name:
* @setting: the #NMSettingVlan
*
* Returns: the #NMSettingVlan:interface_name property of the setting
**/
const char *
nm_setting_vlan_get_interface_name (NMSettingVlan *setting)
{
g_return_val_if_fail (NM_IS_SETTING_VLAN (setting), NULL);
return NM_SETTING_VLAN_GET_PRIVATE (setting)->interface_name;
}
/**
* nm_setting_vlan_get_parent:
* @setting: the #NMSettingVlan
......@@ -586,17 +571,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return FALSE;
}
/* If interface_name is specified, it must be a valid interface name. We
* don't check that it matches parent and/or id, because we allow
* renaming vlans to arbitrary names.
*/
return _nm_setting_verify_deprecated_virtual_iface_name (
priv->interface_name, TRUE,
NM_SETTING_VLAN_SETTING_NAME, NM_SETTING_VLAN_INTERFACE_NAME,
NM_SETTING_VLAN_ERROR,
NM_SETTING_VLAN_ERROR_INVALID_PROPERTY,
NM_SETTING_VLAN_ERROR_MISSING_PROPERTY,
all_settings, error);
return TRUE;
}
static GSList *
......@@ -622,10 +597,6 @@ set_property (GObject *object, guint prop_id,
NMSettingVlanPrivate *priv = NM_SETTING_VLAN_GET_PRIVATE (setting);
switch (prop_id) {
case PROP_INTERFACE_NAME:
g_free (priv->interface_name);
priv->interface_name = g_value_dup_string (value);
break;
case PROP_PARENT:
g_free (priv->parent);
priv->parent = g_value_dup_string (value);
......@@ -673,9 +644,6 @@ get_property (GObject *object, guint prop_id,
NMSettingVlanPrivate *priv = NM_SETTING_VLAN_GET_PRIVATE (setting);
switch (prop_id) {
case PROP_INTERFACE_NAME:
g_value_set_string (value, priv->interface_name);
break;
case PROP_PARENT:
g_value_set_string (value, priv->parent);
break;
......@@ -703,7 +671,6 @@ finalize (GObject *object)
NMSettingVlan *setting = NM_SETTING_VLAN (object);
NMSettingVlanPrivate *priv = NM_SETTING_VLAN_GET_PRIVATE (setting);
g_free (priv->interface_name);
g_free (priv->parent);
g_slist_free_full (priv->ingress_priority_map, g_free);
g_slist_free_full (priv->egress_priority_map, g_free);
......@@ -727,24 +694,6 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
/* Properties */
/**
* NMSettingVlan:interface-name:
*
* If given, specifies the kernel name of the VLAN interface. If not given,
* a default name will be constructed from the interface described by the
* parent interface and the #NMSettingVlan:id property, eg "eth2.1". The
* parent interface may be given by the #NMSettingVlan:parent property or by
* the #NMSettingWired:mac-address property of an #NMSettingWired setting.
**/
g_object_class_install_property
(object_class, PROP_INTERFACE_NAME,
g_param_spec_string (NM_SETTING_VLAN_INTERFACE_NAME, "", "",
NULL,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
/**
* NMSettingVlan:parent:
*
......@@ -824,4 +773,8 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class)
G_PARAM_READWRITE |
NM_SETTING_PARAM_INFERRABLE |
G_PARAM_STATIC_STRINGS));
_nm_setting_class_add_dbus_only_property (parent_class, "interface-name", G_TYPE_STRING,
_nm_setting_get_deprecated_virtual_interface_name,
_nm_setting_set_deprecated_virtual_interface_name);
}
......@@ -59,7 +59,6 @@ typedef enum {
#define NM_SETTING_VLAN_ERROR nm_setting_vlan_error_quark ()
GQuark nm_setting_vlan_error_quark (void);
#define NM_SETTING_VLAN_INTERFACE_NAME "interface-name"
#define NM_SETTING_VLAN_PARENT "parent"
#define NM_SETTING_VLAN_ID "id"