[libvirt] [PATCH] util: relax virNetDevSetCoalesce() stub

Roman Bogorodskiy posted 1 patch 6 years, 12 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20170423145707.81181-1-bogorodskiy@gmail.com
src/util/virnetdev.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
[libvirt] [PATCH] util: relax virNetDevSetCoalesce() stub
Posted by Roman Bogorodskiy 6 years, 12 months ago
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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 131a56a8d..131c4d983 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -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);
-- 
2.11.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] util: relax virNetDevSetCoalesce() stub
Posted by Martin Kletzander 6 years, 11 months ago
On Sun, Apr 23, 2017 at 06:57:07PM +0400, Roman Bogorodskiy wrote:
>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 | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>

That should be fixed in the other stub as well.  ACK with that added.

>diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
>index 131a56a8d..131c4d983 100644
>--- a/src/util/virnetdev.c
>+++ b/src/util/virnetdev.c
>@@ -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);
>--
>2.11.0
>
>--
>libvir-list mailing list
>libvir-list@redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] util: relax virNetDevSetCoalesce() stub
Posted by Roman Bogorodskiy 6 years, 11 months ago
  Martin Kletzander wrote:

> On Sun, Apr 23, 2017 at 06:57:07PM +0400, Roman Bogorodskiy wrote:
> >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 | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> 
> That should be fixed in the other stub as well.  ACK with that added.

Adjusted the other stub and pushed, thanks!

Roman Bogorodskiy
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list