From nobody Mon Feb 9 20:12:35 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1602849146; cv=none; d=zohomail.com; s=zohoarc; b=es3hpH9cF09U0etxKezxTPTBDk43JkXTen5ZfaoydUCf+L/nHVMT+zqGgzACR/QkyUX5f2rt8sPzR29BU07Wc5RLROM65JarK8/90/Dv9Og6HniO39E6WT/FstjZJdmK6BClEdqCZT3TUddRZdxwxNPpdGMf0urJZnHtxy1BTk4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602849146; h=Content-Type:Content-Transfer-Encoding:Cc: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=7HRmR8DrzmfanXflfW4M/oc151NJvYgLvn5iOnqRT2Y=; b=Z/OutAZ2clJ/ULOg4Q7qQGBwepa6xiQmhdMLQx+cRwe5m+d8xnc6Au5MaTEpwF/K6XMlhtKLi5IFeraStE83cTAFevKDrtw9LSwnzdoXD/TGuvT6VEtJEb2i1q9UnojPWPDgyLd6mduEQw8kQ5b7YtqIPo1faApdzR5oTuSwRhk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602849146094208.53986357086728; Fri, 16 Oct 2020 04:52:26 -0700 (PDT) Received: from localhost ([::1]:51094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTOHY-0005Wp-SN for importer@patchew.org; Fri, 16 Oct 2020 07:52:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTODh-0000RU-8s for qemu-devel@nongnu.org; Fri, 16 Oct 2020 07:48:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60767) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kTODe-0002om-Qa for qemu-devel@nongnu.org; Fri, 16 Oct 2020 07:48:24 -0400 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-439-YrK84pQdOcK-yrLNTOXmUw-1; Fri, 16 Oct 2020 07:48:20 -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 3D98A64155; Fri, 16 Oct 2020 11:48:19 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB5A75C1D0; Fri, 16 Oct 2020 11:48:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602848902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7HRmR8DrzmfanXflfW4M/oc151NJvYgLvn5iOnqRT2Y=; b=gwFKZrXW93G959cbJCIE6+ewcBZ0xukY4y0Qr2HJ8AIg3RJXKF5J9HrLLCurQm5O7zMQ40 LpCxTlexCmMkVw11g3MTDK+yCDGDrtatvGdD+ys2o+HPiGzVNNMwmaPe7rl6SBXY/fS6kE wowSw7f2P36F08c1t4ZySrzcJ4TtfBk= X-MC-Unique: YrK84pQdOcK-yrLNTOXmUw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 11/22] build: add --enable/--disable-libudev Date: Fri, 16 Oct 2020 07:48:03 -0400 Message-Id: <20201016114814.1564523-12-pbonzini@redhat.com> In-Reply-To: <20201016114814.1564523-1-pbonzini@redhat.com> References: <20201016114814.1564523-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/15 20:29:24 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Initially, libudev detection was bundled with --enable-mpath because qemu-pr-helper was the only user of libudev. Recently however the USB U2F emulation has also started using libudev, so add a separate option. This also allows 1) disabling libudev if desired for static builds and 2) for non-static builds, requiring libudev even if multipath support is undesirable. The multipath test is adjusted, because it is now possible to enter it with configurations that should fail, such as --static --enable-mpath --disable-libudev. Reported-by: Peter Maydell Signed-off-by: Paolo Bonzini --- configure | 8 +++++++- meson.build | 50 ++++++++++++++++++++++++++--------------------- meson_options.txt | 2 ++ 3 files changed, 37 insertions(+), 23 deletions(-) diff --git a/configure b/configure index 9317349044..c83a2eeb9d 100755 --- a/configure +++ b/configure @@ -303,6 +303,7 @@ netmap=3D"no" sdl=3D"auto" sdl_image=3D"auto" virtfs=3D"" +libudev=3D"auto" mpath=3D"auto" vnc=3D"enabled" sparse=3D"auto" @@ -1002,6 +1003,10 @@ for opt do ;; --enable-virtfs) virtfs=3D"yes" ;; + --disable-libudev) libudev=3D"disabled" + ;; + --enable-libudev) libudev=3D"enabled" + ;; --disable-mpath) mpath=3D"disabled" ;; --enable-mpath) mpath=3D"enabled" @@ -1759,6 +1764,7 @@ disabled with --disable-FEATURE, default is enabled i= f available: vnc-png PNG compression for VNC server cocoa Cocoa UI (Mac OS X only) virtfs VirtFS + libudev Use libudev to enumerate host devices mpath Multipath persistent reservation passthrough xen xen backend driver support xen-pci-passthrough PCI passthrough support for Xen @@ -7060,7 +7066,7 @@ NINJA=3D$ninja $meson setup \ -Dvnc=3D$vnc -Dvnc_sasl=3D$vnc_sasl -Dvnc_jpeg=3D$vnc_jpeg -Dvnc_p= ng=3D$vnc_png \ -Dgettext=3D$gettext -Dxkbcommon=3D$xkbcommon -Du2f=3D$u2f \ -Dcapstone=3D$capstone -Dslirp=3D$slirp -Dfdt=3D$fdt \ - -Diconv=3D$iconv -Dcurses=3D$curses \ + -Diconv=3D$iconv -Dcurses=3D$curses -Dlibudev=3D$libudev\ $cross_arg \ "$PWD" "$source_path" =20 diff --git a/meson.build b/meson.build index 2c93e22382..0c0f4f9fd8 100644 --- a/meson.build +++ b/meson.build @@ -380,10 +380,11 @@ endif libudev =3D not_found if targetos =3D=3D 'linux' and (have_system or have_tools) libudev =3D dependency('libudev', - required: get_option('mpath').enabled(), + required: get_option('libudev'), static: enable_static) endif =20 +mpathlibs =3D [libudev] mpathpersist =3D not_found mpathpersist_new_api =3D false if targetos =3D=3D 'linux' and have_tools and not get_option('mpath').disa= bled() @@ -414,35 +415,40 @@ if targetos =3D=3D 'linux' and have_tools and not get= _option('mpath').disabled() mpath_lib_init(udev); return 0; }''' - mpathlibs =3D [libudev] - if enable_static - mpathlibs +=3D cc.find_library('devmapper', - required: get_option('mpath'), - static: enable_static) - endif - mpathlibs +=3D cc.find_library('multipath', - required: get_option('mpath'), - static: enable_static) - mpathlibs +=3D cc.find_library('mpathpersist', - required: get_option('mpath'), - static: enable_static) - foreach lib: mpathlibs - if not lib.found() - mpathlibs =3D [] - break + libmpathpersist =3D cc.find_library('mpathpersist', + required: get_option('mpath'), + static: enable_static) + if libmpathpersist.found() + mpathlibs +=3D libmpathpersist + if enable_static + mpathlibs +=3D cc.find_library('devmapper', + required: get_option('mpath'), + static: enable_static) endif - endforeach - if mpathlibs.length() > 0 - if cc.links(mpath_test_source_new, dependencies: mpathlibs) + mpathlibs +=3D cc.find_library('multipath', + required: get_option('mpath'), + static: enable_static) + foreach lib: mpathlibs + if not lib.found() + mpathlibs =3D [] + break + endif + endforeach + if mpathlibs.length() =3D=3D 0 + msg =3D 'Dependencies missing for libmpathpersist' + elif cc.links(mpath_test_source_new, dependencies: mpathlibs) mpathpersist =3D declare_dependency(dependencies: mpathlibs) mpathpersist_new_api =3D true elif cc.links(mpath_test_source_old, dependencies: mpathlibs) mpathpersist =3D declare_dependency(dependencies: mpathlibs) else + msg =3D 'Cannot detect libmpathpersist API' + endif + if not mpathpersist.found() if get_option('mpath').enabled() - error('Cannot detect libmpathpersist API') + error(msg) else - warning('Cannot detect libmpathpersist API, disabling') + warning(msg + ', disabling') endif endif endif diff --git a/meson_options.txt b/meson_options.txt index e6cb1e589b..77b3fabd00 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -36,6 +36,8 @@ option('iconv', type : 'feature', value : 'auto', description: 'Font glyph conversion support') option('curses', type : 'feature', value : 'auto', description: 'curses UI') +option('libudev', type : 'feature', value : 'auto', + description: 'Use libudev to enumerate host devices') option('sdl', type : 'feature', value : 'auto', description: 'SDL user interface') option('sdl_image', type : 'feature', value : 'auto', --=20 2.26.2