diff options
author | Dan Williams <dcbw@redhat.com> | 2014-10-10 14:43:56 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-12-11 10:07:40 -0600 |
commit | c26f5f2929848da39a220a4ea3ac12c192b938c2 (patch) | |
tree | 65023e71bba2a0dc6a6926afa43e75339c7cde49 | |
parent | 03e367e3eab43771634e0fd10372f5adb22c906a (diff) | |
download | NetworkManager-c26f5f2929848da39a220a4ea3ac12c192b938c2.tar.gz |
fixup! core: add "real" NMDevice property
-rw-r--r-- | introspection/nm-device.xml | 6 | ||||
-rw-r--r-- | src/devices/nm-device.c | 33 | ||||
-rw-r--r-- | src/devices/nm-device.h | 4 | ||||
-rw-r--r-- | src/settings/nm-settings.c | 6 |
4 files changed, 24 insertions, 25 deletions
diff --git a/introspection/nm-device.xml b/introspection/nm-device.xml index 54675b21ac..4850b021de 100644 --- a/introspection/nm-device.xml +++ b/introspection/nm-device.xml @@ -139,9 +139,11 @@ The device MTU (maximum transmission unit). </tp:docstring> </property> - <property name="Realized" type="b" access="read"> + <property name="Real" type="b" access="read"> <tp:docstring> - Whether the device actually exists, or is waiting to be instantiated. + True if the device exists, or False for placeholder devices that + do not yet exist but could be automatically created by NetworkManager + if one of their AvailableConnections was activated. </tp:docstring> </property> diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 1e2dd52689..e2c9db4d5c 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -126,7 +126,7 @@ enum { PROP_MASTER, PROP_HW_ADDRESS, PROP_HAS_PENDING_ACTION, - PROP_REALIZED, + PROP_REAL, LAST_PROP }; @@ -184,7 +184,7 @@ typedef struct { char * iface; /* may change, could be renamed by user */ int ifindex; gboolean is_software; - gboolean realized; + gboolean real; char * ip_iface; int ip_ifindex; NMDeviceType type; @@ -531,18 +531,15 @@ nm_device_is_software (NMDevice *self) } /** - * nm_device_is_realized: + * nm_device_is_real: * @self: the #NMDevice * - * Indicates if the device is backed by kernel (netdev or some other kernel - * kernel device) or external (Bluez device, ModemManager device) resource. - * - * Returns: %TRUE if the device is backed by kernel or other resources + * Returns: %TRUE if the device exists, %FALSE if the device is a placeholder */ gboolean -nm_device_is_realized (NMDevice *self) +nm_device_is_real (NMDevice *self) { - return NM_DEVICE_GET_PRIVATE (self)->realized; + return NM_DEVICE_GET_PRIVATE (self)->real; } const char * @@ -1487,8 +1484,8 @@ setup (NMDevice *self, NMPlatformLink *plink) device_set_master (self, master); } - priv->realized = TRUE; - g_object_notify (G_OBJECT (self), NM_DEVICE_REALIZED); + priv->real = TRUE; + g_object_notify (G_OBJECT (self), NM_DEVICE_REAL); } /** @@ -2064,7 +2061,7 @@ device_has_config (NMDevice *self) return TRUE; /* The existence of a software device is good enough. */ - if (nm_device_is_software (self) && nm_device_is_realized (self)) + if (nm_device_is_software (self) && nm_device_is_real (self)) return TRUE; /* Slaves are also configured by definition */ @@ -5650,7 +5647,7 @@ delete_on_deactivate_check_and_schedule (NMDevice *self, int ifindex) return; if (priv->queued_act_request) return; - if (!nm_device_is_software (self) || !nm_device_is_realized (self)) + if (!nm_device_is_software (self) || !nm_device_is_real (self)) return; if (nm_device_get_state (self) == NM_DEVICE_STATE_UNMANAGED) return; @@ -5749,7 +5746,7 @@ impl_device_delete (NMDevice *self, DBusGMethodInvocation *context) { GError *error = NULL; - if (!nm_device_is_software (self) || !nm_device_is_realized (self)) { + if (!nm_device_is_software (self) || !nm_device_is_real (self)) { error = g_error_new_literal (NM_DEVICE_ERROR, NM_DEVICE_ERROR_NOT_SOFTWARE, "This device is not a software device or is not realized"); @@ -8452,8 +8449,8 @@ get_property (GObject *object, guint prop_id, case PROP_HAS_PENDING_ACTION: g_value_set_boolean (value, nm_device_has_pending_action (self)); break; - case PROP_REALIZED: - g_value_set_boolean (value, priv->realized); + case PROP_REAL: + g_value_set_boolean (value, priv->real); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -8711,8 +8708,8 @@ nm_device_class_init (NMDeviceClass *klass) G_PARAM_STATIC_STRINGS)); 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)); diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h index 945cc52277..9c5e264dd4 100644 --- a/src/devices/nm-device.h +++ b/src/devices/nm-device.h @@ -57,7 +57,7 @@ #define NM_DEVICE_PHYSICAL_PORT_ID "physical-port-id" #define NM_DEVICE_MTU "mtu" #define NM_DEVICE_HW_ADDRESS "hw-address" -#define NM_DEVICE_REALIZED "realized" +#define NM_DEVICE_REAL "real" #define NM_DEVICE_TYPE_DESC "type-desc" /* Internal only */ #define NM_DEVICE_RFKILL_TYPE "rfkill-type" /* Internal only */ @@ -271,7 +271,7 @@ const char * nm_device_get_udi (NMDevice *dev); const char * nm_device_get_iface (NMDevice *dev); int nm_device_get_ifindex (NMDevice *dev); gboolean nm_device_is_software (NMDevice *dev); -gboolean nm_device_is_realized (NMDevice *dev); +gboolean nm_device_is_real (NMDevice *dev); const char * nm_device_get_ip_iface (NMDevice *dev); int nm_device_get_ip_ifindex(NMDevice *dev); const char * nm_device_get_driver (NMDevice *dev); diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index ac7d912b7b..70666ec11d 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -1624,7 +1624,7 @@ device_realized (NMDevice *device, GParamSpec *pspec, NMSettings *self) NMSettingsConnection *added; GError *error = NULL; - if (!nm_device_is_realized (device)) + if (!nm_device_is_real (device)) return; /* If the device isn't managed or it already has a default wired connection, @@ -1667,10 +1667,10 @@ device_realized (NMDevice *device, GParamSpec *pspec, NMSettings *self) void nm_settings_device_added (NMSettings *self, NMDevice *device) { - if (nm_device_is_realized (device)) + if (nm_device_is_real (device)) device_realized (device, NULL, self); else { - g_signal_connect_after (device, "notify::" NM_DEVICE_REALIZED, + g_signal_connect_after (device, "notify::" NM_DEVICE_REAL, G_CALLBACK (device_realized), self); } |