From nobody Sat Apr 27 10:50:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501251367103182.93801974391886; Fri, 28 Jul 2017 07:16:07 -0700 (PDT) Received: from localhost ([::1]:48575 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db63e-0005Jo-EP for importer@patchew.org; Fri, 28 Jul 2017 10:16:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db61W-0002cy-MG for qemu-devel@nongnu.org; Fri, 28 Jul 2017 10:13:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1db61V-0002yH-Em for qemu-devel@nongnu.org; Fri, 28 Jul 2017 10:13:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45650) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1db61V-0002xX-65 for qemu-devel@nongnu.org; Fri, 28 Jul 2017 10:13:49 -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 mx1.redhat.com (Postfix) with ESMTPS id 25EEF7CDB0; Fri, 28 Jul 2017 14:13:48 +0000 (UTC) Received: from localhost (ovpn-112-28.ams2.redhat.com [10.36.112.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id B44E2779F6; Fri, 28 Jul 2017 14:13:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 25EEF7CDB0 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Fri, 28 Jul 2017 16:13:08 +0200 Message-Id: <20170728141309.14275-2-marcandre.lureau@redhat.com> In-Reply-To: <20170728141309.14275-1-marcandre.lureau@redhat.com> References: <20170728141309.14275-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 28 Jul 2017 14:13:48 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 1/2] build-sys: add --disable-vhost-user X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com, Cornelia Huck , Alexander Graf , Christian Borntraeger , philippe.mathieu.daude@gmail.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Learn to compile out vhost-user. Keep it enabled by default on non-win32, that is assumed to be POSIX. Fail if trying to enable it on win32. When trying to make a vhost-user netdev, it gives the following error: -netdev vhost-user,id=3Dfoo,chardev=3Dchr-test: Parameter 'type' expects a = netdev backend type And similar error with the HMP/QMP monitors. While at it, rename CONFIG_VHOST_NET_TEST CONFIG_VHOST_USER_NET_TEST since it's a vhost-user specific variable. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/virtio/virtio-pci.c | 4 ++-- configure | 29 +++++++++++++++++++++++++++-- default-configs/pci.mak | 2 +- default-configs/s390x-softmmu.mak | 2 +- tests/Makefile.include | 6 +++--- 5 files changed, 34 insertions(+), 9 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 5d14bd66dc..8b0d6b69cd 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2135,7 +2135,7 @@ static const TypeInfo vhost_scsi_pci_info =3D { }; #endif =20 -#ifdef CONFIG_LINUX +#if defined(CONFIG_VHOST_USER) && defined(CONFIG_LINUX) /* vhost-user-scsi-pci */ static Property vhost_user_scsi_pci_properties[] =3D { DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, @@ -2665,7 +2665,7 @@ static void virtio_pci_register_types(void) #ifdef CONFIG_VHOST_SCSI type_register_static(&vhost_scsi_pci_info); #endif -#ifdef CONFIG_LINUX +#if defined(CONFIG_VHOST_USER) && defined(CONFIG_LINUX) type_register_static(&vhost_user_scsi_pci_info); #endif #ifdef CONFIG_VHOST_VSOCK diff --git a/configure b/configure index 987f59ba88..efec1a613e 100755 --- a/configure +++ b/configure @@ -306,6 +306,7 @@ tcg=3D"yes" vhost_net=3D"no" vhost_scsi=3D"no" vhost_vsock=3D"no" +vhost_user=3D"" kvm=3D"no" hax=3D"no" rdma=3D"" @@ -1282,6 +1283,15 @@ for opt do ;; --enable-vxhs) vxhs=3D"yes" ;; + --disable-vhost-user) vhost_user=3D"no" + ;; + --enable-vhost-user) + vhost_user=3D"yes" + if test "$mingw32" =3D "yes" ; then + echo "ERROR: vhost-user isn't available on win32" + exit 1 + fi + ;; *) echo "ERROR: unknown option $opt" echo "Try '$0 --help' for more information" @@ -1290,6 +1300,14 @@ for opt do esac done =20 +if test "$vhost_user" =3D ""; then + if test "$mingw32" =3D "yes" ; then + vhost_user=3D"no" + else + vhost_user=3D"yes" + fi +fi + case "$cpu" in ppc) CPU_CFLAGS=3D"-m32" @@ -1518,6 +1536,7 @@ disabled with --disable-FEATURE, default is enabled i= f available: tools build qemu-io, qemu-nbd and qemu-image tools vxhs Veritas HyperScale vDisk backend support crypto-afalg Linux AF_ALG crypto backend driver + vhost-user vhost-user support =20 NOTE: The object files are built at the place where configure is launched EOF @@ -5348,6 +5367,7 @@ echo "libcap-ng support $cap_ng" echo "vhost-net support $vhost_net" echo "vhost-scsi support $vhost_scsi" echo "vhost-vsock support $vhost_vsock" +echo "vhost-user support $vhost_user" echo "Trace backends $trace_backends" if have_backend "simple"; then echo "Trace output file $trace_file-" @@ -5757,12 +5777,15 @@ fi if test "$vhost_scsi" =3D "yes" ; then echo "CONFIG_VHOST_SCSI=3Dy" >> $config_host_mak fi -if test "$vhost_net" =3D "yes" ; then +if test "$vhost_net" =3D "yes" -a "$vhost_user" =3D "yes"; then echo "CONFIG_VHOST_NET_USED=3Dy" >> $config_host_mak fi if test "$vhost_vsock" =3D "yes" ; then echo "CONFIG_VHOST_VSOCK=3Dy" >> $config_host_mak fi +if test "$vhost_user" =3D "yes" ; then + echo "CONFIG_VHOST_USER=3Dy" >> $config_host_mak +fi if test "$blobs" =3D "yes" ; then echo "INSTALL_BLOBS=3Dyes" >> $config_host_mak fi @@ -6358,7 +6381,9 @@ if supported_kvm_target $target; then echo "CONFIG_KVM=3Dy" >> $config_target_mak if test "$vhost_net" =3D "yes" ; then echo "CONFIG_VHOST_NET=3Dy" >> $config_target_mak - echo "CONFIG_VHOST_NET_TEST_$target_name=3Dy" >> $config_host_mak + if test "$vhost_user" =3D "yes" ; then + echo "CONFIG_VHOST_USER_NET_TEST_$target_name=3Dy" >> $config_= host_mak + fi fi fi if supported_hax_target $target; then diff --git a/default-configs/pci.mak b/default-configs/pci.mak index acaa70301a..a758630d30 100644 --- a/default-configs/pci.mak +++ b/default-configs/pci.mak @@ -43,4 +43,4 @@ CONFIG_VGA=3Dy CONFIG_VGA_PCI=3Dy CONFIG_IVSHMEM_DEVICE=3D$(CONFIG_IVSHMEM) CONFIG_ROCKER=3Dy -CONFIG_VHOST_USER_SCSI=3D$(CONFIG_LINUX) +CONFIG_VHOST_USER_SCSI=3D$(and $(CONFIG_VHOST_USER),$(CONFIG_LINUX)) diff --git a/default-configs/s390x-softmmu.mak b/default-configs/s390x-soft= mmu.mak index b227a36179..51191b77df 100644 --- a/default-configs/s390x-softmmu.mak +++ b/default-configs/s390x-softmmu.mak @@ -1,6 +1,6 @@ CONFIG_PCI=3Dy CONFIG_VIRTIO_PCI=3Dy -CONFIG_VHOST_USER_SCSI=3D$(CONFIG_LINUX) +CONFIG_VHOST_USER_SCSI=3D$(and $(CONFIG_VHOST_USER),$(CONFIG_LINUX)) CONFIG_VIRTIO=3Dy CONFIG_SCLPCONSOLE=3Dy CONFIG_TERMINAL3270=3Dy diff --git a/tests/Makefile.include b/tests/Makefile.include index 7af278db55..8f5a3a1cb6 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -255,9 +255,9 @@ check-qtest-i386-y +=3D tests/pc-cpu-test$(EXESUF) check-qtest-i386-y +=3D tests/q35-test$(EXESUF) check-qtest-i386-y +=3D tests/vmgenid-test$(EXESUF) gcov-files-i386-y +=3D hw/pci-host/q35.c -check-qtest-i386-$(CONFIG_VHOST_NET_TEST_i386) +=3D tests/vhost-user-test$= (EXESUF) -ifeq ($(CONFIG_VHOST_NET_TEST_i386),) -check-qtest-x86_64-$(CONFIG_VHOST_NET_TEST_x86_64) +=3D tests/vhost-user-t= est$(EXESUF) +check-qtest-i386-$(CONFIG_VHOST_USER_NET_TEST_i386) +=3D tests/vhost-user-= test$(EXESUF) +ifeq ($(CONFIG_VHOST_USER_NET_TEST_i386),) +check-qtest-x86_64-$(CONFIG_VHOST_USER_NET_TEST_x86_64) +=3D tests/vhost-u= ser-test$(EXESUF) endif check-qtest-i386-y +=3D tests/test-netfilter$(EXESUF) check-qtest-i386-y +=3D tests/test-filter-mirror$(EXESUF) --=20 2.14.0.rc0.1.g40ca67566 From nobody Sat Apr 27 10:50:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15012513177751007.8554399771248; Fri, 28 Jul 2017 07:15:17 -0700 (PDT) Received: from localhost ([::1]:48568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db62t-0004i8-FK for importer@patchew.org; Fri, 28 Jul 2017 10:15:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db61m-0002vv-4u for qemu-devel@nongnu.org; Fri, 28 Jul 2017 10:14:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1db61i-00039f-D8 for qemu-devel@nongnu.org; Fri, 28 Jul 2017 10:14:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46576) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1db61i-00037w-6a for qemu-devel@nongnu.org; Fri, 28 Jul 2017 10:14:02 -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 mx1.redhat.com (Postfix) with ESMTPS id 3DF60C10A3E0; Fri, 28 Jul 2017 14:14:01 +0000 (UTC) Received: from localhost (ovpn-112-28.ams2.redhat.com [10.36.112.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3817C7ADB4; Fri, 28 Jul 2017 14:13:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3DF60C10A3E0 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Fri, 28 Jul 2017 16:13:09 +0200 Message-Id: <20170728141309.14275-3-marcandre.lureau@redhat.com> In-Reply-To: <20170728141309.14275-1-marcandre.lureau@redhat.com> References: <20170728141309.14275-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 28 Jul 2017 14:14:01 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 2/2] build-sys: do not compile net/vhost-user.c if vhost-user is disabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Jason Wang , philippe.mathieu.daude@gmail.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This adds two extra #ifdef that have fairly limited conflict potential. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/net/vhost_net.c | 4 ++++ net/Makefile.objs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index e037db63a3..96c4da49e4 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -193,6 +193,7 @@ struct vhost_net *vhost_net_init(VhostNetOptions *optio= ns) } } =20 +#ifdef CONFIG_VHOST_USER /* Set sane init value. Override when guest acks. */ if (net->nc->info->type =3D=3D NET_CLIENT_DRIVER_VHOST_USER) { features =3D vhost_user_get_acked_features(net->nc); @@ -203,6 +204,7 @@ struct vhost_net *vhost_net_init(VhostNetOptions *optio= ns) goto fail; } } +#endif =20 vhost_net_ack_features(net, features); =20 @@ -414,10 +416,12 @@ VHostNetState *get_vhost_net(NetClientState *nc) case NET_CLIENT_DRIVER_TAP: vhost_net =3D tap_get_vhost_net(nc); break; +#ifdef CONFIG_VHOST_USER case NET_CLIENT_DRIVER_VHOST_USER: vhost_net =3D vhost_user_get_vhost_net(nc); assert(vhost_net); break; +#endif default: break; } diff --git a/net/Makefile.objs b/net/Makefile.objs index 67ba5e26fb..7cac7ed1e4 100644 --- a/net/Makefile.objs +++ b/net/Makefile.objs @@ -3,7 +3,7 @@ common-obj-y +=3D socket.o common-obj-y +=3D dump.o common-obj-y +=3D eth.o common-obj-$(CONFIG_L2TPV3) +=3D l2tpv3.o -common-obj-$(CONFIG_POSIX) +=3D vhost-user.o +common-obj-$(CONFIG_VHOST_USER) +=3D vhost-user.o common-obj-$(CONFIG_SLIRP) +=3D slirp.o common-obj-$(CONFIG_VDE) +=3D vde.o common-obj-$(CONFIG_NETMAP) +=3D netmap.o --=20 2.14.0.rc0.1.g40ca67566