From nobody Mon Nov 25 12:16:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601507824; cv=none; d=zohomail.com; s=zohoarc; b=k7pFyiF5SYhkCdUtrNdORG/V0ai3G7JB1JPETtY7JGqz3xIaGZhhuxhmoUI2LlFXbKHDY1g6MegnFdkVUvdmWgcZN/Kx94nvRe3VtaUMr6lRyjgkEwKi/Kqy5+MplZoWXwj8qDRNHfimL8DSwK+vv/c0NWmx4HbrkxrwPxmJDU0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601507824; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Lm48+PgwWsXnn+ALbMRS/shSx/xUXec2Diyi3mwZ1LQ=; b=O44s94zORgxsnAKuHyaO+TOHTb8P2ZEXdprvAT5kTBLve2jf7vK6XqmgAGqqJRnC1ohgvP3Wi9M+gjfpUlR+ZIquHbjWdZgv9Mlltolz74JiUqKiLxsI9Ws1qiF4aYtv3Ob7qQ1cfkCy+1gB2UJ+do9I4sRwUk0BaoHXlJG9pXg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1601507824074922.0668813457813; Wed, 30 Sep 2020 16:17:04 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-27-A4h5QIlsM_q1i0rjIJGzGA-1; Wed, 30 Sep 2020 19:17:00 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7946C1DE0B; Wed, 30 Sep 2020 23:16:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 57F745578D; Wed, 30 Sep 2020 23:16:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 24862183D022; Wed, 30 Sep 2020 23:16:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08UNEpGF027989 for ; Wed, 30 Sep 2020 19:14:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4702455762; Wed, 30 Sep 2020 23:14:51 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-224.phx2.redhat.com [10.3.112.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id 00F1D3782 for ; Wed, 30 Sep 2020 23:14:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601507822; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Lm48+PgwWsXnn+ALbMRS/shSx/xUXec2Diyi3mwZ1LQ=; b=A56K1yLwiN22teDrarO+WroBdiiGil0myAtFw36HSm1JhHKExEZ2xwHHS+7M+zdiyhr7lj RW67hI2qkas9wo8s5B4VuN0jd5j+ilzQPdVzSCom8O2JLbc446zta2TF8JLrbeY++RpO7M Yf8ALl9Y7qoll+6W+dMAuscOLlJ52ew= X-MC-Unique: A4h5QIlsM_q1i0rjIJGzGA-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 1/9] util: remove useless check for IFLA_VF_MAX Date: Wed, 30 Sep 2020 19:14:36 -0400 Message-Id: <20200930231444.409215-2-laine@redhat.com> In-Reply-To: <20200930231444.409215-1-laine@redhat.com> References: <20200930231444.409215-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" IFLA_VF_MAX was introduced to the Linux kernel in 2.6.35, and was even backported to the RHEL*6* 2.6.32 kernel downstream, so it is present in all supported versions of all Linux distros that libvirt builds on. Additionally, it can't be conditionally compiled out of a kernel. There is no reason to conditionalize any piece of code on presence of IFLA_VF_MAX - if the platform is Linux, it is supported. Signed-off-by: Laine Stump Reviewed-by: Michal Privoznik --- src/util/virnetdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index e1a4cc2bef..07208a1876 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -1473,7 +1473,7 @@ virNetDevSysfsFile(char **pf_sysfs_device_link G_GNUC= _UNUSED, =20 =20 #endif /* !__linux__ */ -#if defined(__linux__) && defined(WITH_LIBNL) && defined(IFLA_VF_MAX) +#if defined(__linux__) && defined(WITH_LIBNL) =20 =20 static virMacAddr zeroMAC =3D { .addr =3D { 0, 0, 0, 0, 0, 0 } }; @@ -2266,7 +2266,7 @@ virNetDevSetNetConfig(const char *linkdev, int vf, } =20 =20 -#else /* defined(__linux__) && defined(WITH_LIBNL) && defined(IFLA_VF_MAX= ) */ +#else /* defined(__linux__) && defined(WITH_LIBNL) */ =20 =20 int @@ -2309,7 +2309,7 @@ virNetDevSetNetConfig(const char *linkdev G_GNUC_UNUS= ED, } =20 =20 -#endif /* defined(__linux__) && defined(WITH_LIBNL) && defined(IFLA_VF_MAX= ) */ +#endif /* defined(__linux__) && defined(WITH_LIBNL) */ =20 VIR_ENUM_IMPL(virNetDevIfState, VIR_NETDEV_IF_STATE_LAST, --=20 2.26.2 From nobody Mon Nov 25 12:16:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601507756; cv=none; d=zohomail.com; s=zohoarc; b=eDeORrO1Nd3De/dGt08LhaqWW7qnJaisTigg6enzK9xpLSw5PbYtKVoDpGJOr3D/CbclVvI04aVdFu2bbfWEv44Ssq1375NYZ8XUaWgriv7htYjrENDy4FBVVTSbwUx9M93iVSCLSZi0xICX4qqzzXf4/k1TToag0bKWMvZKDWU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601507756; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ds+NqgpX6X6Ab0bAmgYBuYBEm4EHqXuuIeqV2peoAIk=; b=Pi/YwChQZy4ZnDns0zo+hI2PuwPgrir1OrDV4lmrRlUujgM+tPnTPGjGA+yAzTx8ySWEn9qOu0eE3f0vN9MslDjAMB9iEkKIRxr69CDR0svuQPFK1chRJkvkI6pb2N6Co0E1c8G6vx8iqCby50EoXspfTaXYujE2DoKI7xg026k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1601507756311604.1305761052764; Wed, 30 Sep 2020 16:15:56 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-56-p3vQtdVmO7-P0pRFHC94Ew-1; Wed, 30 Sep 2020 19:15:51 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F1341107465B; Wed, 30 Sep 2020 23:15:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0F8A5C1D7; Wed, 30 Sep 2020 23:15:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9A50B44A5D; Wed, 30 Sep 2020 23:15:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08UNEpnO027994 for ; Wed, 30 Sep 2020 19:14:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id BC86D55762; Wed, 30 Sep 2020 23:14:51 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-224.phx2.redhat.com [10.3.112.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id 740633782 for ; Wed, 30 Sep 2020 23:14:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601507755; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ds+NqgpX6X6Ab0bAmgYBuYBEm4EHqXuuIeqV2peoAIk=; b=BdwBuiEEehYkOnLYDWgUFXDjXqEKHkIQZk8raJXQpLmf2UuSHTf1NARVDjzVkx1PPLezuR 0mfZrcSqM+Bj5TTchlYEc33tT+1D2MBaLwElMpk/mt4ImRuQFlaIeEtQxSdmuPW1v23hYM r1wlqAAYZUuu/sx8xFg1xBXiWFqBK60= X-MC-Unique: p3vQtdVmO7-P0pRFHC94Ew-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 2/9] util: remove extraneous defined(__linux__) when checking for WITH_LIBNL Date: Wed, 30 Sep 2020 19:14:37 -0400 Message-Id: <20200930231444.409215-3-laine@redhat.com> In-Reply-To: <20200930231444.409215-1-laine@redhat.com> References: <20200930231444.409215-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" WITH_LIBNL will only be defined on Linux platforms (because libnl is a library written to encapsulate parts of netlink, which is a Linux-only API), so it's redundant to write: #if defined(__linux__) && defined(WITH_LIBNL) We can just check for WITH_LIBNL. Signed-off-by: Laine Stump Reviewed-by: Michal Privoznik --- src/util/virnetdev.c | 10 +++++----- src/util/virnetdevbridge.c | 6 +++--- src/util/virnetdevip.c | 6 +++--- src/util/virnetlink.c | 4 ++-- src/util/virnetlink.h | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 07208a1876..737081a12b 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -885,7 +885,7 @@ int virNetDevGetIndex(const char *ifname G_GNUC_UNUSED, #endif /* ! SIOCGIFINDEX */ =20 =20 -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) /** * virNetDevGetMaster: * @ifname: name of interface we're interested in @@ -929,7 +929,7 @@ virNetDevGetMaster(const char *ifname G_GNUC_UNUSED, } =20 =20 -#endif /* defined(__linux__) && defined(WITH_LIBNL) */ +#endif /* defined(WITH_LIBNL) */ =20 =20 #if defined(SIOCGIFVLAN) && defined(WITH_STRUCT_IFREQ) && WITH_DECL_GET_VL= AN_VID_CMD @@ -1473,7 +1473,7 @@ virNetDevSysfsFile(char **pf_sysfs_device_link G_GNUC= _UNUSED, =20 =20 #endif /* !__linux__ */ -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) =20 =20 static virMacAddr zeroMAC =3D { .addr =3D { 0, 0, 0, 0, 0, 0 } }; @@ -2266,7 +2266,7 @@ virNetDevSetNetConfig(const char *linkdev, int vf, } =20 =20 -#else /* defined(__linux__) && defined(WITH_LIBNL) */ +#else /* defined(WITH_LIBNL) */ =20 =20 int @@ -2309,7 +2309,7 @@ virNetDevSetNetConfig(const char *linkdev G_GNUC_UNUS= ED, } =20 =20 -#endif /* defined(__linux__) && defined(WITH_LIBNL) */ +#endif /* defined(WITH_LIBNL) */ =20 VIR_ENUM_IMPL(virNetDevIfState, VIR_NETDEV_IF_STATE_LAST, diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c index 9fec770fb6..d475e4c43d 100644 --- a/src/util/virnetdevbridge.c +++ b/src/util/virnetdevbridge.c @@ -441,7 +441,7 @@ virNetDevBridgeCreateWithIoctl(const char *brname, } #endif =20 -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) int virNetDevBridgeCreate(const char *brname, const virMacAddr *mac) @@ -552,7 +552,7 @@ virNetDevBridgeDeleteWithIoctl(const char *brname) #endif =20 =20 -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) int virNetDevBridgeDelete(const char *brname) { @@ -976,7 +976,7 @@ virNetDevBridgeSetVlanFiltering(const char *brname G_GN= UC_UNUSED, #endif =20 =20 -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) =20 # ifndef NTF_SELF # define NTF_SELF 0x02 diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index 4887ccfcf1..a69567da6f 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -52,7 +52,7 @@ =20 VIR_LOG_INIT("util.netdevip"); =20 -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) =20 static int virNetDevGetIPAddressBinary(virSocketAddr *addr, void **data, size_t *len) @@ -373,7 +373,7 @@ virNetDevIPRouteAdd(const char *ifname, } =20 =20 -#else /* defined(__linux__) && defined(WITH_LIBNL) */ +#else /* defined(WITH_LIBNL) */ =20 =20 int @@ -494,7 +494,7 @@ virNetDevIPRouteAdd(const char *ifname, return 0; } =20 -#endif /* defined(__linux__) && defined(HAVE_LIBNL) */ +#endif /* defined(HAVE_LIBNL) */ =20 =20 #if defined(__linux__) diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index be444baa56..ea06db51ee 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -40,7 +40,7 @@ VIR_LOG_INIT("util.netlink"); =20 #define NETLINK_ACK_TIMEOUT_S (2*1000) =20 -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) /* State for a single netlink event handle */ struct virNetlinkEventHandle { int watch; @@ -1387,4 +1387,4 @@ virNetlinkGetErrorCode(struct nlmsghdr *resp G_GNUC_U= NUSED, return -EINVAL; } =20 -#endif /* __linux__ */ +#endif /* WITH_LIBNL */ diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h index 40f27524f6..7121eac43e 100644 --- a/src/util/virnetlink.h +++ b/src/util/virnetlink.h @@ -22,7 +22,7 @@ #include "internal.h" #include "virmacaddr.h" =20 -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) =20 # include =20 @@ -36,7 +36,7 @@ struct sockaddr_nl; struct nlattr; struct nlmsghdr; =20 -#endif /* __linux__ */ +#endif /* WITH_LIBNL */ =20 #define NETLINK_MSG_NEST_START(msg, container, attrtype) \ do { \ --=20 2.26.2 From nobody Mon Nov 25 12:16:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601507826; cv=none; d=zohomail.com; s=zohoarc; b=b6ogyySLKsONLLMMvpFhLGBXAPLy/E9iIOKKHxW/O6COl3GbTPx+fAaJF+Oa7n/Vs/rxWsQRLr7YxlhW/cZ2FJWbjKci8XN4lOFvdqeSH5foKu2Z/wGlzo5ogPaMijBOSLdkapQaT05yss+tWJUb8fvfoUTkIEivM52V66EUR0U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601507826; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Iw+7lvTwzWgygI2w0vvSVJSNL1Fik6pG4YyXv8RiEJ0=; b=SqZEJLo7fiDEMt3uaKMneL1725HwVUwySlaXHDr+yulls2dERAuDSo5twiqIae/MfYXkF82gr5nWuh1fOVrYubQE9K7C682pt9UfAA1RSly3bKeRqlL4V0lbQLHAoSuTDz+wEIrmCr91D50H5CHs7sxN9yyuGxMV9jrK8FMUr3A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 160150782685833.52443455560831; Wed, 30 Sep 2020 16:17:06 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-238-i_jS0CHQN9O30McExIKWeA-1; Wed, 30 Sep 2020 19:17:03 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 78F0F1DE00; Wed, 30 Sep 2020 23:16:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 57ADD5C1CF; Wed, 30 Sep 2020 23:16:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 263C0183D026; Wed, 30 Sep 2020 23:16:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08UNEqj4028003 for ; Wed, 30 Sep 2020 19:14:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3B5E73782; Wed, 30 Sep 2020 23:14:52 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-224.phx2.redhat.com [10.3.112.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id E969A5578A for ; Wed, 30 Sep 2020 23:14:51 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601507825; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Iw+7lvTwzWgygI2w0vvSVJSNL1Fik6pG4YyXv8RiEJ0=; b=NxX2WDSlTXWv5JoyTvOXmUQ20Q3a4G0cB8LCT+COVwOQcoRSsZglh2KHC/IGAvIXcahRzm GQVuaYgGvCH5ioqtep8LMVWLT6odjv2s+HYE8Fbb0pL8I2wHd2Rnv9xKz3Q205RBnTEEs5 JlpaF4gVkb63rje3cAJcA0gP8nKrnI0= X-MC-Unique: i_jS0CHQN9O30McExIKWeA-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 3/9] build: eliminate useless WITH_VIRTUALPORT check Date: Wed, 30 Sep 2020 19:14:38 -0400 Message-Id: <20200930231444.409215-4-laine@redhat.com> In-Reply-To: <20200930231444.409215-1-laine@redhat.com> References: <20200930231444.409215-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" WITH_VIRTUALPORT just checks that we are building on Linux and that IFLA_PORT_MAX is defined in linux/if_link.h. Back when 802.11Qb[gh] support was added, the IFLA_* stuff was new (introduced in kernel 2.6.35, backported to RHEL6 2.6.32 kernel at some point), and so this extra check was necessary, because libvirt was being built on Linux distros that didn't yet have IFLA_* (e.g. older RHEL6, all RHEL5). It's been in the kernel for a *very* long time now, so all supported versions of all Linux platforms libvirt builds on have it. Note that the above paragraph implies that the conditional compilation should be changed to #if defined(__linux__). However, the astute reader will notice that the code in question is sending and receiving netlink messages, so it really should be conditional on WITH_LIBNL (which implies __linux__) instead, so that's what this patch does. Signed-off-by: Laine Stump Reviewed-by: Michal Privoznik --- meson.build | 8 -------- src/util/virnetdevvportprofile.c | 8 ++++---- tools/virsh.c | 3 --- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/meson.build b/meson.build index 2e57a435df..073ea6d49e 100644 --- a/meson.build +++ b/meson.build @@ -1386,14 +1386,6 @@ endif =20 util_dep =3D cc.find_library('util', required: false) =20 -if not get_option('virtualport').disabled() - if cc.has_header_symbol('linux/if_link.h', 'IFLA_PORT_MAX') - conf.set('WITH_VIRTUALPORT', 1) - elif get_option('virtualport').enabled() - error('Installed linux headers don\'t show support for virtual port su= pport.') - endif -endif - if host_machine.system() =3D=3D 'windows' ole32_dep =3D cc.find_library('ole32') oleaut32_dep =3D cc.find_library('oleaut32') diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprof= ile.c index 020683fa04..5dae8aa57d 100644 --- a/src/util/virnetdevvportprofile.c +++ b/src/util/virnetdevvportprofile.c @@ -46,7 +46,7 @@ VIR_ENUM_IMPL(virNetDevVPortProfileOp, "no-op", ); =20 -#if WITH_VIRTUALPORT +#if defined(WITH_LIBNL) =20 # include =20 @@ -454,7 +454,7 @@ int virNetDevVPortProfileMerge3(virNetDevVPortProfilePt= r *result, } =20 =20 -#if WITH_VIRTUALPORT +#if defined(WITH_LIBNL) =20 static struct nla_policy ifla_port_policy[IFLA_PORT_MAX + 1] =3D { @@ -1343,7 +1343,7 @@ virNetDevVPortProfileDisassociate(const char *macvtap= _ifname, return rc; } =20 -#else /* ! WITH_VIRTUALPORT */ +#else /* !WITH_LIBNL */ int virNetDevVPortProfileAssociate(const char *macvtap_ifname G_GNUC_UNUSE= D, const virNetDevVPortProfile *virtPort G= _GNUC_UNUSED, const virMacAddr *macvtap_macaddr G_GNU= C_UNUSED, @@ -1369,4 +1369,4 @@ int virNetDevVPortProfileDisassociate(const char *mac= vtap_ifname G_GNUC_UNUSED, _("Virtual port profile association not supported= on this platform")); return -1; } -#endif /* ! WITH_VIRTUALPORT */ +#endif /* !WITH_LIBNL */ diff --git a/tools/virsh.c b/tools/virsh.c index ac9b7ad238..954778b626 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -548,9 +548,6 @@ virshShowVersion(vshControl *ctl G_GNUC_UNUSED) #endif #ifdef WITH_NWFILTER vshPrint(ctl, " Nwfilter"); -#endif -#ifdef WITH_VIRTUALPORT - vshPrint(ctl, " VirtualPort"); #endif vshPrint(ctl, "\n"); =20 --=20 2.26.2 From nobody Mon Nov 25 12:16:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601507881; cv=none; d=zohomail.com; s=zohoarc; b=gtKXitV0JZmKXClSqmrec8u2zKH3qXv1t9r6ay6rR6Z5NCffJsyDZOjdXsEWcT/pIQrUTRn+zoP6gIV/vmNXsKS1c849qv8jc0bBV1T9qIOrqSv4aFx2RprZdVNV1h5n5xHAMzYLRzCjnxW1LKnCYWU8yq0a8jYnV1mKoxcB7Ko= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601507881; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0KS7L3q96Q512R478G/YRbXiRNYpvpOl4Cvpi/BikGY=; b=MQhzIVNhfRyvzfyOu0XNYjyy10c5VuzLJlc6QRS4Ki5rA/uwJUzdnMtrhg9Z0LH1ePjt2Q+xhqsiV7gPm9AWmwi00P4wXLkJivficYSii1NLAr3W/YpuGWRv8ldYLkrvZykwBGN77GFyaIugm3WdINeyXvH++Zxwmc+TkB3NUKw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 160150788168617.514769439928045; Wed, 30 Sep 2020 16:18:01 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-317-bvpVxqusM--iL53aXy-x1A-1; Wed, 30 Sep 2020 19:17:58 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 67CE81DE0E; Wed, 30 Sep 2020 23:17:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 493A355762; Wed, 30 Sep 2020 23:17:52 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1B555183D023; Wed, 30 Sep 2020 23:17:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08UNEqPt028012 for ; Wed, 30 Sep 2020 19:14:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id AF96D55762; Wed, 30 Sep 2020 23:14:52 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-224.phx2.redhat.com [10.3.112.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67FBD3782 for ; Wed, 30 Sep 2020 23:14:52 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601507880; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=0KS7L3q96Q512R478G/YRbXiRNYpvpOl4Cvpi/BikGY=; b=M0jYUMBj1PQLNilOiDAOsNw3Kyzlq7pYujwc8tnzq9/vcxpDDpc6ZcH/29AgMa0+zJH/g6 PlCZWZZyDxRDbfRfuOQioXmWr+3n7W7FqtY6vQzwBKgVkePOnxuW5POYwfE4iubd6ZBn+3 H9Td7cIIu4IF8Mrv6k3PjEzpNEj57Lc= X-MC-Unique: bvpVxqusM--iL53aXy-x1A-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 4/9] build: remove check for MACVLAN_MODE_PASSTHRU Date: Wed, 30 Sep 2020 19:14:39 -0400 Message-Id: <20200930231444.409215-5-laine@redhat.com> In-Reply-To: <20200930231444.409215-1-laine@redhat.com> References: <20200930231444.409215-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" macvlan support was added to the Linux kernel in 2.6.33, but MACVLAN_MODE_PASSTHRU wasn't added until 2.6.38, so a workaround had been put in place to define that constant on those few systems where it was missing. It's useful like was probably 6 months at most, but it's been there for over 10 years. Signed-off-by: Laine Stump Reviewed-by: Michal Privoznik --- meson.build | 4 ---- src/util/virnetdevmacvlan.c | 5 ----- 2 files changed, 9 deletions(-) diff --git a/meson.build b/meson.build index 073ea6d49e..5e0af76bbc 100644 --- a/meson.build +++ b/meson.build @@ -1172,10 +1172,6 @@ if not get_option('macvtap').disabled() endif if use_macvtap conf.set('WITH_MACVTAP', 1) - - if cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_PASSTHRU') - conf.set('WITH_DECL_MACVLAN_MODE_PASSTHRU', 1) - endif endif =20 netcf_version =3D '0.1.8' diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index 143e1ab98c..889cbb2293 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -47,11 +47,6 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode, # include # include =20 -/* Older kernels lacked this enum value. */ -# if !WITH_DECL_MACVLAN_MODE_PASSTHRU -# define MACVLAN_MODE_PASSTHRU 8 -# endif - # include "viralloc.h" # include "virlog.h" # include "viruuid.h" --=20 2.26.2 From nobody Mon Nov 25 12:16:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601507830; cv=none; d=zohomail.com; s=zohoarc; b=gEcSmcUm2jAiqHxWmhdnydlenkMCoqMs5x/oaeUv47fy6/Hh9GvXexcL78kD6iNl748d5bcXpcUdSKCNXgk9dQysNyxyyjAW1cVG3Py+EidHs3dpjPEYF5LMhUxeGq5+kTxt3U4RlPSIN5wa7v6kVWByZZpBGvADOEEVR0pZNBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601507830; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=K3oY2rj3cFYmEibd0u1Yox0K4lyXNcV29HMziCUH0dk=; b=mswMb41xvRZYwEjs95FpCKO36QJbatCpg4tOdD/SkfyAEsJmNYiYnZZ3jycrQe6vMQxPsyyiWME3f7Rz0Hh7nApe8hFEK3at7HlYlHeU7JJNdxWHd40qOPAUsQuCBkUCFLidZ9WQJxlLYk8QRb2tFzic20EgFuWPsIUjJ5Le4OM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1601507830605669.9475786259286; Wed, 30 Sep 2020 16:17:10 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-117-ullzjNpeNSOHZMbsTe8ZQw-1; Wed, 30 Sep 2020 19:17:07 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2EED8802B7C; Wed, 30 Sep 2020 23:17:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 092B319C59; Wed, 30 Sep 2020 23:17:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CA9AC183D027; Wed, 30 Sep 2020 23:17:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08UNEriU028019 for ; Wed, 30 Sep 2020 19:14:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2F1AA55762; Wed, 30 Sep 2020 23:14:53 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-224.phx2.redhat.com [10.3.112.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id DCAAB3782 for ; Wed, 30 Sep 2020 23:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601507829; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=K3oY2rj3cFYmEibd0u1Yox0K4lyXNcV29HMziCUH0dk=; b=Uttod+Ru4bK2ZwOrmVq/wJL+dBbz2xaPlErAkjie88t224SYYJT+QQrJfZ/jw5D+AKZJ83 UUh1Uh2ivh37Mrz072WLGGQuGRdWsybm4fPpY+9vJeh0f4YX8AYjouAC+7HSqlE7W5s2zG o/TyIz5xvYGkD0uL3Bjt1Emf1yfmbsw= X-MC-Unique: ullzjNpeNSOHZMbsTe8ZQw-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 5/9] build: simplify check for WITH_MACVTAP Date: Wed, 30 Sep 2020 19:14:40 -0400 Message-Id: <20200930231444.409215-6-laine@redhat.com> In-Reply-To: <20200930231444.409215-1-laine@redhat.com> References: <20200930231444.409215-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" macvtap support was added to the Linux kernel in 2.6.33. libvirt checked for this by looking for MACVLAN_MODE_BRIDGE and IFLA_VF_MAX in linux/if_link.h. This hasn't been necessary for a very long time, so just gate on platform =3D=3D 'linux' (and be sure to complain if someone tries to enable it on a non-Linux platform). Signed-off-by: Laine Stump Reviewed-by: Michal Privoznik --- meson.build | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index 5e0af76bbc..fe08a45b46 100644 --- a/meson.build +++ b/meson.build @@ -1159,20 +1159,15 @@ libxml_dep =3D dependency('libxml-2.0', version: '>= =3D' + libxml_version) cc =3D meson.get_compiler('c') m_dep =3D cc.find_library('m', required : false) =20 -use_macvtap =3D false -if not get_option('macvtap').disabled() - if (cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_BRIDGE') and - cc.has_header_symbol('linux/if_link.h', 'IFLA_VF_MAX')) - use_macvtap =3D true +if host_machine.system() =3D=3D 'linux' + if not get_option('macvtap').disabled() + conf.set('WITH_MACVTAP', 1) endif - - if get_option('macvtap').enabled() and not use_macvtap - error('Installed linux headers don\'t show support for macvtap device.= ') +else + if get_option('macvtap').enabled() + error('macvtap is not supported on this platform.') endif endif -if use_macvtap - conf.set('WITH_MACVTAP', 1) -endif =20 netcf_version =3D '0.1.8' netcf_dep =3D dependency('netcf', version: '>=3D' + netcf_version, require= d: get_option('netcf')) --=20 2.26.2 From nobody Mon Nov 25 12:16:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601507760; cv=none; d=zohomail.com; s=zohoarc; b=VLXKwDaf2l9U4TRoN5tOAxQYBjRuLJ8hlUFc8yzci5GyMl3kSjkUu4/QCtL+nj3J8G0cRZLT5UUw3JUyj4whKrttaKnDY9AZr/RldVyWrlaUantnJA0g3+pkNVXGLxric6BpS8Pe6xireS9ImnFQFTMlXHkz2K1FJQ2KUZnzyuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601507760; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CrJguFjt9HUeu9BT8ya+bF9UrDg2l8X67UDV/VfayzU=; b=AyohtCFRKBm0W5PYqFLsx8ggc3K6b2sF66iD0EYCNWuKOYGdsldUB+qUkzM36JO4TO0sxHcCkeE04sy4feSS0km181jQu5EeJggltMzgYqOU6ScXUvcqzAlXJDE56HB5frTM7aHfN/R8FPOaejNBOQ9wKRvWyDKW/Kl4jWJBozE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1601507760449352.4688372290391; Wed, 30 Sep 2020 16:16:00 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-30-HTVooU7yOBSpJrIwd69QLg-1; Wed, 30 Sep 2020 19:15:55 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 89A5A1074666; Wed, 30 Sep 2020 23:15:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 66C955579F; Wed, 30 Sep 2020 23:15:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1B8A5183D021; Wed, 30 Sep 2020 23:15:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08UNEreg028024 for ; Wed, 30 Sep 2020 19:14:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id A18FE3782; Wed, 30 Sep 2020 23:14:53 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-224.phx2.redhat.com [10.3.112.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BBA25578A for ; Wed, 30 Sep 2020 23:14:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601507759; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=CrJguFjt9HUeu9BT8ya+bF9UrDg2l8X67UDV/VfayzU=; b=RNQl3GCL6hXAZqA+7AM3L0DcfOdA7qwxW/tNzUvdwPk7wSIRGBu2BU3QxbU841cjrVs96l zV46obSlImW4+ffOVPz/nt8wEGRwftwHrVIwhTlD/472751cQDt5z0NUr9y3zGay8/4OHj TcJ1QvV3Tj+3KCEItoj0EmWXDdKRlHY= X-MC-Unique: HTVooU7yOBSpJrIwd69QLg-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 6/9] build: eliminate WITH_MACVTAP flag Date: Wed, 30 Sep 2020 19:14:41 -0400 Message-Id: <20200930231444.409215-7-laine@redhat.com> In-Reply-To: <20200930231444.409215-1-laine@redhat.com> References: <20200930231444.409215-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This flag was originally created to indicate that either 1) the build platform wasn't linux, 2) the build platform was linux, but the kernel was too old to have macvtap support; since there was already a switch there, the ability to also disable it in case 3) the kernel supported macvtap but the user didn't want it, was added in. I don't think that (3) was ever an intentional goal, just something that grew naturally out of having the flag there in the first place (unless possibly the original author wanted a way to quickly disable their new code in case it caused regressions elsewhere). Now that the check for (2) has been removed, WITH_MACVTAP is just checking (1) and (3), but (3) is pointless (since it adds almost nothing extra in size to the code). We can therfore eliminate the WITH_MACVTAP flag, as it is equivalent to __linux__. *However*, macvtap/macvlan devices are created using netlink messages, and any netlink interaction in libvirt requires libnl. So what we *really* need is to check WITH_LIBNL (which itself implies __linux__, as libnl is only useful/available on Linux). Signed-off-by: Laine Stump Reviewed-by: Michal Privoznik --- libvirt.spec.in | 1 - meson.build | 10 ---------- src/util/virnetdevmacvlan.c | 6 +++--- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index c4a7c30737..aa2bc84be9 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1167,7 +1167,6 @@ export SOURCE_DATE_EPOCH=3D$(stat --printf=3D'%Y' %{_= specdir}/%{name}.spec) -Dyajl=3Denabled \ %{?arg_sanlock} \ -Dlibpcap=3Denabled \ - -Dmacvtap=3Denabled \ -Daudit=3Denabled \ -Ddtrace=3Denabled \ %{?arg_firewalld} \ diff --git a/meson.build b/meson.build index fe08a45b46..a6b6f2d2ee 100644 --- a/meson.build +++ b/meson.build @@ -1159,16 +1159,6 @@ libxml_dep =3D dependency('libxml-2.0', version: '>= =3D' + libxml_version) cc =3D meson.get_compiler('c') m_dep =3D cc.find_library('m', required : false) =20 -if host_machine.system() =3D=3D 'linux' - if not get_option('macvtap').disabled() - conf.set('WITH_MACVTAP', 1) - endif -else - if get_option('macvtap').enabled() - error('macvtap is not supported on this platform.') - endif -endif - netcf_version =3D '0.1.8' netcf_dep =3D dependency('netcf', version: '>=3D' + netcf_version, require= d: get_option('netcf')) if netcf_dep.found() diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index 889cbb2293..25eb53c5da 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -40,7 +40,7 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode, "passthrough", ); =20 -#if WITH_MACVTAP +#if defined(WITH_LIBNL) # include =20 # include @@ -1051,7 +1051,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const cha= r *cr_ifname, =20 } =20 -#else /* ! WITH_MACVTAP */ +#else /* ! WITH_LIBNL */ bool virNetDevMacVLanIsMacvtap(const char *ifname G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -1157,4 +1157,4 @@ void virNetDevMacVLanReserveName(const char *name G_G= NUC_UNUSED) virReportSystemError(ENOSYS, "%s", _("Cannot create macvlan devices on this platform= ")); } -#endif /* ! WITH_MACVTAP */ +#endif /* ! WITH_LIBNL */ --=20 2.26.2 From nobody Mon Nov 25 12:16:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601507824; cv=none; d=zohomail.com; s=zohoarc; b=HI2n1GtDJOwPIOIxqH43qLdjW/sMrl9bQTYmuI3asTL29vpwzvObh/MCZI+TuHgefupMMk1hiFVbTnewTprsn1vSh3N1RFjDhE1ViCa1zC2ra+X65JRxsvXSAv9Aoi9UTfskUmpbB/pLuG+x7tQ7GCJnKQIwSuTtpfHxZfcCHFk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601507824; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NqkpvpxoSA1EXISZUAb062wv7CcId3wLMMPW52V0opE=; b=lfP1vmWod0OvJ4gU6GF5N+C6bPGunU4+IEHUaEGOZbZTJQ6lTCY1gg7AT9EKRQcx1ZhqnMi9ddut06o0cizu1MMgNOKrwX5sNbMNdh5WAFwGZHgqJBoOxH5kx2o+Utr676MndqahUJaKL9aznAXz7pof3FzPzRvtDXpURzsE6XU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1601507824554939.0889728762498; Wed, 30 Sep 2020 16:17:04 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-586-0hEQqzOGN72IZmhd_MEQeA-1; Wed, 30 Sep 2020 19:15:54 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 05A6B2FD02; Wed, 30 Sep 2020 23:15:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D56F410013C0; Wed, 30 Sep 2020 23:15:49 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A403B183D024; Wed, 30 Sep 2020 23:15:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08UNEs7t028030 for ; Wed, 30 Sep 2020 19:14:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1F14355762; Wed, 30 Sep 2020 23:14:54 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-224.phx2.redhat.com [10.3.112.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE4FB3782 for ; Wed, 30 Sep 2020 23:14:53 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601507823; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=NqkpvpxoSA1EXISZUAb062wv7CcId3wLMMPW52V0opE=; b=DSXYHOOa3W5akfoC2/xtDLkI9fBl9b/NSg+9/GgMV8MPaa4ulZkTtrnXFTdB7GomnaMfTO s8Vk/Kt/uKHAR18P3I2ZG6oDM2OYcKoKF6Ck4tuHWpTEtMgCWkE9sSVy99jodZDIn65iCg V18RER8kAtXiEJPTB0xF5bI072pnF+g= X-MC-Unique: 0hEQqzOGN72IZmhd_MEQeA-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 7/9] util: fix Linux build when libnl-devel isn't available Date: Wed, 30 Sep 2020 19:14:42 -0400 Message-Id: <20200930231444.409215-8-laine@redhat.com> In-Reply-To: <20200930231444.409215-1-laine@redhat.com> References: <20200930231444.409215-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There was one stray bit of code in virnetdev.c that required libnl to build, but wasn't qualified by defined(WITH_LIBNL). Adding that, plus putting a similar check around a static function only used by that aforementioned code, makes libvirt build properly without libnl-devel installed. How useful it is in that state is a separate issue :-) Signed-off-by: Laine Stump Reviewed-by: Michal Privoznik --- src/util/virnetdev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 737081a12b..5221bada7b 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -1058,6 +1058,9 @@ virNetDevSysfsDeviceFile(char **pf_sysfs_device_link,= const char *ifname, return 0; } =20 + +# if defined(WITH_LIBNL) + /** * Determine if the device path specified in devpath is a PCI Device * by resolving the 'subsystem'-link in devpath and looking for @@ -1091,6 +1094,7 @@ virNetDevIsPCIDevice(const char *devpath) return STRPREFIX(subsys, "pci"); } =20 + static virPCIDevicePtr virNetDevGetPCIDevice(const char *devName) { @@ -1110,6 +1114,7 @@ virNetDevGetPCIDevice(const char *devName) return virPCIDeviceNew(vfPCIAddr->domain, vfPCIAddr->bus, vfPCIAddr->slot, vfPCIAddr->function); } +# endif =20 =20 /** @@ -2958,7 +2963,7 @@ virNetDevGetEthtoolFeatures(const char *ifname, } =20 =20 -# if WITH_DECL_DEVLINK_CMD_ESWITCH_GET +# if defined(WITH_LIBNL) && WITH_DECL_DEVLINK_CMD_ESWITCH_GET =20 /** * virNetDevGetFamilyId: --=20 2.26.2 From nobody Mon Nov 25 12:16:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601507761; cv=none; d=zohomail.com; s=zohoarc; b=AgxoKlpwU9B6/jbjhQMi7Q1iQQerIHaPUvCQGT0430hk3ToVN0EMrVMKvAuou8yhDA/ux50HaPCPfRcdmb1MKXm/Xbha9G3BJ3r0E5Px4vmBChGQJKY/FMqVLET5fJEvZQhU0kLYI7kweibRBSGk2Mr8YmixdflWHGPfpkDaIbs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601507761; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TM2m5udcDbDFaWKzkXfEIuVEi8/HlhX/MosX6BoO2OE=; b=X2C6L5qrEv4Wi3n8+73E2ECezcuuS3Oq4FcuPz4f2If5u/D2x4/jyrpJAKN3mMIXSFY7nGkg2aj2QTveneqTey+bCmYqIUK+Ivyb9nLEtMOH3NxbrVzbmCCMCcU2xbVGfQqyC/Ml/l6T5k6GGwjkk8vs5LVPvUQpkmpg9CaxSa0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1601507761358435.22539248235273; Wed, 30 Sep 2020 16:16:01 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-319-unsB082oPNa7vdZKihjSVA-1; Wed, 30 Sep 2020 19:15:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 77194100963E; Wed, 30 Sep 2020 23:15:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5540E5D9DD; Wed, 30 Sep 2020 23:15:52 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 24579183D026; Wed, 30 Sep 2020 23:15:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08UNEsUu028038 for ; Wed, 30 Sep 2020 19:14:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9155A55762; Wed, 30 Sep 2020 23:14:54 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-224.phx2.redhat.com [10.3.112.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C10E3782 for ; Wed, 30 Sep 2020 23:14:54 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601507760; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=TM2m5udcDbDFaWKzkXfEIuVEi8/HlhX/MosX6BoO2OE=; b=QXnNL6jLJaEyn6eiaNdgFqcZc3MOh8UqeMQtN0k1gaKPE8L8RXSKC5Grqy86nvNb5peh7v lwxfrDjVKxD0T55tjOKCHNHLQaeb/Tsoe53mZTQvJKn8QUAs/vlEfm9dsIxzaA40KbcbCb VYnM2FwvyoE6RwLRo6pzFGrrlFfngdA= X-MC-Unique: unsB082oPNa7vdZKihjSVA-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 8/9] util: provide non-netlink/libnl alternative for virNetDevGetMaster() Date: Wed, 30 Sep 2020 19:14:43 -0400 Message-Id: <20200930231444.409215-9-laine@redhat.com> In-Reply-To: <20200930231444.409215-1-laine@redhat.com> References: <20200930231444.409215-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Lack of this one function (which is called for each active tap device every time libvirtd is started) is the one thing preventing a "WITHOUT_LIBNL" build of libvirt from being useful. With this alternate implementation, guests using standard tap devices will work properly. Signed-off-by: Laine Stump Reviewed-by: Michal Privoznik --- src/util/virnetdev.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 5221bada7b..c43823c747 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -915,9 +915,30 @@ virNetDevGetMaster(const char *ifname, char **master) return 0; } =20 +#elif defined(__linux__) =20 -#else +/* libnl isn't available, so we can't use netlink. + * Fall back to using sysfs + */ +int +virNetDevGetMaster(const char *ifname, char **master) +{ + g_autofree char *path =3D NULL; + g_autofree char *canonical =3D NULL; + + if (virNetDevSysfsFile(&path, ifname, "master") < 0) + return -1; =20 + if (!(canonical =3D virFileCanonicalizePath(path))) + return -1; + + *master =3D g_path_get_basename(canonical); + + VIR_DEBUG("IFLA_MASTER for %s is %s", ifname, *master ? *master : "(no= ne)"); + return 0; +} + +#else =20 int virNetDevGetMaster(const char *ifname G_GNUC_UNUSED, --=20 2.26.2 From nobody Mon Nov 25 12:16:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601507833; cv=none; d=zohomail.com; s=zohoarc; b=WbodzzXOTUQm6Id1wfxRefKGgPg3gLTXhgL2jQESh0bEDEcfKODse+il6jYR3wy3Hyx5Si944a079GmSGsTGwKUZa66xUnjSGaDXO5cxQM+yJ3oYXVAQIkCcL0bWUfpVg38CeCrGrkL6o4DQ/cWI1yhgpGglCEIc3dWVTNFoKD4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601507833; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Kt0Hn3XP+lVt6VdGRemtTiUCiBZkZeFcAoEVQQfUM+M=; b=DgTMmZqU9lIHoga45+fuI/pMOxE2YUHAqWYfb9vxBcmg0+Fh0Cwo7SKdmKqFYRZa8xxYRPMocz6ijUsZ0YD8Q0XE2Up+7SJ6FHvHqZwOPykzEL8mkv1jeft8TfYVw0ESV0QJQcxG58Z4qlEK7uqtBLyv18Ahi4AJ34fzLQ53epA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1601507833902378.0596487982351; Wed, 30 Sep 2020 16:17:13 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-594-jbSjScmXP0Kpp_xAgeF1qg-1; Wed, 30 Sep 2020 19:17:08 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B668C803657; Wed, 30 Sep 2020 23:17:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 962207C83D; Wed, 30 Sep 2020 23:17:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5D5FA44A4C; Wed, 30 Sep 2020 23:17:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08UNEtog028043 for ; Wed, 30 Sep 2020 19:14:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1125F5576C; Wed, 30 Sep 2020 23:14:55 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-224.phx2.redhat.com [10.3.112.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFAFF3782 for ; Wed, 30 Sep 2020 23:14:54 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601507832; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Kt0Hn3XP+lVt6VdGRemtTiUCiBZkZeFcAoEVQQfUM+M=; b=IKsx57cccaXdtNsDw5gYRMclNscDAByrMok6vSP7+vkqZcmplN0h3OGoGanhhI5zwWBEAQ 2p82cqhOwnWlMNAjGsAoiBv+hy76ItxOgaVfg3BR+MzQw6IHP6StfDp0FDogCzyWGqRtkn TUZ/T/VRIe62rBGGt8BfhEhi3BiYqMg= X-MC-Unique: jbSjScmXP0Kpp_xAgeF1qg-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 9/9] build: remove duplicate check for GET_VLAN_VID_CMD Date: Wed, 30 Sep 2020 19:14:44 -0400 Message-Id: <20200930231444.409215-10-laine@redhat.com> In-Reply-To: <20200930231444.409215-1-laine@redhat.com> References: <20200930231444.409215-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Somehow this check was duplicated just below the original. (I was at first skeptical that it's needed at all, since GET_VLAN_VID_CMD was already present in kernel 2.6.32, but then I realized that there is no higher level check for __linux__ around the code that is conditional on WITH_DECL_GET_VLAN_VID_CMD; it only checks for SIOCGIFVLAN and WITH_STRUCT_IFREQ - the latter is also present on *BSD platforms, the former doesn't seem to be anywhere but Linux, but I didn't want to change the effect of the conditional, so I left it in (we could have also replaced WITH_DECL_VET_VLAN_VID_CMD, but possibly there is a non-Linux platform that *does* have it...) Signed-off-by: Laine Stump Reviewed-by: Michal Privoznik --- meson.build | 3 --- 1 file changed, 3 deletions(-) diff --git a/meson.build b/meson.build index a6b6f2d2ee..fa19677fee 100644 --- a/meson.build +++ b/meson.build @@ -774,9 +774,6 @@ symbols =3D [ =20 [ 'unistd.h', 'SEEK_HOLE' ], =20 - # GET_VLAN_VID_CMD is required for virNetDevGetVLanID - [ 'linux/if_vlan.h', 'GET_VLAN_VID_CMD' ], - # Check for BSD approach for setting MAC addr [ 'net/if_dl.h', 'link_addr', '#include \n#include ' ], ] --=20 2.26.2