From nobody Mon Nov 25 15:23:12 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 --- 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