From ec93cc25ecdad100a535cb52c08f7eaa3004b960 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Sat, 12 Dec 2015 08:05:17 +0100 Subject: [PATCH] virNetDevMacVLanTapSetup: Work around older systems Some older systems, e.g. RHEL-6 do not have IFF_MULTI_QUEUE flag which we use to enable multiqueue feature. Therefore one gets the following compile error there: CC util/libvirt_util_la-virnetdevmacvlan.lo util/virnetdevmacvlan.c: In function 'virNetDevMacVLanTapSetup': util/virnetdevmacvlan.c:338: error: 'IFF_MULTI_QUEUE' undeclared (first use in this function) util/virnetdevmacvlan.c:338: error: (Each undeclared identifier is reported only once util/virnetdevmacvlan.c:338: error: for each function it appears in.) make[3]: *** [util/libvirt_util_la-virnetdevmacvlan.lo] Error 1 So, whenever user wants us to enable the feature on such systems, we will just throw a runtime error instead. Signed-off-by: Michal Privoznik --- src/util/virnetdevmacvlan.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index d8d1d901f9..8fc71af435 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -334,10 +334,18 @@ virNetDevMacVLanTapSetup(int *tapfd, size_t tapfdSize, bool vnet_hdr, bool multi new_flags &= ~IFF_VNET_HDR; } +# ifdef IFF_MULTI_QUEUE if (multiqueue) new_flags |= IFF_MULTI_QUEUE; else new_flags &= ~IFF_MULTI_QUEUE; +# else + if (multiqueue) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Multiqueue devices are not supported on this system")); + return -1; + } +# endif if (new_flags != ifreq.ifr_flags) { ifreq.ifr_flags = new_flags; -- GitLab