From nobody Tue Feb 10 05:27:22 2026 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=1604515996; cv=none; d=zohomail.com; s=zohoarc; b=CIlyJv1ttuxFiuyDFwb/vNEvd4Jlf5FbgzNQisf/IP/wc2+A3AMlYelYlzExaNhkT5lWm9Vk3/C4cPxVVYV0ZNo+OO7abtU2rhQMayveuIWLt+bel32pdTUea+cXAJ5H9tDwAafIV+fXBY7Ax7Cx2m30qgx83nmhjR/c/RgxI64= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604515996; h=Content-Type: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=FOR/bv25dGPFB9FnzIFOxW/ObDgDZns8YprwAzRry/Y=; b=dIFDmtIFBvXjb2EMQf4ngjyC7iE7NRrEY88wgVJAZVZsdaCJ1N8yljQdY3n+ywBM47QsT5G/b7yEHtqyXtaG6+CqgINOFk2/XF7ZKr+rw7j3FZhs6TkZLx06R7asFuip8qbgmGwCrvgo7V43MzmZp72heAP+7IPtbrQT3ILOWt0= 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 1604515996289178.47301027169544; Wed, 4 Nov 2020 10:53:16 -0800 (PST) Received: from localhost ([::1]:33706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaNuF-0002Mc-9D for importer@patchew.org; Wed, 04 Nov 2020 13:53:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaNk9-0001yH-6I for qemu-devel@nongnu.org; Wed, 04 Nov 2020 13:42:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41525) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kaNk6-00028J-7P for qemu-devel@nongnu.org; Wed, 04 Nov 2020 13:42:48 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-205-U_0yv88tNZCx7G7sLSfluQ-1; Wed, 04 Nov 2020 13:42:41 -0500 Received: by mail-wr1-f70.google.com with SMTP id i1so9580565wrb.18 for ; Wed, 04 Nov 2020 10:42:41 -0800 (PST) Received: from redhat.com (bzq-79-176-118-93.red.bezeqint.net. [79.176.118.93]) by smtp.gmail.com with ESMTPSA id y20sm3285147wma.15.2020.11.04.10.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2020 10:42:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604515365; 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: in-reply-to:in-reply-to:references:references; bh=FOR/bv25dGPFB9FnzIFOxW/ObDgDZns8YprwAzRry/Y=; b=ZOCT0nipxcarR/PkJXPu4zNwZOVnjdoQTGZVrg0nC36mEW45ZYhZmM6D04IPfscZHMpK1o U4cfg9kO/aj7rWZRdLVX6cYSTTm//oeXw8ll+y3wb4x39L+nfGBqR4jHj00M9TECYwazhO X6m+AxXm8iOgnGooOrdAq6Nst2MByzg= X-MC-Unique: U_0yv88tNZCx7G7sLSfluQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=FOR/bv25dGPFB9FnzIFOxW/ObDgDZns8YprwAzRry/Y=; b=sReZE2pWqD9xBuC8pZ9pYJ3tFQxZ6CRpO/SYFhf5zizADuaLhPSXf1F2exgMIbXxKK FUZbUTgkxySueYxmXT0DdVfP19TdPn0tP7rRdSVClYKPLTOPtFmCnrWX4RXmlD85H8V/ dsVGkUoBULqJNmVHsd1Z/erbHJbyhhWTrgTRPWKacJwGEkrlXyM/N0bcVPW7NW9WwZBp vDfSrjvNueDSvLJd9eRjSIxgOZTKF9ld5z8A4QPkGsg+3LluFFXYdN/s0Br9PI80tk5J KGU3sc9JhuN1mQJF0CG7VWiWt9T+4JKTODohvLJZiVAlABvMqPioSBh+UWyqbyCizRLF G61g== X-Gm-Message-State: AOAM530LhHOR5AK0HYvjmv9ukoW+blr/PPAtx7+mIyDe3FJDadDAe+Rt KqENnRtyIOSV1ocLt5sAVnKekNQlxnQoijIabSo7Cf2J/KUgrO6MKqT5zN40GzH5/6+cc8J1Fhl UIw9JPfwyOBG1qJY= X-Received: by 2002:a7b:c394:: with SMTP id s20mr5924198wmj.40.1604515358943; Wed, 04 Nov 2020 10:42:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqQ9cPQnZn21RyObjiv/0mWqWgbarV9I5sq1Oty/uN54G/keqXwFoQvvPtrJ5zwc6ZabtS8w== X-Received: by 2002:a7b:c394:: with SMTP id s20mr5924184wmj.40.1604515358792; Wed, 04 Nov 2020 10:42:38 -0800 (PST) Date: Wed, 4 Nov 2020 13:42:36 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v3 28/31] configure: introduce --enable-vhost-user-blk-server Message-ID: <20201104184040.285057-29-mst@redhat.com> References: <20201104184040.285057-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20201104184040.285057-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/03 00:03:41 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=unavailable 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: Kevin Wolf , Peter Maydell , qemu-block@nongnu.org, Stefan Hajnoczi , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Stefan Hajnoczi Make it possible to compile out the vhost-user-blk server. It is enabled by default on Linux. Note that vhost-user-server.c depends on libvhost-user, which requires CONFIG_LINUX. The CONFIG_VHOST_USER dependency was erroneous since that option controls vhost-user frontends (previously known as "master") and not device backends (previously known as "slave"). Signed-off-by: Stefan Hajnoczi Message-Id: <20201027173528.213464-3-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- configure | 15 +++++++++++++++ block/export/export.c | 4 ++-- block/export/meson.build | 2 +- util/meson.build | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 2c3c69f118..b5e8f5f72c 100755 --- a/configure +++ b/configure @@ -329,6 +329,7 @@ vhost_crypto=3D"" vhost_scsi=3D"" vhost_vsock=3D"" vhost_user=3D"" +vhost_user_blk_server=3D"" vhost_user_fs=3D"" kvm=3D"auto" hax=3D"auto" @@ -1246,6 +1247,10 @@ for opt do ;; --enable-vhost-vsock) vhost_vsock=3D"yes" ;; + --disable-vhost-user-blk-server) vhost_user_blk_server=3D"no" + ;; + --enable-vhost-user-blk-server) vhost_user_blk_server=3D"yes" + ;; --disable-vhost-user-fs) vhost_user_fs=3D"no" ;; --enable-vhost-user-fs) vhost_user_fs=3D"yes" @@ -1791,6 +1796,7 @@ disabled with --disable-FEATURE, default is enabled i= f available: vhost-crypto vhost-user-crypto backend support vhost-kernel vhost kernel backend support vhost-user vhost-user backend support + vhost-user-blk-server vhost-user-blk server support vhost-vdpa vhost-vdpa kernel backend support spice spice rbd rados block device (rbd) @@ -2382,6 +2388,12 @@ 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 @@ -6275,6 +6287,9 @@ 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 diff --git a/block/export/export.c b/block/export/export.c index c3478c6c97..bad6f21b1c 100644 --- a/block/export/export.c +++ b/block/export/export.c @@ -22,13 +22,13 @@ #include "qapi/qapi-commands-block-export.h" #include "qapi/qapi-events-block-export.h" #include "qemu/id.h" -#if defined(CONFIG_LINUX) && defined(CONFIG_VHOST_USER) +#ifdef CONFIG_VHOST_USER_BLK_SERVER #include "vhost-user-blk-server.h" #endif =20 static const BlockExportDriver *blk_exp_drivers[] =3D { &blk_exp_nbd, -#if defined(CONFIG_LINUX) && defined(CONFIG_VHOST_USER) +#ifdef CONFIG_VHOST_USER_BLK_SERVER &blk_exp_vhost_user_blk, #endif }; diff --git a/block/export/meson.build b/block/export/meson.build index 9fb4fbf81d..19526435d8 100644 --- a/block/export/meson.build +++ b/block/export/meson.build @@ -1,2 +1,2 @@ blockdev_ss.add(files('export.c')) -blockdev_ss.add(when: ['CONFIG_LINUX', 'CONFIG_VHOST_USER'], if_true: file= s('vhost-user-blk-server.c')) +blockdev_ss.add(when: 'CONFIG_VHOST_USER_BLK_SERVER', if_true: files('vhos= t-user-blk-server.c')) diff --git a/util/meson.build b/util/meson.build index c5159ad79d..f359af0d46 100644 --- a/util/meson.build +++ b/util/meson.build @@ -66,7 +66,7 @@ if have_block util_ss.add(files('main-loop.c')) util_ss.add(files('nvdimm-utils.c')) util_ss.add(files('qemu-coroutine.c', 'qemu-coroutine-lock.c', 'qemu-cor= outine-io.c')) - util_ss.add(when: ['CONFIG_LINUX', 'CONFIG_VHOST_USER'], if_true: [ + util_ss.add(when: 'CONFIG_LINUX', if_true: [ files('vhost-user-server.c'), vhost_user ]) util_ss.add(files('block-helpers.c')) --=20 MST