From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8441AC433EF for ; Thu, 21 Apr 2022 12:36:14 +0000 (UTC) Received: from localhost ([::1]:60386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhW2f-0001pA-E5 for qemu-devel@archiver.kernel.org; Thu, 21 Apr 2022 08:36:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhVgc-0002jA-41 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 08:13:27 -0400 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]:36502) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhVgZ-0004MA-8p for qemu-devel@nongnu.org; Thu, 21 Apr 2022 08:13:25 -0400 Received: by mail-qv1-xf2f.google.com with SMTP id c1so3514699qvl.3 for ; Thu, 21 Apr 2022 05:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H/CaSTaSIC+ZBFNlRUHgMFUozhbYGLGdhKdS6vKIoYI=; b=MVEH7QIQKMn8VUEMxBP6p1cR6MWz548gf40jhp/mmJPteiFSJ7FTC2LWE8zpicsObC kULEqB3zQyRPccKikHtsSmJDt5x3uvrRpm9kuhUZi/KaVNtIZRf9LMKN5sYjR7KAyinP n0+TqpSZPuwjhnFDo666HH6+3bNKHFYSbceLXsSuKrPqdCl/nKhLMGOsaUwsd8kpwEVM uq7eFbdhuq9V1AZGZfTLO7eLkSy/F2bnc6czaVwbxQ1cdti08UhU0iiJtf0bXzli/PLE XRcKtf5fLpO+6qJ3STOyL+uNEIeh7la8I4dTaTUGyIM9EG3WDsyXkURIKUFolY8chMvQ 5Zww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=H/CaSTaSIC+ZBFNlRUHgMFUozhbYGLGdhKdS6vKIoYI=; b=t/YIrwLmBPQHOnzB/b9wr1lGzL5I7ON9pxJ+4meQtdqSvlZDxR8dyqn0sqFjxcqtwD TJv61n3YNo/Rtk7ltTYASche6HyLpyvs9to3ra+HGA8RlWIZzYfW9UWfP6HGUunNPoWD MTtPWboMhAkLuPaLD0qLi+pebhT9cK2F8z7o/U2zAkYCjz122U+cSTzBowfLCFtml2Zk /8tIgd4f6L/KjMatg7PsOiYh3xHEhy8w87uB5TdbDZ09rxVK+Hda0MgEltpEQZjjgOCF IuvxxUVOUozqX/agc/WKLkmkyp/HarCo6i/NlQgKLlcXb2P+kHYaiPtF1Hxfg4AIAjA0 T7sA== X-Gm-Message-State: AOAM533/jjrqV5iOZrTMDQ7ONNyDU6EcHFhgXESf4zwb51K6Dh64NEZM BE7RDjf68L3QG3vBLENa4nSMAFeFps3GxRxG1Gs= X-Google-Smtp-Source: ABdhPJyVc9gDOdD7gNbE0Ei8spKYmP9nImI+vXcqpFk0g6f7UGaLnf/affoN3aqqgzsHYALIgrxYjqTtn6SL3iAiA5U= X-Received: by 2002:a05:6214:1c8f:b0:443:8505:14b3 with SMTP id ib15-20020a0562141c8f00b00443850514b3mr19394029qvb.7.1650543201326; Thu, 21 Apr 2022 05:13:21 -0700 (PDT) MIME-Version: 1.0 References: <20220420153407.73926-1-pbonzini@redhat.com> <20220420153407.73926-35-pbonzini@redhat.com> In-Reply-To: <20220420153407.73926-35-pbonzini@redhat.com> From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Date: Thu, 21 Apr 2022 16:13:09 +0400 Message-ID: Subject: Re: [PATCH 34/34] configure, meson: move vhost options to Meson To: Paolo Bonzini Content-Type: multipart/alternative; boundary="000000000000339a5005dd290968" Received-SPF: pass client-ip=2607:f8b0:4864:20::f2f; envelope-from=marcandre.lureau@gmail.com; helo=mail-qv1-xf2f.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: QEMU Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000339a5005dd290968 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 20, 2022 at 8:05 PM Paolo Bonzini wrote: > Finish the conversion by moving all the definitions and the constraint > checks to meson_options.txt and meson.build respectively. > > Signed-off-by: Paolo Bonzini > lgtm Reviewed-by: Marc-Andr=C3=A9 Lureau > --- > configure | 82 ----------------------------------- > meson.build | 33 +++++++++++--- > meson_options.txt | 10 +++++ > scripts/meson-buildoptions.sh | 15 +++++++ > 4 files changed, 51 insertions(+), 89 deletions(-) > > diff --git a/configure b/configure > index 3b38ff3c63..0cedfcf5a9 100755 > --- a/configure > +++ b/configure > @@ -282,11 +282,6 @@ EXTRA_CXXFLAGS=3D"" > EXTRA_OBJCFLAGS=3D"" > EXTRA_LDFLAGS=3D"" > > -vhost_kernel=3D"$default_feature" > -vhost_net=3D"$default_feature" > -vhost_crypto=3D"$default_feature" > -vhost_user=3D"no" > -vhost_vdpa=3D"$default_feature" > debug_tcg=3D"no" > sanitizers=3D"no" > tsan=3D"no" > @@ -526,7 +521,6 @@ haiku) > ;; > linux) > linux=3D"yes" > - vhost_user=3D${default_feature:-yes} > ;; > esac > > @@ -863,14 +857,6 @@ for opt do > ;; > --with-coroutine=3D*) coroutine=3D"$optarg" > ;; > - --disable-vhost-net) vhost_net=3D"no" > - ;; > - --enable-vhost-net) vhost_net=3D"yes" > - ;; > - --disable-vhost-crypto) vhost_crypto=3D"no" > - ;; > - --enable-vhost-crypto) vhost_crypto=3D"yes" > - ;; > --disable-zlib-test) > ;; > --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) > @@ -882,18 +868,6 @@ for opt do > --enable-uuid|--disable-uuid) > echo "$0: $opt is obsolete, UUID support is always built" >&2 > ;; > - --disable-vhost-user) vhost_user=3D"no" > - ;; > - --enable-vhost-user) vhost_user=3D"yes" > - ;; > - --disable-vhost-vdpa) vhost_vdpa=3D"no" > - ;; > - --enable-vhost-vdpa) vhost_vdpa=3D"yes" > - ;; > - --disable-vhost-kernel) vhost_kernel=3D"no" > - ;; > - --enable-vhost-kernel) vhost_kernel=3D"yes" > - ;; > --disable-capstone) capstone=3D"disabled" > ;; > --enable-capstone) capstone=3D"enabled" > @@ -1092,11 +1066,6 @@ cat << EOF > debug-info debugging information > safe-stack SafeStack Stack Smash Protection. Depends on > clang/llvm >=3D 3.7 and requires coroutine backend > ucontext. > - vhost-net vhost-net kernel acceleration support > - vhost-crypto vhost-user-crypto backend support > - vhost-kernel vhost kernel backend support > - vhost-user vhost-user backend support > - vhost-vdpa vhost-vdpa kernel backend support > > NOTE: The object files are built at the place where configure is launche= d > EOF > @@ -1510,35 +1479,6 @@ else > exit 1 > fi > > -######################################### > -# vhost interdependencies and host support > - > -# vhost backends > -if test "$vhost_user" =3D "yes" && test "$mingw32" =3D "yes"; then > - error_exit "vhost-user is not available on Windows" > -fi > -test "$vhost_vdpa" =3D "" && vhost_vdpa=3D$linux > -if test "$vhost_vdpa" =3D "yes" && test "$linux" !=3D "yes"; then > - error_exit "vhost-vdpa is only available on Linux" > -fi > -test "$vhost_kernel" =3D "" && vhost_kernel=3D$linux > -if test "$vhost_kernel" =3D "yes" && test "$linux" !=3D "yes"; then > - error_exit "vhost-kernel is only available on Linux" > -fi > - > -# vhost-user backends > -test "$vhost_crypto" =3D "" && vhost_crypto=3D$vhost_user > -if test "$vhost_crypto" =3D "yes" && test "$vhost_user" =3D "no"; then > - error_exit "--enable-vhost-crypto requires --enable-vhost-user" > -fi > - > -# OR the vhost-kernel, vhost-vdpa and vhost-user values for simplicity > -if test "$vhost_net" =3D ""; then > - test "$vhost_user" =3D "yes" && vhost_net=3Dyes > - test "$vhost_vdpa" =3D "yes" && vhost_net=3Dyes > - test "$vhost_kernel" =3D "yes" && vhost_net=3Dyes > -fi > - > ########################################## > # pkg-config probe > > @@ -2058,28 +1998,6 @@ if test "$modules" =3D "yes"; then > echo "CONFIG_MODULES=3Dy" >> $config_host_mak > fi > > -if test "$vhost_net" =3D "yes" ; then > - echo "CONFIG_VHOST_NET=3Dy" >> $config_host_mak > -fi > -if test "$vhost_user" =3D "yes" ; then > - echo "CONFIG_VHOST_NET_USER=3Dy" >> $config_host_mak > -fi > -if test "$vhost_vdpa" =3D "yes" ; then > - echo "CONFIG_VHOST_NET_VDPA=3Dy" >> $config_host_mak > -fi > -if test "$vhost_crypto" =3D "yes" ; then > - echo "CONFIG_VHOST_CRYPTO=3Dy" >> $config_host_mak > -fi > -if test "$vhost_kernel" =3D "yes" ; then > - echo "CONFIG_VHOST_KERNEL=3Dy" >> $config_host_mak > -fi > -if test "$vhost_user" =3D "yes" ; then > - echo "CONFIG_VHOST_USER=3Dy" >> $config_host_mak > -fi > -if test "$vhost_vdpa" =3D "yes" ; then > - echo "CONFIG_VHOST_VDPA=3Dy" >> $config_host_mak > -fi > - > # XXX: suppress that > if [ "$bsd" =3D "yes" ] ; then > echo "CONFIG_BSD=3Dy" >> $config_host_mak > diff --git a/meson.build b/meson.build > index e8446cf148..499082bf55 100644 > --- a/meson.build > +++ b/meson.build > @@ -313,14 +313,26 @@ have_tpm =3D get_option('tpm') \ > .allowed() > > # vhost > -have_vhost_user =3D 'CONFIG_VHOST_USER' in config_host > -have_vhost_vdpa =3D 'CONFIG_VHOST_VDPA' in config_host > -have_vhost_kernel =3D 'CONFIG_VHOST_KERNEL' in config_host > -have_vhost_net_user =3D 'CONFIG_VHOST_NET_USER' in config_host > -have_vhost_net_vdpa =3D 'CONFIG_VHOST_NET_VDPA' in config_host > -have_vhost_net =3D 'CONFIG_VHOST_NET' in config_host > +have_vhost_user =3D get_option('vhost_user') \ > + .disable_auto_if(targetos !=3D 'linux') \ > + .require(targetos !=3D 'windows', > + error_message: 'vhost-user is not available on > Windows').allowed() > +have_vhost_vdpa =3D get_option('vhost_vdpa') \ > + .require(targetos =3D=3D 'linux', > + error_message: 'vhost-vdpa is only available on > Linux').allowed() > +have_vhost_kernel =3D get_option('vhost_kernel') \ > + .require(targetos =3D=3D 'linux', > + error_message: 'vhost-kernel is only available on > Linux').allowed() > +have_vhost_user_crypto =3D get_option('vhost_crypto') \ > + .require(have_vhost_user, > + error_message: 'vhost-crypto requires vhost-user to be > enabled').allowed() > + > have_vhost =3D have_vhost_user or have_vhost_vdpa or have_vhost_kernel > -have_vhost_user_crypto =3D 'CONFIG_VHOST_CRYPTO' in config_host > + > +have_vhost_net_user =3D have_vhost_user and > get_option('vhost_net').allowed() > +have_vhost_net_vdpa =3D have_vhost_vdpa and > get_option('vhost_net').allowed() > +have_vhost_net_kernel =3D have_vhost_kernel and > get_option('vhost_net').allowed() > +have_vhost_net =3D have_vhost_net_kernel or have_vhost_net_user or > have_vhost_net_vdpa > > # Target-specific libraries and flags > libm =3D cc.find_library('m', required: false) > @@ -1709,6 +1721,13 @@ config_host_data.set('CONFIG_SNAPPY', > snappy.found()) > config_host_data.set('CONFIG_TPM', have_tpm) > config_host_data.set('CONFIG_USB_LIBUSB', libusb.found()) > config_host_data.set('CONFIG_VDE', vde.found()) > +config_host_data.set('CONFIG_VHOST_NET', have_vhost_net) > +config_host_data.set('CONFIG_VHOST_NET_USER', have_vhost_net_user) > +config_host_data.set('CONFIG_VHOST_NET_VDPA', have_vhost_net_vdpa) > +config_host_data.set('CONFIG_VHOST_KERNEL', have_vhost_kernel) > +config_host_data.set('CONFIG_VHOST_USER', have_vhost_user) > +config_host_data.set('CONFIG_VHOST_CRYPTO', have_vhost_user_crypto) > +config_host_data.set('CONFIG_VHOST_VDPA', have_vhost_vdpa) > config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', > have_vhost_user_blk_server) > config_host_data.set('CONFIG_VNC', vnc.found()) > config_host_data.set('CONFIG_VNC_JPEG', jpeg.found()) > diff --git a/meson_options.txt b/meson_options.txt > index 8efd5f520c..24a2a593f0 100644 > --- a/meson_options.txt > +++ b/meson_options.txt > @@ -235,6 +235,16 @@ option('oss', type: 'feature', value: 'auto', > option('pa', type: 'feature', value: 'auto', > description: 'PulseAudio sound support') > > +option('vhost_kernel', type: 'feature', value: 'auto', > + description: 'vhost kernel backend support') > +option('vhost_net', type: 'feature', value: 'auto', > + description: 'vhost-net kernel acceleration support') > +option('vhost_user', type: 'feature', value: 'auto', > + description: 'vhost-user backend support') > +option('vhost_crypto', type: 'feature', value: 'auto', > + description: 'vhost-user crypto backend support') > +option('vhost_vdpa', type: 'feature', value: 'auto', > + description: 'vhost-vdpa kernel backend support') > option('vhost_user_blk_server', type: 'feature', value: 'auto', > description: 'build vhost-user-blk server') > option('virtfs', type: 'feature', value: 'auto', > diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.s= h > index 274639777e..28258e1478 100644 > --- a/scripts/meson-buildoptions.sh > +++ b/scripts/meson-buildoptions.sh > @@ -153,8 +153,13 @@ meson_options_help() { > printf "%s\n" ' usb-redir libusbredir support' > printf "%s\n" ' vde vde network backend support' > printf "%s\n" ' vdi vdi image format support' > + printf "%s\n" ' vhost-crypto vhost-user crypto backend support' > + printf "%s\n" ' vhost-kernel vhost kernel backend support' > + printf "%s\n" ' vhost-net vhost-net kernel acceleration support= ' > + printf "%s\n" ' vhost-user vhost-user backend support' > printf "%s\n" ' vhost-user-blk-server' > printf "%s\n" ' build vhost-user-blk server' > + printf "%s\n" ' vhost-vdpa vhost-vdpa kernel backend support' > printf "%s\n" ' virglrenderer virgl rendering support' > printf "%s\n" ' virtfs virtio-9p support' > printf "%s\n" ' virtiofsd build virtiofs daemon (virtiofsd)' > @@ -407,8 +412,18 @@ _meson_option_parse() { > --disable-vde) printf "%s" -Dvde=3Ddisabled ;; > --enable-vdi) printf "%s" -Dvdi=3Denabled ;; > --disable-vdi) printf "%s" -Dvdi=3Ddisabled ;; > + --enable-vhost-crypto) printf "%s" -Dvhost_crypto=3Denabled ;; > + --disable-vhost-crypto) printf "%s" -Dvhost_crypto=3Ddisabled ;; > + --enable-vhost-kernel) printf "%s" -Dvhost_kernel=3Denabled ;; > + --disable-vhost-kernel) printf "%s" -Dvhost_kernel=3Ddisabled ;; > + --enable-vhost-net) printf "%s" -Dvhost_net=3Denabled ;; > + --disable-vhost-net) printf "%s" -Dvhost_net=3Ddisabled ;; > + --enable-vhost-user) printf "%s" -Dvhost_user=3Denabled ;; > + --disable-vhost-user) printf "%s" -Dvhost_user=3Ddisabled ;; > --enable-vhost-user-blk-server) printf "%s" > -Dvhost_user_blk_server=3Denabled ;; > --disable-vhost-user-blk-server) printf "%s" > -Dvhost_user_blk_server=3Ddisabled ;; > + --enable-vhost-vdpa) printf "%s" -Dvhost_vdpa=3Denabled ;; > + --disable-vhost-vdpa) printf "%s" -Dvhost_vdpa=3Ddisabled ;; > --enable-virglrenderer) printf "%s" -Dvirglrenderer=3Denabled ;; > --disable-virglrenderer) printf "%s" -Dvirglrenderer=3Ddisabled ;; > --enable-virtfs) printf "%s" -Dvirtfs=3Denabled ;; > -- > 2.35.1 > > > --=20 Marc-Andr=C3=A9 Lureau --000000000000339a5005dd290968 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Apr 20, 2022 at 8:05 PM Paolo= Bonzini <pbonzini@redhat.com= > wrote:
Fini= sh the conversion by moving all the definitions and the constraint
checks to meson_options.txt and meson.build respectively.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

