From nobody Mon Nov 17 17:47:13 2025 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=philmd@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=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605096564; cv=none; d=zohomail.com; s=zohoarc; b=XTlMv2KR4p3ewrU3JMqtL4JvUIXrJOVtfjOD02lRhR+5rFCOeiGjOM5rUReG1GwcIBAvJZ7rkj+Qn8dlIDiqMh9khfUSeOiW9q6tzxE63UPHLZm3JSml/js608+5H3sAOWwoLg0QCTYbj8i/GX2j1FAnyiiGoOLR6sAoj6bbCWs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605096564; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=7OU9Wnarb8BK3cIihbrbS+fzlvw4ENVPepjzFPS9F4w=; b=ADYs7WmOkfBUN2150MuNlRQiXNY0WfHYjpt9WpHrEbJvhHJgeaXClGXT8gmeCARnuvFvAGS1wyK/10oq13cvjc5a/ehrcQXtQhsUhsSsCTkdM5H+WTS/qhkwatbSseKeBezcy4+Vlq97+7uaOcvB7istJNR7pzlz+KYz4DHKq/I= 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=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= 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 1605096564015391.4096045603833; Wed, 11 Nov 2020 04:09:24 -0800 (PST) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-268-74Wu3hL8MB6x4OhSNo2HNQ-1; Wed, 11 Nov 2020 07:09:21 -0500 Received: by mail-wm1-f72.google.com with SMTP id o19so826287wme.2 for ; Wed, 11 Nov 2020 04:09:21 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (234.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.234]) by smtp.gmail.com with ESMTPSA id r10sm2276470wmg.16.2020.11.11.04.09.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 04:09:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605096562; 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=7OU9Wnarb8BK3cIihbrbS+fzlvw4ENVPepjzFPS9F4w=; b=DzBNolXBeLQY/ONcX3+8kBDN90vvN/TAz7cSIrSwlkiilXYaByG4i8N5iFi/ruoLrweyHi v6xJ5kWGm+g9vHMCNUUhwRPIa2dvmpVQ/z+Pg9MK8hR5Y6Lx53TQB5jolxHD2bO7WkEzIi M5S7+YBSEZNjSaEdOFdywexa4qIxgHA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605096562; 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=7OU9Wnarb8BK3cIihbrbS+fzlvw4ENVPepjzFPS9F4w=; b=DzBNolXBeLQY/ONcX3+8kBDN90vvN/TAz7cSIrSwlkiilXYaByG4i8N5iFi/ruoLrweyHi v6xJ5kWGm+g9vHMCNUUhwRPIa2dvmpVQ/z+Pg9MK8hR5Y6Lx53TQB5jolxHD2bO7WkEzIi M5S7+YBSEZNjSaEdOFdywexa4qIxgHA= X-MC-Unique: 74Wu3hL8MB6x4OhSNo2HNQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7OU9Wnarb8BK3cIihbrbS+fzlvw4ENVPepjzFPS9F4w=; b=NvmqpZPrBqy/L3P14GnaBJzhzMgfMrou2RKI1CKCJvsNqd2LiyyoneBpLmGCitPhrU goVYI8JKdKG25IQy3TXcTsEFoyTjXZvZR2fURJYI/UcCCjPfv7rmRg73j5GIfchN6JDI 6Vtd01bBbJhp6VIXdZsw7D3HihAohnNkehHifdpfcTTd7DUAaWJBH9CtShH1L1ShnClh 6ZVTYYuBDOrq60gMUBfmHBNpq2fCOh8J5BVuTFaO2QiCaCQrdP8plGM2b2UasVJXic74 YY6ESlHbBSVED3sAQ/Ul8hB5Ruy4UWhPuVyXKr7vPNAO1KOgeiIHZHELwhmgKffdlnRg KBmA== X-Gm-Message-State: AOAM5325a1x9fuvpmzure3STwHzNUPozO+Q0O4Rxt8iOWBm1ZoBvYGgP i3fmbldGeU2uZPCtjs06sU7g8Fz2Hgqav7zSdVgjeR8mKJ3CWx/f3c3DqB7c04elSojVib2DUeF 8MJ5LU5XyJHet4A== X-Received: by 2002:adf:df86:: with SMTP id z6mr26930312wrl.57.1605096559553; Wed, 11 Nov 2020 04:09:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnVXutGoISeRAb7wohlWo5L34u5L3llwo9L3Gm2HNKQJO0hpfBdpgHarT0eoiR2wchG9GQGQ== X-Received: by 2002:adf:df86:: with SMTP id z6mr26930293wrl.57.1605096559379; Wed, 11 Nov 2020 04:09:19 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz , qemu-block@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-5.2 v2 1/4] meson: move vhost_user_blk_server to meson.build Date: Wed, 11 Nov 2020 13:09:09 +0100 Message-Id: <20201111120912.3245574-2-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201111120912.3245574-1-philmd@redhat.com> References: <20201111120912.3245574-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Stefan Hajnoczi The --enable/disable-vhost-user-blk-server options were implemented in ./configure. There has been confusion about them and part of the problem is that the shell syntax used for setting the default value is not easy to read. Move the option over to meson where the conditions are easier to understand: have_vhost_user_blk_server =3D (targetos =3D=3D 'linux') if get_option('vhost_user_blk_server').enabled() if targetos !=3D 'linux' error('vhost_user_blk_server requires linux') endif elif get_option('vhost_user_blk_server').disabled() or not have_system have_vhost_user_blk_server =3D false endif This patch does not change behavior. Signed-off-by: Stefan Hajnoczi Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201110171121.1265142-2-stefanha@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- configure | 16 ++++------------ meson.build | 12 ++++++++++++ block/export/meson.build | 5 ++++- meson_options.txt | 2 ++ 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/configure b/configure index 4cef321d9dc..516f28a0888 100755 --- a/configure +++ b/configure @@ -329,7 +329,7 @@ vhost_crypto=3D"" vhost_scsi=3D"" vhost_vsock=3D"" vhost_user=3D"" -vhost_user_blk_server=3D"" +vhost_user_blk_server=3D"auto" vhost_user_fs=3D"" kvm=3D"auto" hax=3D"auto" @@ -1247,9 +1247,9 @@ for opt do ;; --enable-vhost-vsock) vhost_vsock=3D"yes" ;; - --disable-vhost-user-blk-server) vhost_user_blk_server=3D"no" + --disable-vhost-user-blk-server) vhost_user_blk_server=3D"disabled" ;; - --enable-vhost-user-blk-server) vhost_user_blk_server=3D"yes" + --enable-vhost-user-blk-server) vhost_user_blk_server=3D"enabled" ;; --disable-vhost-user-fs) vhost_user_fs=3D"no" ;; @@ -2390,12 +2390,6 @@ if test "$vhost_net" =3D ""; then test "$vhost_kernel" =3D "yes" && vhost_net=3Dyes fi =20 -# libvhost-user is Linux-only -test "$vhost_user_blk_server" =3D "" && vhost_user_blk_server=3D$linux -if test "$vhost_user_blk_server" =3D "yes" && test "$linux" =3D "no"; then - error_exit "--enable-vhost-user-blk-server is only available on Linux" -fi - ########################################## # pkg-config probe =20 @@ -6289,9 +6283,6 @@ fi if test "$vhost_vdpa" =3D "yes" ; then echo "CONFIG_VHOST_VDPA=3Dy" >> $config_host_mak fi -if test "$vhost_user_blk_server" =3D "yes" ; then - echo "CONFIG_VHOST_USER_BLK_SERVER=3Dy" >> $config_host_mak -fi if test "$vhost_user_fs" =3D "yes" ; then echo "CONFIG_VHOST_USER_FS=3Dy" >> $config_host_mak fi @@ -7012,6 +7003,7 @@ NINJA=3D$ninja $meson setup \ -Dcapstone=3D$capstone -Dslirp=3D$slirp -Dfdt=3D$fdt \ -Diconv=3D$iconv -Dcurses=3D$curses -Dlibudev=3D$libudev\ -Ddocs=3D$docs -Dsphinx_build=3D$sphinx_build -Dinstall_blobs=3D$b= lobs \ + -Dvhost_user_blk_server=3D$vhost_user_blk_server \ $cross_arg \ "$PWD" "$source_path" =20 diff --git a/meson.build b/meson.build index b4736203219..4b789f18c17 100644 --- a/meson.build +++ b/meson.build @@ -751,6 +751,16 @@ =20 has_statx =3D cc.links(statx_test) =20 +have_vhost_user_blk_server =3D (targetos =3D=3D 'linux') + +if get_option('vhost_user_blk_server').enabled() + if targetos !=3D 'linux' + error('vhost_user_blk_server requires linux') + endif +elif get_option('vhost_user_blk_server').disabled() or not have_system + have_vhost_user_blk_server =3D false +endif + ################# # config-host.h # ################# @@ -775,6 +785,7 @@ config_host_data.set('CONFIG_CURSES', curses.found()) config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) +config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_s= erver) config_host_data.set('CONFIG_VNC', vnc.found()) config_host_data.set('CONFIG_VNC_JPEG', jpeg.found()) config_host_data.set('CONFIG_VNC_PNG', png.found()) @@ -2103,6 +2114,7 @@ summary_info +=3D {'vhost-scsi support': config_host.has_key('CONFIG_VHOST= _SCSI')} summary_info +=3D {'vhost-vsock support': config_host.has_key('CONFIG_VHOS= T_VSOCK')} summary_info +=3D {'vhost-user support': config_host.has_key('CONFIG_VHOST= _KERNEL')} +summary_info +=3D {'vhost-user-blk server support': have_vhost_user_blk_se= rver} summary_info +=3D {'vhost-user-fs support': config_host.has_key('CONFIG_VH= OST_USER_FS')} summary_info +=3D {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST= _VDPA')} summary_info +=3D {'Trace backends': config_host['TRACE_BACKENDS']} diff --git a/block/export/meson.build b/block/export/meson.build index 19526435d84..135b356775b 100644 --- a/block/export/meson.build +++ b/block/export/meson.build @@ -1,2 +1,5 @@ blockdev_ss.add(files('export.c')) -blockdev_ss.add(when: 'CONFIG_VHOST_USER_BLK_SERVER', if_true: files('vhos= t-user-blk-server.c')) + +if have_vhost_user_blk_server + blockdev_ss.add(files('vhost-user-blk-server.c')) +endif diff --git a/meson_options.txt b/meson_options.txt index b4f18018752..f6f64785fe7 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -64,6 +64,8 @@ option('xkbcommon', type : 'feature', value : 'auto', description: 'xkbcommon support') option('virtiofsd', type: 'feature', value: 'auto', description: 'build virtiofs daemon (virtiofsd)') +option('vhost_user_blk_server', type: 'feature', value: 'auto', + description: 'build vhost-user-blk server') =20 option('capstone', type: 'combo', value: 'auto', choices: ['disabled', 'enabled', 'auto', 'system', 'internal'], --=20 2.26.2