summaryrefslogtreecommitdiff
path: root/src/devices/nm-device.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-12-09 15:13:57 +0100
committerThomas Haller <thaller@redhat.com>2015-12-10 14:33:49 +0100
commita4de9187ff216a9281710261d122ad97c063322c (patch)
treeb81ce50cd7e5eb8b27525694e8d18a05eaa9df56 /src/devices/nm-device.h
parent2a14a28fe05ef4db30d03cd37dd03c143bf881fd (diff)
downloadNetworkManager-a4de9187ff216a9281710261d122ad97c063322c.tar.gz
platform: return pointer to NMPlatformLink object for add functions
Let the link-add functions return the internal pointer to the platform link object. Similar to link-get, which doesn't copy the link either. Also adjust the sole users of the add-functions (create-and-realize) to take the pointer. Eventually we still copy the returned data, because accessing platform can invalidate the returned pointer. Thus we don't actually safe any copying by this (at least every use of the function currently leads to the data being copied). Still change it, because I think the API of NMPlatform should look like that.
Diffstat (limited to 'src/devices/nm-device.h')
-rw-r--r--src/devices/nm-device.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h
index 655f52d1f3..3ad900f385 100644
--- a/src/devices/nm-device.h
+++ b/src/devices/nm-device.h
@@ -170,7 +170,9 @@ typedef struct {
* @self: the #NMDevice
* @connection: the #NMConnection being activated
* @parent: the parent #NMDevice, if any
- * @out_plink: on success, a backing kernel network device if one exists
+ * @out_plink: on success, a backing kernel network device if one exists.
+ * The returned pointer is owned by platform and only valid until the
+ * next platform operation.
* @error: location to store error, or %NULL
*
* Create any backing resources (kernel devices, etc) required for this
@@ -183,7 +185,7 @@ typedef struct {
gboolean (*create_and_realize) (NMDevice *self,
NMConnection *connection,
NMDevice *parent,
- NMPlatformLink *out_plink,
+ const NMPlatformLink **out_plink,
GError **error);
/**