<= div>lgtm
Reviewed-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@= redhat.com>
=C2=A0
---
=C2=A0configure=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0| 82 -----------------------------------
=C2=A0meson.build=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0| 33 +++++++++++---
=C2=A0meson_options.txt=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 10= +++++
=C2=A0scripts/meson-buildoptions.sh | 15 +++++++
=C2=A04 files changed, 51 insertions(+), 89 deletions(-)

diff --git a/configure b/configure
index 3b38ff3c63..0cedfcf5a9 100755
--- a/configure
+++ b/configure
@@ -282,11 +282,6 @@ EXTRA_CXXFLAGS=3D""
=C2=A0EXTRA_OBJCFLAGS=3D""
=C2=A0EXTRA_LDFLAGS=3D""

-vhost_kernel=3D"$default_feature"
-vhost_net=3D"$default_feature"
-vhost_crypto=3D"$default_feature"
-vhost_user=3D"no"
-vhost_vdpa=3D"$default_feature"
=C2=A0debug_tcg=3D"no"
=C2=A0sanitizers=3D"no"
=C2=A0tsan=3D"no"
@@ -526,7 +521,6 @@ haiku)
=C2=A0;;
=C2=A0linux)
=C2=A0 =C2=A0linux=3D"yes"
-=C2=A0 vhost_user=3D${default_feature:-yes}
=C2=A0;;
=C2=A0esac

