From nobody Tue May 21 12:47:16 2024 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=1602774584; cv=none; d=zohomail.com; s=zohoarc; b=dB7l/HakfpzJKXvUuc53en93ddmFWsIVrr2dQ+AZmL5wep2JcJgLY/SIJC8D94Jms92S7U/KqrlBGObJYW670hupijIR8gUrxaG+g9l3C7PEIJpfCtJwBdqrvJkSrp65a5dmc3OSrzQseuSsGwCuqUdwjucs/sq1NKnkTo8fid8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602774584; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=aHXs2qmOvoMB+8IbkG6OUscwpnMvDrMqMCjXMdfsyK0=; b=dJZDp9+0e1V3FAxI4J/NkVfWBO0up+JRfuRk8d1KZ6sHAY6iLzhoac95pAImK3bJgaYhSyMwHmDBS+QV3AYmtPIsdVj1At02IKgauE1ASF2rHkF6iRfLL0YeSQWEayKIjgX6P20tv9FbCZRVuTxwmFgHbYMr9xDxWA1J9Oa31bg= 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 1602774584702189.38782362913196; Thu, 15 Oct 2020 08:09:44 -0700 (PDT) Received: from localhost ([::1]:54752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT4sw-0001F7-VZ for importer@patchew.org; Thu, 15 Oct 2020 11:09:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT4q8-0006eu-Oo for qemu-devel@nongnu.org; Thu, 15 Oct 2020 11:06:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kT4q4-0004Ac-Gg for qemu-devel@nongnu.org; Thu, 15 Oct 2020 11:06:47 -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-457-4-Zqu5VfOTmkWMm-JkabVA-1; Thu, 15 Oct 2020 11:06:39 -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 D917B18C89C2; Thu, 15 Oct 2020 15:06:38 +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 914BA5D9F3; Thu, 15 Oct 2020 15:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602774403; 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; bh=aHXs2qmOvoMB+8IbkG6OUscwpnMvDrMqMCjXMdfsyK0=; b=csx+TU1IXEVBq6vgrACW7RVfdnPB69kEUk4MO9TTaEJYi/lrnZ+0KeZ0r4vAXTu+leA3Pv WgdjONixFb+Wv6DH2+MC4t/023Ijwz5hrG1bRtR0eHX9QT+FljSDslhwIjTjfxJAyrYv8i BuQmxWqxcPgIUPhTk+4a4hIrkJQ4ulk= X-MC-Unique: 4-Zqu5VfOTmkWMm-JkabVA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH] build: add --enable/--disable-libudev Date: Thu, 15 Oct 2020 11:06:38 -0400 Message-Id: <20201015150638.1396659-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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 02:38:26 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 | 29 ++++++++++++++++------------- meson_options.txt | 2 ++ 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/configure b/configure index b553288c5e..05b246cd24 100755 --- a/configure +++ b/configure @@ -302,6 +302,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" @@ -1004,6 +1005,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" @@ -1761,6 +1766,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 @@ -7216,7 +7222,7 @@ NINJA=3D${ninja:-$PWD/ninjatool} $meson setup \ -Dxen=3D$xen -Dxen_pci_passthrough=3D$xen_pci_passthrough -Dtcg=3D$tcg \ -Dcocoa=3D$cocoa -Dmpath=3D$mpath -Dsdl=3D$sdl -Dsdl_image=3D$sdl_image \ -Dvnc=3D$vnc -Dvnc_sasl=3D$vnc_sasl -Dvnc_jpeg=3D$vnc_jpeg -Dvnc_png=3D$v= nc_png \ - -Dgettext=3D$gettext -Dxkbcommon=3D$xkbcommon -Du2f=3D$u2f \ + -Dgettext=3D$gettext -Dxkbcommon=3D$xkbcommon -Du2f=3D$u2f -Dlibudev=3D$l= ibudev \ -Dcapstone=3D$capstone -Dslirp=3D$slirp -Dfdt=3D$fdt \ $cross_arg \ "$PWD" "$source_path" diff --git a/meson.build b/meson.build index 652c37cceb..5bcd21a9f4 100644 --- a/meson.build +++ b/meson.build @@ -358,10 +358,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() @@ -392,7 +393,6 @@ if targetos =3D=3D 'linux' and have_tools and not get_o= ption('mpath').disabled() mpath_lib_init(udev); return 0; }''' - mpathlibs =3D [libudev] if enable_static mpathlibs +=3D cc.find_library('devmapper', required: get_option('mpath'), @@ -410,18 +410,21 @@ if targetos =3D=3D 'linux' and have_tools and not get= _option('mpath').disabled() break endif endforeach - if mpathlibs.length() > 0 - if 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) + 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(msg) else - if get_option('mpath').enabled() - error('Cannot detect libmpathpersist API') - else - warning('Cannot detect libmpathpersist API, disabling') - endif + warning(msg + ', disabling') endif endif endif diff --git a/meson_options.txt b/meson_options.txt index 1d3c94840a..5a302fe308 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -32,6 +32,8 @@ option('cocoa', type : 'feature', value : 'auto', description: 'Cocoa user interface (macOS only)') option('mpath', type : 'feature', value : 'auto', description: 'Multipath persistent reservation passthrough') +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