summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-10-10 15:09:30 -0500
committerDan Williams <dcbw@redhat.com>2014-12-11 10:07:41 -0600
commit594a58120ad9bf91c054270d38ed63f5d883948c (patch)
treeca55de23b82fd71af47f2a6c83dd428732034d5e
parentd9f2baea553033bc9204107fd5d1d9c1330c16fa (diff)
downloadNetworkManager-594a58120ad9bf91c054270d38ed63f5d883948c.tar.gz
fixup! libnm-glib/libnm: add support for Realized device property
-rw-r--r--libnm-glib/libnm-glib.ver2
-rw-r--r--libnm-glib/nm-device.c59
-rw-r--r--libnm-glib/nm-device.h5
-rw-r--r--libnm/libnm.ver2
-rw-r--r--libnm/nm-device.c55
-rw-r--r--libnm/nm-device.h4
6 files changed, 64 insertions, 63 deletions
diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver
index 9a18bb0256..32120d3437 100644
--- a/libnm-glib/libnm-glib.ver
+++ b/libnm-glib/libnm-glib.ver
@@ -144,7 +144,6 @@ global:
nm_device_get_mtu;
nm_device_get_physical_port_id;
nm_device_get_product;
- nm_device_get_realized;
nm_device_get_setting_type;
nm_device_get_state;
nm_device_get_state_reason;
@@ -158,6 +157,7 @@ global:
nm_device_infiniband_get_hw_address;
nm_device_infiniband_get_type;
nm_device_infiniband_new;
+ nm_device_is_real;
nm_device_is_software;
nm_device_modem_error_get_type;
nm_device_modem_error_quark;
diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c
index 232445d120..5519c74419 100644
--- a/libnm-glib/nm-device.c
+++ b/libnm-glib/nm-device.c
@@ -80,7 +80,7 @@ typedef struct {
char *firmware_version;
char *type_description;
NMDeviceCapabilities capabilities;
- gboolean realized;
+ gboolean real;
gboolean managed;
gboolean firmware_missing;
gboolean autoconnect;
@@ -112,7 +112,7 @@ enum {
PROP_DRIVER_VERSION,
PROP_FIRMWARE_VERSION,
PROP_CAPABILITIES,
- PROP_REALIZED,
+ PROP_REAL,
PROP_MANAGED,
PROP_AUTOCONNECT,
PROP_FIRMWARE_MISSING,
@@ -199,7 +199,7 @@ register_properties (NMDevice *device)
{ NM_DEVICE_DRIVER_VERSION, &priv->driver_version },
{ NM_DEVICE_FIRMWARE_VERSION, &priv->firmware_version },
{ NM_DEVICE_CAPABILITIES, &priv->capabilities },
- { NM_DEVICE_REALIZED, &priv->realized },
+ { NM_DEVICE_REAL, &priv->real },
{ NM_DEVICE_MANAGED, &priv->managed },
{ NM_DEVICE_AUTOCONNECT, &priv->autoconnect },
{ NM_DEVICE_FIRMWARE_MISSING, &priv->firmware_missing },
@@ -448,8 +448,8 @@ get_property (GObject *object,
case PROP_CAPABILITIES:
g_value_set_uint (value, nm_device_get_capabilities (device));
break;
- case PROP_REALIZED:
- g_value_set_boolean (value, nm_device_get_realized (device));
+ case PROP_REAL:
+ g_value_set_boolean (value, nm_device_is_real (device));
break;
case PROP_MANAGED:
g_value_set_boolean (value, nm_device_get_managed (device));
@@ -653,13 +653,15 @@ nm_device_class_init (NMDeviceClass *device_class)
G_PARAM_STATIC_STRINGS));
/**
- * NMDevice:realized:
+ * NMDevice:real:
*
- * Whether the device is realized (eg, has backing resources).
+ * Whether the device is real or is a placeholder device that could
+ * be created automatically by NetworkManager if one of its
+ * #NMDevice:available-connections was activated.
**/
g_object_class_install_property
- (object_class, PROP_REALIZED,
- g_param_spec_boolean (NM_DEVICE_REALIZED, "", "",
+ (object_class, PROP_REAL,
+ g_param_spec_boolean (NM_DEVICE_REAL, "", "",
FALSE,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
@@ -1216,26 +1218,6 @@ nm_device_get_capabilities (NMDevice *device)
}
/**
- * nm_device_get_realized:
- * @device: a #NMDevice
- *
- * Returns whether the device is realized or not. Realized devices have
- * backing resources (kernel network device or other management daemon
- * resources), while un-realized devices do not but could create those
- * resources if activated.
- *
- * Returns: %TRUE if the device is realized, %FALSE if not.
- **/
-gboolean
-nm_device_get_realized (NMDevice *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_GET_PRIVATE (device)->realized;
-}
-
-/**
* nm_device_get_managed:
* @device: a #NMDevice
*
@@ -2106,6 +2088,25 @@ nm_device_get_mtu (NMDevice *device)
}
/**
+ * nm_device_is_real:
+ * @device: a #NMDevice
+ *
+ * Returns: %TRUE if the device exists, or %FALSE if it is a placeholder device
+ * that could be automatically created by NetworkManager if one of its
+ * #NMDevice:available-connections was activated.
+ *
+ * Since: 1.0
+ **/
+gboolean
+nm_device_is_real (NMDevice *device)
+{
+ g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
+
+ _nm_object_ensure_inited (NM_OBJECT (device));
+ return NM_DEVICE_GET_PRIVATE (device)->real;
+}
+
+/**
* nm_device_is_software:
* @device: a #NMDevice
*
diff --git a/libnm-glib/nm-device.h b/libnm-glib/nm-device.h
index 60c683a058..83dd90f76b 100644
--- a/libnm-glib/nm-device.h
+++ b/libnm-glib/nm-device.h
@@ -66,7 +66,7 @@ GQuark nm_device_error_quark (void);
#define NM_DEVICE_DRIVER_VERSION "driver-version"
#define NM_DEVICE_FIRMWARE_VERSION "firmware-version"
#define NM_DEVICE_CAPABILITIES "capabilities"
-#define NM_DEVICE_REALIZED "realized"
+#define NM_DEVICE_REAL "real"
#define NM_DEVICE_MANAGED "managed"
#define NM_DEVICE_AUTOCONNECT "autoconnect"
#define NM_DEVICE_FIRMWARE_MISSING "firmware-missing"
@@ -127,7 +127,6 @@ const char * nm_device_get_type_description (NMDevice *device);
NM_AVAILABLE_IN_0_9_10
const char * nm_device_get_hw_address (NMDevice *device);
NMDeviceCapabilities nm_device_get_capabilities (NMDevice *device);
-gboolean nm_device_get_realized (NMDevice *device);
gboolean nm_device_get_managed (NMDevice *device);
gboolean nm_device_get_autoconnect (NMDevice *device);
void nm_device_set_autoconnect (NMDevice *device, gboolean autoconnect);
@@ -145,6 +144,8 @@ const char * nm_device_get_physical_port_id (NMDevice *device);
NM_AVAILABLE_IN_0_9_10
guint32 nm_device_get_mtu (NMDevice *device);
NM_AVAILABLE_IN_1_0
+gboolean nm_device_is_real (NMDevice *device);
+NM_AVAILABLE_IN_1_0
gboolean nm_device_is_software (NMDevice *device);
const char * nm_device_get_product (NMDevice *device);
diff --git a/libnm/libnm.ver b/libnm/libnm.ver
index 19bf728612..0c9e80e04d 100644
--- a/libnm/libnm.ver
+++ b/libnm/libnm.ver
@@ -213,7 +213,6 @@ global:
nm_device_get_mtu;
nm_device_get_physical_port_id;
nm_device_get_product;
- nm_device_get_realized;
nm_device_get_setting_type;
nm_device_get_state;
nm_device_get_state_reason;
@@ -224,6 +223,7 @@ global:
nm_device_infiniband_get_carrier;
nm_device_infiniband_get_hw_address;
nm_device_infiniband_get_type;
+ nm_device_is_real;
nm_device_is_software;
nm_device_modem_capabilities_get_type;
nm_device_modem_get_current_capabilities;
diff --git a/libnm/nm-device.c b/libnm/nm-device.c
index 06342151bf..6e2c91a880 100644
--- a/libnm/nm-device.c
+++ b/libnm/nm-device.c
@@ -82,7 +82,7 @@ typedef struct {
char *firmware_version;
char *type_description;
NMDeviceCapabilities capabilities;
- gboolean realized;
+ gboolean real;
gboolean managed;
gboolean firmware_missing;
gboolean autoconnect;
@@ -114,7 +114,7 @@ enum {
PROP_DRIVER_VERSION,
PROP_FIRMWARE_VERSION,
PROP_CAPABILITIES,
- PROP_REALIZED,
+ PROP_REAL,
PROP_MANAGED,
PROP_AUTOCONNECT,
PROP_FIRMWARE_MISSING,
@@ -182,7 +182,7 @@ init_dbus (NMObject *object)
{ NM_DEVICE_DRIVER_VERSION, &priv->driver_version },
{ NM_DEVICE_FIRMWARE_VERSION, &priv->firmware_version },
{ NM_DEVICE_CAPABILITIES, &priv->capabilities },
- { NM_DEVICE_REALIZED, &priv->realized },
+ { NM_DEVICE_REAL, &priv->real },
{ NM_DEVICE_MANAGED, &priv->managed },
{ NM_DEVICE_AUTOCONNECT, &priv->autoconnect },
{ NM_DEVICE_FIRMWARE_MISSING, &priv->firmware_missing },
@@ -407,8 +407,8 @@ get_property (GObject *object,
case PROP_CAPABILITIES:
g_value_set_flags (value, nm_device_get_capabilities (device));
break;
- case PROP_REALIZED:
- g_value_set_boolean (value, nm_device_get_realized (device));
+ case PROP_REAL:
+ g_value_set_boolean (value, nm_device_is_real (device));
break;
case PROP_MANAGED:
g_value_set_boolean (value, nm_device_get_managed (device));
@@ -615,13 +615,15 @@ nm_device_class_init (NMDeviceClass *device_class)
G_PARAM_STATIC_STRINGS));
/**
- * NMDevice:realized:
+ * NMDevice:real:
*
- * Whether the device is realized (eg, has backing resources).
+ * Whether the device is real or is a placeholder device that could
+ * be created automatically by NetworkManager if one of its
+ * #NMDevice:available-connections was activated.
**/
g_object_class_install_property
- (object_class, PROP_REALIZED,
- g_param_spec_boolean (NM_DEVICE_REALIZED, "", "",
+ (object_class, PROP_REAL,
+ g_param_spec_boolean (NM_DEVICE_REAL, "", "",
FALSE,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
@@ -1053,25 +1055,6 @@ nm_device_get_capabilities (NMDevice *device)
}
/**
- * nm_device_get_realized:
- * @device: a #NMDevice
- *
- * Returns whether the device is realized or not. Realized devices have
- * backing resources (kernel network device or other management daemon
- * resources), while un-realized devices do not but could create those
- * resources if activated.
- *
- * Returns: %TRUE if the device is realized, %FALSE if not.
- **/
-gboolean
-nm_device_get_realized (NMDevice *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
-
- return NM_DEVICE_GET_PRIVATE (device)->realized;
-}
-
-/**
* nm_device_get_managed:
* @device: a #NMDevice
*
@@ -1918,6 +1901,22 @@ nm_device_get_mtu (NMDevice *device)
}
/**
+ * nm_device_is_real:
+ * @device: a #NMDevice
+ *
+ * Returns: %TRUE if the device exists, or %FALSE if it is a placeholder device
+ * that could be automatically created by NetworkManager if one of its
+ * #NMDevice:available-connections was activated.
+ **/
+gboolean
+nm_device_is_real (NMDevice *device)
+{
+ g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
+
+ return NM_DEVICE_GET_PRIVATE (device)->real;
+}
+
+/**
* nm_device_is_software:
* @device: a #NMDevice
*
diff --git a/libnm/nm-device.h b/libnm/nm-device.h
index 93c4e34994..5a0eb74a54 100644
--- a/libnm/nm-device.h
+++ b/libnm/nm-device.h
@@ -45,7 +45,7 @@ G_BEGIN_DECLS
#define NM_DEVICE_DRIVER_VERSION "driver-version"
#define NM_DEVICE_FIRMWARE_VERSION "firmware-version"
#define NM_DEVICE_CAPABILITIES "capabilities"
-#define NM_DEVICE_REALIZED "realized"
+#define NM_DEVICE_REAL "real"
#define NM_DEVICE_MANAGED "managed"
#define NM_DEVICE_AUTOCONNECT "autoconnect"
#define NM_DEVICE_FIRMWARE_MISSING "firmware-missing"
@@ -102,7 +102,6 @@ const char * nm_device_get_type_description (NMDevice *device);
const char * nm_device_get_hw_address (NMDevice *device);
NMDeviceCapabilities nm_device_get_capabilities (NMDevice *device);
gboolean nm_device_get_managed (NMDevice *device);
-gboolean nm_device_get_realized (NMDevice *device);
gboolean nm_device_get_autoconnect (NMDevice *device);
void nm_device_set_autoconnect (NMDevice *device, gboolean autoconnect);
gboolean nm_device_get_firmware_missing (NMDevice *device);
@@ -116,6 +115,7 @@ NMActiveConnection * nm_device_get_active_connection(NMDevice *device);
const GPtrArray * nm_device_get_available_connections(NMDevice *device);
const char * nm_device_get_physical_port_id (NMDevice *device);
guint32 nm_device_get_mtu (NMDevice *device);
+gboolean nm_device_is_real (NMDevice *device);
gboolean nm_device_is_software (NMDevice *device);
const char * nm_device_get_product (NMDevice *device);