@@ -863,14 +857,6 @@ for opt do
=C2=A0 =C2=A0;;
=C2=A0 =C2=A0--with-coroutine=3D*) coroutine=3D"$optarg"
=C2=A0 =C2=A0;;
-=C2=A0 --disable-vhost-net) vhost_net=3D"no"
-=C2=A0 ;;
-=C2=A0 --enable-vhost-net) vhost_net=3D"yes"
-=C2=A0 ;;
-=C2=A0 --disable-vhost-crypto) vhost_crypto=3D"no"
-=C2=A0 ;;
-=C2=A0 --enable-vhost-crypto) vhost_crypto=3D"yes"
-=C2=A0 ;;
=C2=A0 =C2=A0--disable-zlib-test)
=C2=A0 =C2=A0;;
=C2=A0 =C2=A0--disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane= )
@@ -882,18 +868,6 @@ for opt do
=C2=A0 =C2=A0--enable-uuid|--disable-uuid)
=C2=A0 =C2=A0 =C2=A0 =C2=A0echo "$0: $opt is obsolete, UUID support is= always built" >&2
=C2=A0 =C2=A0;;
-=C2=A0 --disable-vhost-user) vhost_user=3D"no"
-=C2=A0 ;;
-=C2=A0 --enable-vhost-user) vhost_user=3D"yes"
-=C2=A0 ;;
-=C2=A0 --disable-vhost-vdpa) vhost_vdpa=3D"no"
-=C2=A0 ;;
-=C2=A0 --enable-vhost-vdpa) vhost_vdpa=3D"yes"
-=C2=A0 ;;
-=C2=A0 --disable-vhost-kernel) vhost_kernel=3D"no"
-=C2=A0 ;;
-=C2=A0 --enable-vhost-kernel) vhost_kernel=3D"yes"
-=C2=A0 ;;
=C2=A0 =C2=A0--disable-capstone) capstone=3D"disabled"
=C2=A0 =C2=A0;;
=C2=A0 =C2=A0--enable-capstone) capstone=3D"enabled"
@@ -1092,11 +1066,6 @@ cat << EOF
=C2=A0 =C2=A0debug-info=C2=A0 =C2=A0 =C2=A0 debugging information
=C2=A0 =C2=A0safe-stack=C2=A0 =C2=A0 =C2=A0 SafeStack Stack Smash Protectio= n. Depends on
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0clang/= llvm >=3D 3.7 and requires coroutine backend ucontext.
-=C2=A0 vhost-net=C2=A0 =C2=A0 =C2=A0 =C2=A0vhost-net kernel acceleration s= upport
-=C2=A0 vhost-crypto=C2=A0 =C2=A0 vhost-user-crypto backend support
-=C2=A0 vhost-kernel=C2=A0 =C2=A0 vhost kernel backend support
-=C2=A0 vhost-user=C2=A0 =C2=A0 =C2=A0 vhost-user backend support
-=C2=A0 vhost-vdpa=C2=A0 =C2=A0 =C2=A0 vhost-vdpa kernel backend support
=C2=A0NOTE: The object files are built at the place where configure is laun= ched
=C2=A0EOF
@@ -1510,35 +1479,6 @@ else
=C2=A0 =C2=A0 =C2=A0exit 1
=C2=A0fi

