From nobody Thu Apr 18 10:17:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600273664; cv=none; d=zohomail.com; s=zohoarc; b=apIi6vAUVqn8XuyFNCWWjfC3jELGQi4pVxvZxuGQRg1B0Yf3uILbb+crOG1Im8jWZ1vTa5GhOKXrSjbx1CQ0T6hIr52alKbH/8bjfTcZ6Tk2Dhzzn4WnRY//AQuV8JuILQbS5tTlk8SyxSOlqrlFYDLeTKrt0jn8C4XtTbJgzTg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600273664; h=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=iMSNpRYkuxORHU6f+AgXIb0a+Cm9/6sUG5ZTlxMixc8=; b=eIE0jKgAuXUHYAkS1zP2ct2hUscYQfVLhmqoc/SwFkpnvALus4XwJqlovx9bpfC0q/ZIA0qgqCTccdcVAVO4QpGpTtKFnryU4XLXFcK+y49Ed11WseKki09tYtgbWnOuOS7lx0LOewRip/ke8opqphBimwMu24uPh33mEG93N0Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1600273664109502.7889238141436; Wed, 16 Sep 2020 09:27:44 -0700 (PDT) Received: from localhost ([::1]:45406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIaHW-00049l-UR for importer@patchew.org; Wed, 16 Sep 2020 12:27:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIaGL-0003I3-I9 for qemu-devel@nongnu.org; Wed, 16 Sep 2020 12:26:29 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:45278) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIaGJ-0000oc-IT for qemu-devel@nongnu.org; Wed, 16 Sep 2020 12:26:29 -0400 Received: by mail-wr1-x429.google.com with SMTP id x14so7524434wrl.12 for ; Wed, 16 Sep 2020 09:26:26 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:cf8e:a9a0:1aed:9a37]) by smtp.gmail.com with ESMTPSA id v128sm6111933wme.2.2020.09.16.09.26.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 09:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iMSNpRYkuxORHU6f+AgXIb0a+Cm9/6sUG5ZTlxMixc8=; b=fh6/sBm4DHwFK8qczrd19K1rHUAZFiXExf8NAZWMHCO/nnyZ5QrOEiFAGabfQeuinD xkgPHxcfrj4EdUalmW0Jkzl3GHtlMXQgpqbsb6FPRXT0nV2Mu/XnBczT84DDH4CL2oXu W8ny3m4uUg/kCZMMLDl5EKA8+iwkgFnlJiRdRs9OXx03RbEyCeg/Vx8Y3cCZp7JbujeK Npy7hvDcJhMygcmazVZtMSWxcfabUo6viEUoJOZh1tWeVio9w/C6Xvx7JIcAoRPmXefr j5waV6mPhkM+CcIW/8YfSSTP7WJ5h44ZIFhUwOL4dCE1Ct9WR1N8JhH7yd4+kb7AUQYB nxnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iMSNpRYkuxORHU6f+AgXIb0a+Cm9/6sUG5ZTlxMixc8=; b=iTSU/syq9G53nS9voA9fMsjLFR0u9va452BrLfBfOV+Icj9QZGu7GB+Ho2u7o0TdpF dc6i2TaU/FppGwzFzr2JNMunB9o+mpfPcXnZ8mQtykBiAFCQLqYvlYE1ZPJvO6BLJBwy Robhc5ckvgjBBuYjvbH4ct1ax6AYMYsm7Ac7ZICKCDyUcLxKBAGSjFeOscSymydCW0N8 +1GaiF2kzheUA2+MeWQMswOCBulSNFhuruvqamqkSe636jpx9eFgTZhtfixQIrmROnRm IYpyPT/IdPmdtWXtlHxF+RDrX+ZYiiUJipQUXkdV/rqyU4SryPQdn8q+Dd5xxMU+CGOd U3Pg== X-Gm-Message-State: AOAM532LLQkNf72yedYuNXkAqNdRKPDEhdXPgJodpvfnJiZtmJCeQ+cl JL2XayGVbomMr2bivwEHVQHyKoluPl4= X-Google-Smtp-Source: ABdhPJwTOEQrrWrtifFPglwcwuyAbFDXF7cCiohkzLgcIU0WSL+k7h/ge8ey2vXCjUUU5RaWVK+rXA== X-Received: by 2002:a5d:55c8:: with SMTP id i8mr28060213wrw.331.1600273584748; Wed, 16 Sep 2020 09:26:24 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 1/2] meson: move libudev test Date: Wed, 16 Sep 2020 18:26:20 +0200 Message-Id: <20200916162621.100141-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200916162621.100141-1-pbonzini@redhat.com> References: <20200916162621.100141-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::429; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x429.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- configure | 14 -------------- meson.build | 7 ++++--- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/configure b/configure index 1a86c1f146..83ccbc6d70 100755 --- a/configure +++ b/configure @@ -876,7 +876,6 @@ Linux) linux_user=3D"yes" kvm=3D"yes" QEMU_INCLUDES=3D"-isystem ${source_path}/linux-headers -Ilinux-headers $= QEMU_INCLUDES" - libudev=3D"yes" ;; esac =20 @@ -6258,15 +6257,6 @@ if test "$libnfs" !=3D "no" ; then fi =20 ########################################## -# Do we have libudev -if test "$libudev" !=3D "no" ; then - if $pkg_config libudev && test "$static" !=3D "yes"; then - libudev=3D"yes" - libudev_libs=3D$($pkg_config --libs libudev) - else - libudev=3D"no" - fi -fi =20 # Exclude --warn-common with TSan to suppress warnings from the TSan libra= ries. if test "$solaris" =3D "no" && test "$tsan" =3D "no"; then @@ -7435,10 +7425,6 @@ if test "$gcov" =3D "yes" ; then echo "CONFIG_GCOV=3Dy" >> $config_host_mak fi =20 -if test "$libudev" !=3D "no"; then - echo "CONFIG_LIBUDEV=3Dy" >> $config_host_mak - echo "LIBUDEV_LIBS=3D$libudev_libs" >> $config_host_mak -fi if test "$fuzzing" !=3D "no"; then echo "CONFIG_FUZZ=3Dy" >> $config_host_mak fi diff --git a/meson.build b/meson.build index 64c0058dfb..5092aec439 100644 --- a/meson.build +++ b/meson.build @@ -257,8 +257,8 @@ if 'CONFIG_CURL' in config_host link_args: config_host['CURL_LIBS'].split()) endif libudev =3D not_found -if 'CONFIG_LIBUDEV' in config_host - libudev =3D declare_dependency(link_args: config_host['LIBUDEV_LIBS'].sp= lit()) +if target_os =3D=3D 'linux' + libudev =3D dependency('libudev', static: enable_static) endif brlapi =3D not_found if 'CONFIG_BRLAPI' in config_host @@ -446,6 +446,7 @@ has_gettid =3D cc.has_function('gettid') =20 # Create config-host.h =20 +config_host_data.set('CONFIG_LIBUDEV', libudev.found()) config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) config_host_data.set('CONFIG_VNC', vnc.found()) @@ -1527,7 +1528,7 @@ summary_info +=3D {'sheepdog support': config_host.h= as_key('CONFIG_SHEEPDOG')} summary_info +=3D {'capstone': config_host.has_key('CONFIG_CAPSTO= NE')} summary_info +=3D {'libpmem support': config_host.has_key('CONFIG_LIBPME= M')} summary_info +=3D {'libdaxctl support': config_host.has_key('CONFIG_LIBDAX= CTL')} -summary_info +=3D {'libudev': config_host.has_key('CONFIG_LIBUDE= V')} +summary_info +=3D {'libudev': libudev.found()} summary_info +=3D {'default devices': config_host['CONFIG_MINIKCONF_MODE= '] =3D=3D '--defconfig'} summary_info +=3D {'plugin support': config_host.has_key('CONFIG_PLUGIN= ')} summary_info +=3D {'fuzzing support': config_host.has_key('CONFIG_FUZZ')} --=20 2.26.2 From nobody Thu Apr 18 10:17:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600273765; cv=none; d=zohomail.com; s=zohoarc; b=G8YJz+hcq9pFJ0B2lXP53FIADkkgY0y209QCqDg9Odt6QVZzZFcpXDEBxaBYXjJj8UqMEzr3DnLa/ZswveQE9WBorMBsh/Qs7kD0ZckgbV/t9HgpasJxOKXkttIBAxPGd5kbnnxY5e7LWM0q0G5ERg2reDhDyE3slr1dxPaGnaY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600273765; h=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=u5LpVmn/Jvscw3MVO7ztBc+r7T6uTCLpA8L484x+LgU=; b=OATU5o/VAzNp4+e1dBJolqE9x5iyyuNF/EI9Yz6FYsKuD0IOPdhYyUzUj2kN4zqX8EpusAutU9jEhdPaqyzFwuUFCUr/vdyV6jJUCKien5RvwZsXiDAPCVnXesX8SuyTZvGKw66qSp+4SJb3b0Ad8BQer73DiA82sYWbM5Cdaqo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1600273765873981.5612242048675; Wed, 16 Sep 2020 09:29:25 -0700 (PDT) Received: from localhost ([::1]:48924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIaJA-0005cW-Gb for importer@patchew.org; Wed, 16 Sep 2020 12:29:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIaGM-0003IJ-8C for qemu-devel@nongnu.org; Wed, 16 Sep 2020 12:26:30 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:36346) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIaGJ-0000ol-Ll for qemu-devel@nongnu.org; Wed, 16 Sep 2020 12:26:29 -0400 Received: by mail-wr1-x436.google.com with SMTP id z1so7588820wrt.3 for ; Wed, 16 Sep 2020 09:26:27 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6468:f312:cf8e:a9a0:1aed:9a37]) by smtp.gmail.com with ESMTPSA id v128sm6111933wme.2.2020.09.16.09.26.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 09:26:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u5LpVmn/Jvscw3MVO7ztBc+r7T6uTCLpA8L484x+LgU=; b=VuEO8NMwq2VEp2Pxt59Mb/AjeTFnPi4IFoZX5aochG5ZjOZiu775giojcGrb7kJVyE fZjYxM7IR8HqpoSnnuNeki3YbuPxQEobRxOcUCXqQ1x9trglHNxX0Y+/7JX+lPP0p3g/ AAZYE8B9FtRPvnYN0y4cn8Ovza4R6H9DzGHfApJv+3SHywJC6GGSPdzHXs7wB0uZaEp0 9op5IQggjT7ZcGHjQaVdnmIFBKKZeKrW5C3XQaTTE9wwk/EKwwpbJS1og5Shfbpf8FHq qOz/T7uBTM3CoBjLRkO/rgwpV69qq2ZHpl0NmOqXvlKrd1XTIKCTkJx953ej9RtgS6iN 7uWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=u5LpVmn/Jvscw3MVO7ztBc+r7T6uTCLpA8L484x+LgU=; b=GZ4JHeuAa01kXRLIUx2vCH3JsQ66KsZIHDLUHtqB3S1PlDLUjoLGc95M7U6K8XCCjU 1/hQgWQErAYZQRSQXLtbPVuCOYnd7hc2QCbug9w526cRoGEC5G/0sQpWREefk5BjTmpX Ois96aO1lYGs0rCyVdgx9zLMeJLteEGYW2y3FpTtD97OFk4V7TEHFJvz9hmg3AK+h3E7 UqLstNhz/f6JVPrbUOHBnMw8u3NzZPIWRUUkXPLfrwd6pupG+NBl8oT3i9EHP0zTtoYM BBo4fMrTK8KtE7n2Is0gDmK6d+qIznE/juaUJIY2jkL5L5jvRbCO6JS2XNc4/vJ6nBC0 +7eg== X-Gm-Message-State: AOAM532B6SPDgs062njspYmNXsPH2cp9M7taPXH2agslV+OSBFhTGkGR 1dvmjDmvMpSgcQ3HTfqBNlIS18izATY= X-Google-Smtp-Source: ABdhPJzXcnaDFbvxlMNqRFJhO12mV9FSJRDyR+uApGuSKoA4XFoxENdTU5piz9GRce6KksCuC/T9Jg== X-Received: by 2002:adf:a1d6:: with SMTP id v22mr28495540wrv.185.1600273585782; Wed, 16 Sep 2020 09:26:25 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 2/2] meson: move libmpathpersist test Date: Wed, 16 Sep 2020 18:26:21 +0200 Message-Id: <20200916162621.100141-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200916162621.100141-1-pbonzini@redhat.com> References: <20200916162621.100141-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::436; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x436.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This is the first compiler/linker test that has been moved to Meson. Add more section headings to keep things clearer. Signed-off-by: Paolo Bonzini --- configure | 77 +++------------------------------------------ meson.build | 80 ++++++++++++++++++++++++++++++++++++++++++----- meson_options.txt | 2 ++ 3 files changed, 78 insertions(+), 81 deletions(-) diff --git a/configure b/configure index 83ccbc6d70..cc38516e06 100755 --- a/configure +++ b/configure @@ -371,7 +371,7 @@ netmap=3D"no" sdl=3D"auto" sdl_image=3D"auto" virtfs=3D"" -mpath=3D"" +mpath=3D"auto" vnc=3D"enabled" sparse=3D"no" vde=3D"" @@ -1084,9 +1084,9 @@ for opt do ;; --enable-virtfs) virtfs=3D"yes" ;; - --disable-mpath) mpath=3D"no" + --disable-mpath) mpath=3D"disabled" ;; - --enable-mpath) mpath=3D"yes" + --enable-mpath) mpath=3D"enabled" ;; --disable-vnc) vnc=3D"disabled" ;; @@ -3823,57 +3823,6 @@ if test "$modules" =3D yes; then fi fi =20 -########################################## -# libmpathpersist probe - -if test "$mpath" !=3D "no" ; then - # probe for the new API - cat > $TMPC < -#include -unsigned mpath_mx_alloc_len =3D 1024; -int logsink; -static struct config *multipath_conf; -extern struct udev *udev; -extern struct config *get_multipath_config(void); -extern void put_multipath_config(struct config *conf); -struct udev *udev; -struct config *get_multipath_config(void) { return multipath_conf; } -void put_multipath_config(struct config *conf) { } - -int main(void) { - udev =3D udev_new(); - multipath_conf =3D mpath_lib_init(); - return 0; -} -EOF - if compile_prog "" "-ludev -lmultipath -lmpathpersist" ; then - mpathpersist=3Dyes - mpathpersist_new_api=3Dyes - else - # probe for the old API - cat > $TMPC < -#include -unsigned mpath_mx_alloc_len =3D 1024; -int logsink; -int main(void) { - struct udev *udev =3D udev_new(); - mpath_lib_init(udev); - return 0; -} -EOF - if compile_prog "" "-ludev -lmultipath -lmpathpersist" ; then - mpathpersist=3Dyes - mpathpersist_new_api=3Dno - else - mpathpersist=3Dno - fi - fi -else - mpathpersist=3Dno -fi - ########################################## # pthread probe PTHREADLIBS_LIST=3D"-pthread -lpthread -lpthreadGC2" @@ -6315,23 +6264,11 @@ if test "$softmmu" =3D yes ; then fi virtfs=3Dno fi - if test "$mpath" !=3D no && test "$mpathpersist" =3D yes ; then - mpath=3Dyes - else - if test "$mpath" =3D yes; then - error_exit "Multipath requires libmpathpersist devel" - fi - mpath=3Dno - fi else if test "$virtfs" =3D yes; then error_exit "VirtFS is supported only on Linux" fi virtfs=3Dno - if test "$mpath" =3D yes; then - error_exit "Multipath is supported only on Linux" - fi - mpath=3Dno fi fi =20 @@ -6872,12 +6809,6 @@ fi if test "$virtfs" =3D "yes" ; then echo "CONFIG_VIRTFS=3Dy" >> $config_host_mak fi -if test "$mpath" =3D "yes" ; then - echo "CONFIG_MPATH=3Dy" >> $config_host_mak - if test "$mpathpersist_new_api" =3D "yes"; then - echo "CONFIG_MPATH_NEW_API=3Dy" >> $config_host_mak - fi -fi if test "$vhost_scsi" =3D "yes" ; then echo "CONFIG_VHOST_SCSI=3Dy" >> $config_host_mak fi @@ -7965,7 +7896,7 @@ NINJA=3D${ninja:-$PWD/ninjatool} $meson setup \ -Dstrip=3D$(if test "$strip_opt" =3D yes; then echo true; else ech= o false; fi) \ -Db_pie=3D$(if test "$pie" =3D yes; then echo true; else echo fals= e; fi) \ -Db_coverage=3D$(if test "$gcov" =3D yes; then echo true; else ech= o false; fi) \ - -Dsdl=3D$sdl -Dsdl_image=3D$sdl_image \ + -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\ $cross_arg \ diff --git a/meson.build b/meson.build index 5092aec439..60ef988d9d 100644 --- a/meson.build +++ b/meson.build @@ -86,6 +86,14 @@ if 'SPARSE_CFLAGS' in config_host 'compile_commands.json']) endif =20 +########################################### +# Target-specific checks and dependencies # +########################################### + +if targetos !=3D 'linux' and get_option('mpath').enabled() + error('Multipath is supported only on Linux') +endif + m =3D cc.find_library('m', required: false) util =3D cc.find_library('util', required: false) winmm =3D [] @@ -117,6 +125,11 @@ elif targetos =3D=3D 'haiku' cc.find_library('network'), cc.find_library('bsd')] endif + +################ +# Dependencies # +################ + # The path to glib.h is added to all compilation commands. This was # grandfathered in from the QEMU Makefiles. add_project_arguments(config_host['GLIB_CFLAGS'].split(), @@ -223,10 +236,6 @@ if 'CONFIG_SPICE' in config_host link_args: config_host['SPICE_LIBS'].split()) endif rt =3D cc.find_library('rt', required: false) -libmpathpersist =3D not_found -if config_host.has_key('CONFIG_MPATH') - libmpathpersist =3D cc.find_library('mpathpersist') -endif libdl =3D not_found if 'CONFIG_PLUGIN' in config_host libdl =3D cc.find_library('dl', required: true) @@ -257,9 +266,62 @@ if 'CONFIG_CURL' in config_host link_args: config_host['CURL_LIBS'].split()) endif libudev =3D not_found -if target_os =3D=3D 'linux' - libudev =3D dependency('libudev', static: enable_static) +if targetos =3D=3D 'linux' + libudev =3D dependency('libudev', + required: get_option('mpath'), + static: enable_static) +endif + +mpathpersist =3D not_found +if targetos =3D=3D 'linux' and not get_option('mpath').disabled() + libmultipath =3D cc.find_library('multipath', + required: get_option('mpath'), + static: enable_static) + libmpathpersist =3D cc.find_library('mpathpersist', + required: get_option('mpath'), + static: enable_static) + if libmultipath.found() and libmpathpersist.found() and libudev.found() + if cc.links(''' + #include + #include + unsigned mpath_mx_alloc_len =3D 1024; + int logsink; + static struct config *multipath_conf; + extern struct udev *udev; + extern struct config *get_multipath_config(void); + extern void put_multipath_config(struct config *conf); + struct udev *udev; + struct config *get_multipath_config(void) { return multipath_conf; } + void put_multipath_config(struct config *conf) { } + int main(void) { + udev =3D udev_new(); + multipath_conf =3D mpath_lib_init(); + return 0; + }''', dependencies: [libmultipath, libmpathpersist, libudev]) + mpathpersist =3D declare_dependency(dependencies: [libmultipath, lib= mpathpersist, libudev]) + mpathpersist_new_api =3D true + elif cc.links(''' + #include + #include + unsigned mpath_mx_alloc_len =3D 1024; + int logsink; + int main(void) { + struct udev *udev =3D udev_new(); + mpath_lib_init(udev); + return 0; + }''', dependencies: [libmultipath, libmpathpersist, libudev]) + mpathpersist =3D declare_dependency(dependencies: [libmultipath, lib= mpathpersist, libudev]) + mpathpersist_new_api =3D false + else + if get_option('mpath').enabled() + error('Cannot detect libmpathpersist API') + else + warning('Cannot detect libmpathpersist API, disabling') + endif + endif + endif endif + brlapi =3D not_found if 'CONFIG_BRLAPI' in config_host brlapi =3D declare_dependency(link_args: config_host['BRLAPI_LIBS'].spli= t()) @@ -447,6 +509,8 @@ has_gettid =3D cc.has_function('gettid') # Create config-host.h =20 config_host_data.set('CONFIG_LIBUDEV', libudev.found()) +config_host_data.set('CONFIG_MPATH', mpathpersist.found()) +config_host_data.set('CONFIG_MPATH_NEW_API', mpathpersist_new_api) config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) config_host_data.set('CONFIG_VNC', vnc.found()) @@ -1197,7 +1261,7 @@ if have_tools =20 executable('qemu-pr-helper', files('scsi/qemu-pr-helper.c', 'scsi/util= s.c'), dependencies: [authz, crypto, io, qom, qemuutil, - libcap_ng, libudev, libmpathpersist], + libcap_ng, mpathpersist], install: true) endif =20 @@ -1419,7 +1483,7 @@ summary_info +=3D {'Audio drivers': config_host['= CONFIG_AUDIO_DRIVERS']} summary_info +=3D {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHI= TELIST']} summary_info +=3D {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHI= TELIST']} summary_info +=3D {'VirtFS support': config_host.has_key('CONFIG_VIRTFS= ')} -summary_info +=3D {'Multipath support': config_host.has_key('CONFIG_MPATH'= )} +summary_info +=3D {'Multipath support': mpathpersist.found()} summary_info +=3D {'VNC support': vnc.found()} if vnc.found() summary_info +=3D {'VNC SASL support': sasl.found()} diff --git a/meson_options.txt b/meson_options.txt index 543cf70043..b38a6ae92a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,6 +6,8 @@ option('docdir', type : 'string', value : 'doc', option('gettext', type : 'boolean', value : true, description: 'Localization of the GTK+ user interface') =20 +option('mpath', type : 'feature', value : 'auto', + description: 'Multipath persistent reservation passthrough') option('sdl', type : 'feature', value : 'auto', description: 'SDL user interface') option('sdl_image', type : 'feature', value : 'auto', --=20 2.26.2