[PATCH 1/2] virNetDevTapCreate: Use error message hinting to multiqueue use only when opening multiple queues

Peter Krempa via Devel posted 2 patches 3 months, 4 weeks ago
[PATCH 1/2] virNetDevTapCreate: Use error message hinting to multiqueue use only when opening multiple queues
Posted by Peter Krempa via Devel 3 months, 4 weeks ago
From: Peter Krempa <pkrempa@redhat.com>

Due to a logic bug the error message mentioning mult_queue operation
would be mentioned also when a single queue would be opened on an
externally managed tap device.

Adjust the condition to trigger only when multiple queues are in use.

Fixes: f6fb097e11a
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/util/virnetdevtap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index 1dc77f0f5c..648d095dfc 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -231,7 +231,7 @@ int virNetDevTapCreate(char **ifname,

         if (ioctl(fd, TUNSETIFF, &ifr) < 0) {
             if (flags & VIR_NETDEV_TAP_CREATE_ALLOW_EXISTING &&
-                tapfdSize > 0) {
+                tapfdSize > 1) {
                 virReportSystemError(errno,
                                      _("Unable to create multiple fds for tap device %1$s (maybe existing device was created without multi_queue flag)"),
                                      *ifname);
-- 
2.49.0
Re: [PATCH 1/2] virNetDevTapCreate: Use error message hinting to multiqueue use only when opening multiple queues
Posted by Ján Tomko via Devel 3 months, 4 weeks ago
On a Tuesday in 2025, Peter Krempa via Devel wrote:
>From: Peter Krempa <pkrempa@redhat.com>
>
>Due to a logic bug the error message mentioning mult_queue operation

multi_queue

>would be mentioned also when a single queue would be opened on an
>externally managed tap device.
>
>Adjust the condition to trigger only when multiple queues are in use.
>
>Fixes: f6fb097e11a
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/util/virnetdevtap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Jano
Re: [PATCH 1/2] virNetDevTapCreate: Use error message hinting to multiqueue use only when opening multiple queues
Posted by Daniel P. Berrangé via Devel 3 months, 4 weeks ago
On Tue, May 13, 2025 at 02:25:50PM +0200, Peter Krempa via Devel wrote:
> From: Peter Krempa <pkrempa@redhat.com>
> 
> Due to a logic bug the error message mentioning mult_queue operation
> would be mentioned also when a single queue would be opened on an
> externally managed tap device.
> 
> Adjust the condition to trigger only when multiple queues are in use.
> 
> Fixes: f6fb097e11a
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  src/util/virnetdevtap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|