-#########################################
-# vhost interdependencies and host support
-
-# vhost backends
-if test "$vhost_user" =3D "yes" && test "= $mingw32" =3D "yes"; then
-=C2=A0 error_exit "vhost-user is not available on Windows"
-fi
-test "$vhost_vdpa" =3D "" && vhost_vdpa=3D$lin= ux
-if test "$vhost_vdpa" =3D "yes" && test "= $linux" !=3D "yes"; then
-=C2=A0 error_exit "vhost-vdpa is only available on Linux"
-fi
-test "$vhost_kernel" =3D "" && vhost_kernel=3D= $linux
-if test "$vhost_kernel" =3D "yes" && test &quo= t;$linux" !=3D "yes"; then
-=C2=A0 error_exit "vhost-kernel is only available on Linux"
-fi
-
-# vhost-user backends
-test "$vhost_crypto" =3D "" && vhost_crypto=3D= $vhost_user
-if test "$vhost_crypto" =3D "yes" && test &quo= t;$vhost_user" =3D "no"; then
-=C2=A0 error_exit "--enable-vhost-crypto requires --enable-vhost-user= "
-fi
-
-# OR the vhost-kernel, vhost-vdpa and vhost-user values for simplicity
-if test "$vhost_net" =3D ""; then
-=C2=A0 test "$vhost_user" =3D "yes" && vhost_n= et=3Dyes
-=C2=A0 test "$vhost_vdpa" =3D "yes" && vhost_n= et=3Dyes
-=C2=A0 test "$vhost_kernel" =3D "yes" && vhost= _net=3Dyes
-fi
-
=C2=A0##########################################
=C2=A0# pkg-config probe

