core: add and indicate NM_CAPABILITY_OVS capability on D-Bus

https://bugzilla.redhat.com/show_bug.cgi?id=1785147
(cherry picked from commit 785da51d83)
This commit is contained in:
Thomas Haller 2019-12-20 17:52:34 +01:00
parent 0d21129701
commit 4b1053da91
4 changed files with 11 additions and 2 deletions

View file

@ -89,7 +89,10 @@
/**
* NMCapability:
* @NM_CAPABILITY_TEAM: Teams can be managed
* @NM_CAPABILITY_TEAM: Teams can be managed. This means the team device plugin
* is loaded.
* @NM_CAPABILITY_OVS: OpenVSwitch can be managed. This means the OVS device plugin
* is loaded. Since: 1.24, 1.22.2
*
* #NMCapability names the numbers in the Capabilities property.
* Capabilities are positive numbers. They are part of stable API
@ -101,6 +104,7 @@
*/
typedef enum {
NM_CAPABILITY_TEAM = 1,
NM_CAPABILITY_OVS = 2,
} NMCapability;
/**

View file

@ -95,4 +95,8 @@ nm_setting_ip_config_get_addr_family (NMSettingIPConfig *s_ip)
* depends on other factors. */
#define NM_INFINIBAND_MAX_MTU ((guint) 65520)
/*****************************************************************************/
#define _NM_CAPABILITY_MAX NM_CAPABILITY_OVS
#endif /* __NM_LIBNM_SHARED_UTILS_H__ */

View file

@ -59,6 +59,7 @@ NM_DEVICE_FACTORY_DECLARE_TYPES (
G_MODULE_EXPORT NMDeviceFactory *
nm_device_factory_create (GError **error)
{
nm_manager_set_capability (NM_MANAGER_GET, NM_CAPABILITY_OVS);
return (NMDeviceFactory *) g_object_new (NM_TYPE_OVS_FACTORY, NULL);
}

View file

@ -7357,7 +7357,7 @@ nm_manager_set_capability (NMManager *self,
gssize idx;
g_return_if_fail (NM_IS_MANAGER (self));
if (cap < 1 || cap > NM_CAPABILITY_TEAM)
if (cap < 1 || cap > _NM_CAPABILITY_MAX)
g_return_if_reached ();
cap_i = (guint32) cap;