From nobody Thu Sep 19 15:47:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1718705119; cv=none; d=zohomail.com; s=zohoarc; b=YQSUGnwL2gtq/72kcYaJhhbT08o6gVeY7MgZKBQDnE2yQiWfLjVpsGclLpIwYpt+paVRlH7ZZNnsHAV9BuSkIikqM8OqgTY0e35buC/oeTFmiLmVXYQn8w+LSnppam1jdcYSjPad5ZNqJhXqqrS1n8Z9vvUCg96V+/iFcAeAYuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718705119; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Pp5ZUnNz+rNIrlfHLcPwbuNGbQD2zU63dazbFM6gki4=; b=UGE8GUFTvdKqPocuaX77ETt89I6WDvE6SCQwJpAO7FLQwErv9uaPo9kDqSjLUTF/LJvj+3wEnNX/hOPL8pIX/thFUVz6SEHNT3Tpf3jwwFdSy+xxWR3i7c/3jh2bq462kjsQvRSIlAlMpk0DllKoU1G1ptl87+qS5Q3OWT5+6y4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718705119802812.2013301878586; Tue, 18 Jun 2024 03:05:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJViB-0003rM-KG; Tue, 18 Jun 2024 06:05:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJVi8-0003mJ-NT for qemu-devel@nongnu.org; Tue, 18 Jun 2024 06:05:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJVi5-0001Hq-Oo for qemu-devel@nongnu.org; Tue, 18 Jun 2024 06:05:08 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-350-958x5cM8McOP4vAH9wB2dw-1; Tue, 18 Jun 2024 06:05:02 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-421e17ae038so39569055e9.0 for ; Tue, 18 Jun 2024 03:05:02 -0700 (PDT) Received: from step1.redhat.com ([193.207.160.125]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-422a1e68d04sm200747465e9.36.2024.06.18.03.04.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 03:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718705104; 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=Pp5ZUnNz+rNIrlfHLcPwbuNGbQD2zU63dazbFM6gki4=; b=Ll8Erg7wCkOnHvy4b1AULX3OG4IFHus8caHszIS+3wlmCrtauVXWW4c8Wi9p7saKT5IQic B5HgguOekhVYMOfnE3Goxv1+5CaShfsesaDmsXW/OVzsL+tmwkkQj0RTMEz3kD84uj7Ck0 KJOnVgafFmR8avjuJf0SiDWJaGnc3Mk= X-MC-Unique: 958x5cM8McOP4vAH9wB2dw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718705101; x=1719309901; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pp5ZUnNz+rNIrlfHLcPwbuNGbQD2zU63dazbFM6gki4=; b=McvAM6/AyddfTFNCUdooWx/pkoXvu/yRlc8fQUQGPvKF+AwiMJ/F1ZtwhpckNw3dFh hqz5eVRdHYZ1qTDZhDXsq2HiBPQCEec6OB8djtz/mof6YEiI8tl0npJznrZcloT2hfci L+p3yI4+ANvJfIhSBnfhiYNGtNlZErBcRg0hYV0OvxNI44GHgGGRX2KJhD4jcWzg2tjs LPFOs/vumn4cA+a7Hk5sKaX4bHcdNbcnwBqgnbAz8bv6XsmbRbSIZHgYPyJ/fdC+8YM+ S5dXgoWUt8WzScyqBNaSP1OQf2cwiTaKT0Kw0CeMMNRaFiF81qAOM4bJ3MIiZOdIWInA cdEQ== X-Forwarded-Encrypted: i=1; AJvYcCWb2RqHavs9GfCSFRaHWOBUCXrTpwT3Wn7ZdkjheXtRi8B1WgCN0Ma8P4DyoxRNmcK22CnrXPvsvIOrYWJs5nG84k0vxlk= X-Gm-Message-State: AOJu0YzVUT78PUpWcAxLpIEWk+QbbNXydh9Kgaut20XeGPltJj28Iz1G pkb6UzoRb1btqOCnIBhJgUYpS5RV8DiW6IlbtyUkiknD/kFiS1vE3OT23Kyan53bzVE4+zFWOXU NuJu6+0Uod0ircVLVJ6Ru1RBj3G5gyWIeh7J/+C8LKs4Cfqo1rvt9 X-Received: by 2002:a05:600c:154d:b0:421:8028:a507 with SMTP id 5b1f17b1804b1-4230482b872mr79833525e9.18.1718705101609; Tue, 18 Jun 2024 03:05:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHeuNQflOeD45AxbnD6s/40Ybo2KWrQFi6pETp60VQUIo3zbgsA9sIzpjjUDDJUkpTL9WDPnA== X-Received: by 2002:a05:600c:154d:b0:421:8028:a507 with SMTP id 5b1f17b1804b1-4230482b872mr79833145e9.18.1718705101190; Tue, 18 Jun 2024 03:05:01 -0700 (PDT) From: Stefano Garzarella To: mst@redhat.com, qemu-devel@nongnu.org Cc: Thomas Huth , Kevin Wolf , qemu-block@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Jason Wang , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Hanna Reitz , Brad Smith , David Hildenbrand , Paolo Bonzini , Eduardo Habkost , Laurent Vivier , Coiby Xu , slp@redhat.com, gmaglione@redhat.com, Igor Mammedov , stefanha@redhat.com, Raphael Norwitz , Markus Armbruster , Eric Blake , Stefano Garzarella Subject: [PATCH v8 08/13] vhost-user: enable frontends on any POSIX system Date: Tue, 18 Jun 2024 12:04:55 +0200 Message-ID: <20240618100455.145733-1-sgarzare@redhat.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618100043.144657-1-sgarzare@redhat.com> References: <20240618100043.144657-1-sgarzare@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=170.10.133.124; envelope-from=sgarzare@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.148, 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, 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1718705120802100004 The vhost-user protocol is not really Linux-specific so let's enable vhost-user frontends for any POSIX system. In vhost_net.c we use VHOST_FILE_UNBIND which is defined in a Linux specific header, let's define it for other systems as well. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Stefan Hajnoczi Reviewed-by: David Hildenbrand Signed-off-by: Stefano Garzarella --- meson.build | 1 - hw/net/vhost_net.c | 5 +++++ hw/block/Kconfig | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 97e00d6f59..2ba95a8c35 100644 --- a/meson.build +++ b/meson.build @@ -151,7 +151,6 @@ have_tpm =3D get_option('tpm') \ =20 # vhost have_vhost_user =3D get_option('vhost_user') \ - .disable_auto_if(host_os !=3D 'linux') \ .require(host_os !=3D 'windows', error_message: 'vhost-user is not available on Windows').allowe= d() have_vhost_vdpa =3D get_option('vhost_vdpa') \ diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index fd1a93701a..fced429813 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -34,8 +34,13 @@ #include "standard-headers/linux/virtio_ring.h" #include "hw/virtio/vhost.h" #include "hw/virtio/virtio-bus.h" +#if defined(__linux__) #include "linux-headers/linux/vhost.h" +#endif =20 +#ifndef VHOST_FILE_UNBIND +#define VHOST_FILE_UNBIND -1 +#endif =20 /* Features supported by host kernel. */ static const int kernel_feature_bits[] =3D { diff --git a/hw/block/Kconfig b/hw/block/Kconfig index 9e8f28f982..29ee09e434 100644 --- a/hw/block/Kconfig +++ b/hw/block/Kconfig @@ -40,7 +40,7 @@ config VHOST_USER_BLK bool # Only PCI devices are provided for now default y if VIRTIO_PCI - depends on VIRTIO && VHOST_USER && LINUX + depends on VIRTIO && VHOST_USER =20 config SWIM bool --=20 2.45.2