@@ -2058,28 +1998,6 @@ if test "$modules" =3D "yes"; th= en
=C2=A0 =C2=A0echo "CONFIG_MODULES=3Dy" >> $config_host_mak<= br> =C2=A0fi

-if test "$vhost_net" =3D "yes" ; then
-=C2=A0 echo "CONFIG_VHOST_NET=3Dy" >> $config_host_mak
-fi
-if test "$vhost_user" =3D "yes" ; then
-=C2=A0 echo "CONFIG_VHOST_NET_USER=3Dy" >> $config_host_ma= k
-fi
-if test "$vhost_vdpa" =3D "yes" ; then
-=C2=A0 echo "CONFIG_VHOST_NET_VDPA=3Dy" >> $config_host_ma= k
-fi
-if test "$vhost_crypto" =3D "yes" ; then
-=C2=A0 echo "CONFIG_VHOST_CRYPTO=3Dy" >> $config_host_mak<= br> -fi
-if test "$vhost_kernel" =3D "yes" ; then
-=C2=A0 echo "CONFIG_VHOST_KERNEL=3Dy" >> $config_host_mak<= br> -fi
-if test "$vhost_user" =3D "yes" ; then
-=C2=A0 echo "CONFIG_VHOST_USER=3Dy" >> $config_host_mak -fi
-if test "$vhost_vdpa" =3D "yes" ; then
-=C2=A0 echo "CONFIG_VHOST_VDPA=3Dy" >> $config_host_mak -fi
-
=C2=A0# XXX: suppress that
=C2=A0if [ "$bsd" =3D "yes" ] ; then
=C2=A0 =C2=A0echo "CONFIG_BSD=3Dy" >> $config_host_mak
diff --git a/meson.build b/meson.build
index e8446cf148..499082bf55 100644
--- a/meson.build
+++ b/meson.build
@@ -313,14 +313,26 @@ have_tpm =3D get_option('tpm') \
=C2=A0 =C2=A0.allowed()

