summary refs log tree commit diff
path: root/src/devices/nm-device-veth.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-05-11 22:08:45 +0200
committerMichael Biebl <biebl@debian.org>2018-05-11 22:08:45 +0200
commitee9c73a923909e23a649407be77e25235d769e25 (patch)
treee21c923621fa278e737da693df9eb60ea31a6067 /src/devices/nm-device-veth.c
parentf60117b41d5433be1b4a96d82cd11d0c3dce9b63 (diff)
New upstream version 1.10.8 upstream/1.10.8
Diffstat (limited to 'src/devices/nm-device-veth.c')
-rw-r--r--src/devices/nm-device-veth.c41
1 files changed, 12 insertions, 29 deletions
diff --git a/src/devices/nm-device-veth.c b/src/devices/nm-device-veth.c
index 186173eb..a8c4bcc8 100644
--- a/src/devices/nm-device-veth.c
+++ b/src/devices/nm-device-veth.c
@@ -30,6 +30,8 @@
 #include "platform/nm-platform.h"
 #include "nm-device-factory.h"
 
+#include "introspection/org.freedesktop.NetworkManager.Device.Veth.h"
+
 #include "nm-device-logging.h"
 _LOG_DECLARE_SELF(NMDeviceVeth);
 
@@ -99,18 +101,11 @@ nm_device_veth_init (NMDeviceVeth *self)
 }
 
 static void
-parent_changed_notify (NMDevice *device,
-                       int old_ifindex,
-                       NMDevice *old_parent,
-                       int new_ifindex,
-                       NMDevice *new_parent)
+notify (GObject *object, GParamSpec *pspec)
 {
-	NM_DEVICE_CLASS (nm_device_veth_parent_class)->parent_changed_notify (device,
-	                                                                      old_ifindex,
-	                                                                      old_parent,
-	                                                                      new_ifindex,
-	                                                                      new_parent);
-	_notify (NM_DEVICE_VETH (device), PROP_PEER);
+	if (nm_streq (pspec->name, NM_DEVICE_PARENT))
+		_notify (NM_DEVICE_VETH (object), PROP_PEER);
+	G_OBJECT_CLASS (nm_device_veth_parent_class)->notify (object, pspec);
 }
 
 static void
@@ -125,7 +120,7 @@ get_property (GObject *object, guint prop_id,
 		peer = nm_device_parent_get_device (NM_DEVICE (self));
 		if (peer && !NM_IS_DEVICE_VETH (peer))
 			peer = NULL;
-		nm_dbus_utils_g_value_set_object_path (value, peer);
+		nm_utils_g_value_set_object_path (value, peer);
 		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -133,35 +128,19 @@ get_property (GObject *object, guint prop_id,
 	}
 }
 
-static const NMDBusInterfaceInfoExtended interface_info_device_veth = {
-	.parent = NM_DEFINE_GDBUS_INTERFACE_INFO_INIT (
-		NM_DBUS_INTERFACE_DEVICE_VETH,
-		.signals = NM_DEFINE_GDBUS_SIGNAL_INFOS (
-			&nm_signal_info_property_changed_legacy,
-		),
-		.properties = NM_DEFINE_GDBUS_PROPERTY_INFOS (
-			NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("Peer", "o", NM_DEVICE_VETH_PEER),
-		),
-	),
-	.legacy_property_changed = TRUE,
-};
-
 static void
 nm_device_veth_class_init (NMDeviceVethClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-	NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
 	NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
 
 	NM_DEVICE_CLASS_DECLARE_TYPES (klass, NULL, NM_LINK_TYPE_VETH)
 
 	object_class->get_property = get_property;
-
-	dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_veth);
+	object_class->notify = notify;
 
 	device_class->can_unmanaged_external_down = can_unmanaged_external_down;
 	device_class->link_changed = link_changed;
-	device_class->parent_changed_notify = parent_changed_notify;
 
 	obj_properties[PROP_PEER] =
 	    g_param_spec_string (NM_DEVICE_VETH_PEER, "", "",
@@ -170,6 +149,10 @@ nm_device_veth_class_init (NMDeviceVethClass *klass)
 	                         G_PARAM_STATIC_STRINGS);
 
 	g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
+
+	nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
+	                                        NMDBUS_TYPE_DEVICE_VETH_SKELETON,
+	                                        NULL);
 }
 
 /*****************************************************************************/