[PATCH] virNetDevTapCreate: Fail on systems not supporting IFF_MULTI_QUEUE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In my previous patches I enabled the IFF_MULTI_QUEUE flag every
time the user requested multiqueue TAP device. However, this
works only at runtime. During build time the flag may be
undeclared.
---
 src/util/virnetdevtap.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index aa41b9c..e8057f7 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -178,8 +178,15 @@ int virNetDevTapCreate(char **ifname,
 
         ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
         /* If tapfdSize is greater than one, request multiqueue */
-        if (tapfdSize > 1)
+        if (tapfdSize > 1) {
+# ifdef IFF_MULTI_QUEUE
             ifr.ifr_flags |= IFF_MULTI_QUEUE;
+# else
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("Multiqueue devices are not supported on this system"));
+            goto cleanup;
+# endif
+        }
 
 # ifdef IFF_VNET_HDR
         if ((flags &  VIR_NETDEV_TAP_CREATE_VNET_HDR) &&
-- 
1.8.2.1

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]