=C2=A0# vhost
-have_vhost_user =3D 'CONFIG_VHOST_USER' in config_host
-have_vhost_vdpa =3D 'CONFIG_VHOST_VDPA' in config_host
-have_vhost_kernel =3D 'CONFIG_VHOST_KERNEL' in config_host
-have_vhost_net_user =3D 'CONFIG_VHOST_NET_USER' in config_host
-have_vhost_net_vdpa =3D 'CONFIG_VHOST_NET_VDPA' in config_host
-have_vhost_net =3D 'CONFIG_VHOST_NET' in config_host
+have_vhost_user =3D get_option('vhost_user') \
+=C2=A0 .disable_auto_if(targetos !=3D 'linux') \
+=C2=A0 .require(targetos !=3D 'windows',
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0error_message: 'vhost-user is= not available on Windows').allowed()
+have_vhost_vdpa =3D get_option('vhost_vdpa') \
+=C2=A0 .require(targetos =3D=3D 'linux',
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0error_message: 'vhost-vdpa is= only available on Linux').allowed()
+have_vhost_kernel =3D get_option('vhost_kernel') \
+=C2=A0 .require(targetos =3D=3D 'linux',
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0error_message: 'vhost-kernel = is only available on Linux').allowed()
+have_vhost_user_crypto =3D get_option('vhost_crypto') \
+=C2=A0 .require(have_vhost_user,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0error_message: 'vhost-crypto = requires vhost-user to be enabled').allowed()
+
=C2=A0have_vhost =3D have_vhost_user or have_vhost_vdpa or have_vhost_kerne= l
-have_vhost_user_crypto =3D 'CONFIG_VHOST_CRYPTO' in config_host +
+have_vhost_net_user =3D have_vhost_user and get_option('vhost_net'= ).allowed()
+have_vhost_net_vdpa =3D have_vhost_vdpa and get_option('vhost_net'= ).allowed()
+have_vhost_net_kernel =3D have_vhost_kernel and get_option('vhost_net&= #39;).allowed()
+have_vhost_net =3D have_vhost_net_kernel or have_vhost_net_user or have_vh= ost_net_vdpa

=C2=A0# Target-specific libraries and flags
=C2=A0libm =3D cc.find_library('m', required: false)
@@ -1709,6 +1721,13 @@ config_host_data.set('CONFIG_SNAPPY', snappy= .found())
=C2=A0config_host_data.set('CONFIG_TPM', have_tpm)
=C2=A0config_host_data.set('CONFIG_USB_LIBUSB', libusb.found())
=C2=A0config_host_data.set('CONFIG_VDE', vde.found())
+config_host_data.set('CONFIG_VHOST_NET', have_vhost_net)
+config_host_data.set('CONFIG_VHOST_NET_USER', have_vhost_net_user)=
+config_host_data.set('CONFIG_VHOST_NET_VDPA', have_vhost_net_vdpa)=
+config_host_data.set('CONFIG_VHOST_KERNEL', have_vhost_kernel)
+config_host_data.set('CONFIG_VHOST_USER', have_vhost_user)
+config_host_data.set('CONFIG_VHOST_CRYPTO', have_vhost_user_crypto= )
+config_host_data.set('CONFIG_VHOST_VDPA', have_vhost_vdpa)
=C2=A0config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vho= st_user_blk_server)
=C2=A0config_host_data.set('CONFIG_VNC', vnc.found())
=C2=A0config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
diff --git a/meson_options.txt b/meson_options.txt
index 8efd5f520c..24a2a593f0 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -235,6 +235,16 @@ option('oss', type: 'feature', value: = 'auto',
=C2=A0option('pa', type: 'feature', value: 'auto',<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 description: 'PulseAudio sound support'= )

+option('vhost_kernel', type: 'feature', value: 'auto&#= 39;,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0description: 'vhost kernel backend support&= #39;)
+option('vhost_net', type: 'feature', value: 'auto'= ,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0description: 'vhost-net kernel acceleration= support')
+option('vhost_user', type: 'feature', value: 'auto'= ;,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0description: 'vhost-user backend support= 9;)
+option('vhost_crypto', type: 'feature', value: 'auto&#= 39;,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0description: 'vhost-user crypto backend sup= port')
+option('vhost_vdpa', type: 'feature', value: 'auto'= ;,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0description: 'vhost-vdpa kernel backend sup= port')
=C2=A0option('vhost_user_blk_server', type: 'feature', valu= e: 'auto',
=C2=A0 =C2=A0 =C2=A0 =C2=A0 description: 'build vhost-user-blk server&#= 39;)
=C2=A0option('virtfs', type: 'feature', value: 'auto= 9;,
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh<= br> index 274639777e..28258e1478 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -153,8 +153,13 @@ meson_options_help() {
=C2=A0 =C2=A0printf "%s\n" '=C2=A0 usb-redir=C2=A0 =C2=A0 =C2= =A0 =C2=A0libusbredir support'
=C2=A0 =C2=A0printf "%s\n" '=C2=A0 vde=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0vde network backend support'
=C2=A0 =C2=A0printf "%s\n" '=C2=A0 vdi=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0vdi image format support'
+=C2=A0 printf "%s\n" '=C2=A0 vhost-crypto=C2=A0 =C2=A0 vhost= -user crypto backend support'
+=C2=A0 printf "%s\n" '=C2=A0 vhost-kernel=C2=A0 =C2=A0 vhost= kernel backend support'
+=C2=A0 printf "%s\n" '=C2=A0 vhost-net=C2=A0 =C2=A0 =C2=A0 = =C2=A0vhost-net kernel acceleration support'
+=C2=A0 printf "%s\n" '=C2=A0 vhost-user=C2=A0 =C2=A0 =C2=A0 = vhost-user backend support'
=C2=A0 =C2=A0printf "%s\n" '=C2=A0 vhost-user-blk-server'=
=C2=A0 =C2=A0printf "%s\n" '=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 build vhost-user-blk server'
+=C2=A0 printf "%s\n" '=C2=A0 vhost-vdpa=C2=A0 =C2=A0 =C2=A0 = vhost-vdpa kernel backend support'
=C2=A0 =C2=A0printf "%s\n" '=C2=A0 virglrenderer=C2=A0 =C2=A0= virgl rendering support'
=C2=A0 =C2=A0printf "%s\n" '=C2=A0 virtfs=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 virtio-9p support'
=C2=A0 =C2=A0printf "%s\n" '=C2=A0 virtiofsd=C2=A0 =C2=A0 =C2= =A0 =C2=A0build virtiofs daemon (virtiofsd)'
@@ -407,8 +412,18 @@ _meson_option_parse() {
=C2=A0 =C2=A0 =C2=A0--disable-vde) printf "%s" -Dvde=3Ddisabled ;= ;
=C2=A0 =C2=A0 =C2=A0--enable-vdi) printf "%s" -Dvdi=3Denabled ;;<= br> =C2=A0 =C2=A0 =C2=A0--disable-vdi) printf "%s" -Dvdi=3Ddisabled ;= ;
+=C2=A0 =C2=A0 --enable-vhost-crypto) printf "%s" -Dvhost_crypto= =3Denabled ;;
+=C2=A0 =C2=A0 --disable-vhost-crypto) printf "%s" -Dvhost_crypto= =3Ddisabled ;;
+=C2=A0 =C2=A0 --enable-vhost-kernel) printf "%s" -Dvhost_kernel= =3Denabled ;;
+=C2=A0 =C2=A0 --disable-vhost-kernel) printf "%s" -Dvhost_kernel= =3Ddisabled ;;
+=C2=A0 =C2=A0 --enable-vhost-net) printf "%s" -Dvhost_net=3Denab= led ;;
+=C2=A0 =C2=A0 --disable-vhost-net) printf "%s" -Dvhost_net=3Ddis= abled ;;
+=C2=A0 =C2=A0 --enable-vhost-user) printf "%s" -Dvhost_user=3Den= abled ;;
+=C2=A0 =C2=A0 --disable-vhost-user) printf "%s" -Dvhost_user=3Dd= isabled ;;
=C2=A0 =C2=A0 =C2=A0--enable-vhost-user-blk-server) printf "%s" -= Dvhost_user_blk_server=3Denabled ;;
=C2=A0 =C2=A0 =C2=A0--disable-vhost-user-blk-server) printf "%s" = -Dvhost_user_blk_server=3Ddisabled ;;
+=C2=A0 =C2=A0 --enable-vhost-vdpa) printf "%s" -Dvhost_vdpa=3Den= abled ;;
+=C2=A0 =C2=A0 --disable-vhost-vdpa) printf "%s" -Dvhost_vdpa=3Dd= isabled ;;
=C2=A0 =C2=A0 =C2=A0--enable-virglrenderer) printf "%s" -Dvirglre= nderer=3Denabled ;;
=C2=A0 =C2=A0 =C2=A0--disable-virglrenderer) printf "%s" -Dvirglr= enderer=3Ddisabled ;;
=C2=A0 =C2=A0 =C2=A0--enable-virtfs) printf "%s" -Dvirtfs=3Denabl= ed ;;
--
2.35.1




--
Marc-Andr=C3=A9 Lureau
--000000000000339a5005dd290968--