]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: relax virNetDevSetCoalesce() stub
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Sun, 23 Apr 2017 14:53:37 +0000 (18:53 +0400)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Mon, 24 Apr 2017 11:57:54 +0000 (15:57 +0400)
Currently, virNetDevSetCoalesce() stub is always returning error. As
it's used by virNetDevTapCreateInBridgePort(), it essentially breaks
bridged networking if coalesce is not supported.

To make it work, relax the stub to trigger error only when its
coalesce argument is not NULL, otherwise report success.

src/util/virnetdev.c

index 131a56a8dc221734ea123b550f39c836435b2c17..e75a1c9705053b8931a51bff05a3b485a160b92f 100644 (file)
@@ -3155,8 +3155,11 @@ int virNetDevSetCoalesce(const char *ifname,
 }
 # else
 int virNetDevSetCoalesce(const char *ifname,
-                         virNetDevCoalescePtr coalesce ATTRIBUTE_UNUSED)
+                         virNetDevCoalescePtr coalesce)
 {
+    if (!coalesce)
+        return 0;
+
     virReportSystemError(ENOSYS,
                          _("Cannot set coalesce info on interface '%s'"),
                          ifname);
@@ -3213,8 +3216,11 @@ virNetDevGetFeatures(const char *ifname ATTRIBUTE_UNUSED,
 }
 
 int virNetDevSetCoalesce(const char *ifname,
-                         virNetDevCoalescePtr coalesce ATTRIBUTE_UNUSED)
+                         virNetDevCoalescePtr coalesce)
 {
+    if (!coalesce)
+        return 0;
+
     virReportSystemError(ENOSYS,
                          _("Cannot set coalesce info on interface '%s'"),
                          ifname);