summary refs log tree commit diff
path: root/libnm-core
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2019-12-26 06:49:35 +0100
committerMichael Biebl <biebl@debian.org>2019-12-26 06:49:35 +0100
commit724bcc5c7be3aed3646ed2b2989c34d438217176 (patch)
treee46ca78149b3517bc5ebc9fd31d6d9d11a6561b6 /libnm-core
parent28028b26b3371756811e95d894f709f4b1207c00 (diff)
New upstream version 1.22.2 upstream/1.22.2
Diffstat (limited to 'libnm-core')
-rw-r--r--libnm-core/nm-dbus-interface.h6
-rw-r--r--libnm-core/nm-dbus-types.xml7
-rw-r--r--libnm-core/nm-setting-sriov.c30
-rw-r--r--libnm-core/nm-version.h14
4 files changed, 42 insertions, 15 deletions
diff --git a/libnm-core/nm-dbus-interface.h b/libnm-core/nm-dbus-interface.h
index 35f2335f..1cf1c888 100644
--- a/libnm-core/nm-dbus-interface.h
+++ b/libnm-core/nm-dbus-interface.h
@@ -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;
 
 /**
diff --git a/libnm-core/nm-dbus-types.xml b/libnm-core/nm-dbus-types.xml
index b2190724..ad547361 100644
--- a/libnm-core/nm-dbus-types.xml
+++ b/libnm-core/nm-dbus-types.xml
@@ -30,7 +30,12 @@
             <row role="constant">
               <entry role="enum_member_name"><para>NM_CAPABILITY_TEAM</para><para></para></entry>
               <entry role="enum_member_value"><para>= <literal>1</literal></para><para></para></entry>
-              <entry role="enum_member_description"><para>Teams can be managed</para><para></para></entry>
+              <entry role="enum_member_description"><para>Teams can be managed. This means the team device plugin is loaded.</para><para></para></entry>
+            </row>
+            <row role="constant">
+              <entry role="enum_member_name"><para>NM_CAPABILITY_OVS</para><para></para></entry>
+              <entry role="enum_member_value"><para>= <literal>2</literal></para><para></para></entry>
+              <entry role="enum_member_description"><para>OpenVSwitch can be managed. This means the OVS device plugin is loaded. Since: 1.24, 1.22.2</para><para></para></entry>
             </row>
           </tbody>
         </tgroup>
diff --git a/libnm-core/nm-setting-sriov.c b/libnm-core/nm-setting-sriov.c
index 4dd43ae1..9ef68cce 100644
--- a/libnm-core/nm-setting-sriov.c
+++ b/libnm-core/nm-setting-sriov.c
@@ -99,13 +99,15 @@ nm_sriov_vf_new (guint index)
 {
 	NMSriovVF *vf;
 
-	vf = g_slice_new0 (NMSriovVF);
-	vf->refcount = 1;
-	vf->index = index;
-	vf->attributes = g_hash_table_new_full (nm_str_hash,
-	                                        g_str_equal,
-	                                        g_free,
-	                                        (GDestroyNotify) g_variant_unref);
+	vf = g_slice_new (NMSriovVF);
+	*vf = (NMSriovVF) {
+		.refcount   = 1,
+		.index      = index,
+		.attributes = g_hash_table_new_full (nm_str_hash,
+		                                     g_str_equal,
+		                                     g_free,
+		                                     (GDestroyNotify) g_variant_unref),
+	};
 	return vf;
 }
 
@@ -147,7 +149,7 @@ nm_sriov_vf_unref (NMSriovVF *vf)
 		if (vf->vlans)
 			g_hash_table_unref (vf->vlans);
 		g_free (vf->vlan_ids);
-		g_slice_free (NMSriovVF, vf);
+		nm_g_slice_free (vf);
 	}
 }
 
@@ -221,10 +223,12 @@ vf_add_vlan (NMSriovVF *vf,
 {
 	VFVlan *vlan;
 
-	vlan = g_slice_new0 (VFVlan);
-	vlan->id = vlan_id;
-	vlan->qos = qos;
-	vlan->protocol = protocol;
+	vlan = g_slice_new (VFVlan);
+	*vlan = (VFVlan) {
+		.id       = vlan_id,
+		.qos      = qos,
+		.protocol = protocol,
+	};
 
 	if (!vf->vlans)
 		vf->vlans = _vf_vlan_create_hash ();
@@ -550,7 +554,7 @@ vlan_id_compare (gconstpointer a, gconstpointer b, gpointer user_data)
  *
  * Returns the VLANs currently configured on the VF.
  *
- * Returns: (transfer none): a list of VLAN ids configured on the VF.
+ * Returns: (transfer none) (array length=length): a list of VLAN ids configured on the VF.
  *
  * Since: 1.14
  */
diff --git a/libnm-core/nm-version.h b/libnm-core/nm-version.h
index 3180c7e2..8cb0ac50 100644
--- a/libnm-core/nm-version.h
+++ b/libnm-core/nm-version.h
@@ -215,6 +215,20 @@
 # define NM_AVAILABLE_IN_1_22
 #endif
 
+#if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_22_2
+# define NM_DEPRECATED_IN_1_22_2           G_DEPRECATED
+# define NM_DEPRECATED_IN_1_22_2_FOR(f)    G_DEPRECATED_FOR(f)
+#else
+# define NM_DEPRECATED_IN_1_22_2
+# define NM_DEPRECATED_IN_1_22_2_FOR(f)
+#endif
+
+#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_22_2
+# define NM_AVAILABLE_IN_1_22_2            G_UNAVAILABLE(1,22.2)
+#else
+# define NM_AVAILABLE_IN_1_22_2
+#endif
+
 /*
  * Synchronous API for calling D-Bus in libnm is deprecated. See
  * https://developer.gnome.org/libnm/stable/usage.html#sync-api