devices/ovs: expose slaves on D-Bus for OVS bridges and ports

This commit is contained in:
Lubomir Rintel 2018-06-29 22:52:43 +02:00
parent 889961f8b6
commit 8d65f636e1
5 changed files with 28 additions and 1 deletions

View file

@ -7,6 +7,16 @@
-->
<interface name="org.freedesktop.NetworkManager.Device.OvsBridge">
<!--
Slaves:
Array of object paths representing ports which are currently enslaved to
this bridge.
Since: 1.14
-->
<property name="Slaves" type="ao" access="read"/>
<!--
PropertiesChanged:
@properties: A dictionary mapping property names to variant boxed values

View file

@ -7,6 +7,16 @@
-->
<interface name="org.freedesktop.NetworkManager.Device.OvsPort">
<!--
Slaves:
Array of object paths representing interfaces which are currently enslaved to
this port.
Since: 1.14
-->
<property name="Slaves" type="ao" access="read"/>
<!--
PropertiesChanged:
@properties: A dictionary mapping property names to variant boxed values

View file

@ -120,7 +120,8 @@ nm_device_state_reason_check (NMDeviceStateReason reason)
#define NM_DEVICE_PARENT "parent"
/* the "slaves" property is internal in the parent class, but exposed
* by the derived classes NMDeviceBond, NMDeviceBridge and NMDeviceTeam. */
* by the derived classes NMDeviceBond, NMDeviceBridge, NMDeviceTeam,
* NMDeviceOvsBridge and NMDeviceOvsPort. */
#define NM_DEVICE_SLAVES "slaves" /* partially internal */
#define NM_DEVICE_TYPE_DESC "type-desc" /* Internal only */

View file

@ -134,6 +134,9 @@ nm_device_ovs_bridge_init (NMDeviceOvsBridge *self)
static const NMDBusInterfaceInfoExtended interface_info_device_ovs_bridge = {
.parent = NM_DEFINE_GDBUS_INTERFACE_INFO_INIT (
NM_DBUS_INTERFACE_DEVICE_OVS_BRIDGE,
.properties = NM_DEFINE_GDBUS_PROPERTY_INFOS (
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Slaves", "ao", NM_DEVICE_SLAVES),
),
.signals = NM_DEFINE_GDBUS_SIGNAL_INFOS (
&nm_signal_info_property_changed_legacy,
),

View file

@ -180,6 +180,9 @@ nm_device_ovs_port_init (NMDeviceOvsPort *self)
static const NMDBusInterfaceInfoExtended interface_info_device_ovs_port = {
.parent = NM_DEFINE_GDBUS_INTERFACE_INFO_INIT (
NM_DBUS_INTERFACE_DEVICE_OVS_PORT,
.properties = NM_DEFINE_GDBUS_PROPERTY_INFOS (
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE ("Slaves", "ao", NM_DEVICE_SLAVES),
),
.signals = NM_DEFINE_GDBUS_SIGNAL_INFOS (
&nm_signal_info_property_changed_legacy,
),