From nobody Mon Nov 25 15:27:09 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=1715154431; cv=none; d=zohomail.com; s=zohoarc; b=iHewS1+fZ2XZm+CxjmLZ2IJgJG2nYhCYlPHSsG1GvK9XJZ3UtdQ1nobnw+SgEUOvZF3668HOLgIpq9nbLJkyJ425WPWTJIbYysweOhpFdbEJT7kM0b6qgVGEppMAfOhxBartsoCLoMlbGO2iyCQodlN/x+OpTFAJNivRxZoIRF4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715154431; 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=UTRHyTyXKiahujrFXbpPQFmYDHPg3542Nh2vIJCWy60=; b=XcV8dCmHEmM5GxNARX1ozXQYMXN8XBcsthGDWPISydKx0BO7BMmht7ufJtX6Hw2jtICQHkNcywgx/yqP6gXCmoCKOHhM0XBA/Q0BguAueeU3HSQYwtYGXXzc1q4BafC0a7BxO21Nfsa18xV06ciA3x8GUjn1vpxmDmJ6JLQA8Io= 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 17151544310931011.2811587498287; Wed, 8 May 2024 00:47:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4bzz-0003w1-Fv; Wed, 08 May 2024 03:45:59 -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 1s4bzq-0003br-BS for qemu-devel@nongnu.org; Wed, 08 May 2024 03:45:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s4bzl-0000zs-Pm for qemu-devel@nongnu.org; Wed, 08 May 2024 03:45:47 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-531-GfflmaO8N5uDBU-nkb6cQw-1; Wed, 08 May 2024 03:45:43 -0400 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a59ad2436f8so314275866b.2 for ; Wed, 08 May 2024 00:45:43 -0700 (PDT) Received: from localhost.localdomain (host-87-12-25-56.business.telecomitalia.it. [87.12.25.56]) by smtp.gmail.com with ESMTPSA id kf6-20020a17090776c600b00a599a97a66fsm6032444ejc.55.2024.05.08.00.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 00:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715154345; 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=UTRHyTyXKiahujrFXbpPQFmYDHPg3542Nh2vIJCWy60=; b=NVxtrKhoQxISIxjLMNCMB8JJRiwSDIU6cDdyMvRi21TtyKZs5kEH3bcUCsWoeDaRxtAFXW SDjsd56AH9Az9uUH9zik4Wc6rQaEftfhlBcokAO1V+Q7tTrasebjN/Gfo30F4Yiy2pd5DJ ntvEGsKKdcOP/G1Rgz/tFwHU8RoQvrY= X-MC-Unique: GfflmaO8N5uDBU-nkb6cQw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715154338; x=1715759138; 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=UTRHyTyXKiahujrFXbpPQFmYDHPg3542Nh2vIJCWy60=; b=Vwhv9qlh1Ckc/lGE/0Bw+ZydpC5bgvZ4awvPVg01z9W19R99XQGKLDnAVvNV9xc3J9 2U9F9/KPU2qSRsPc7GDUJTqF/5guDBdRlnvp65tvsFa8Nq0rrzJvtWTMy8QYxZK3zQzh 40gfyKr1aoWWxTw1yQlZVr7F3cx6Ugr1ad+H6qB5o8rupMfawwnz5yAeQUnTfODCLluh Nx6PV19Bv6GmfWgsJFiabzGNMRWIRzKydHJZZmaHmpq+qxr22OUoYxMzNmnmjeXU2jve KWeIaYGSrsFxHAO/HEm7qQrTBhlDeu3V5MUsXBL9wBzkbRwm0LhAX/oYV8x5zJcncoKN XP7Q== X-Gm-Message-State: AOJu0YyfCb56FKXZjsYorftUG27CVkWnN0NmXM9kNAZewEg7zuMtBjcN Kvtrj2vKyRIfNWjaDo/gaykVYJ6Fdq4E9fcBoy40XhVRA5EiJIBsmdTzpBQsfvq4JqIgkUJQX6h bJ3p6KpJQ2faXLwvqmHUpvvngvbl35Mg8sZEP3AKlCKknPuXRtkRq1KoTnRafOvZ/c5cSM+qePJ nEX+PPRO5vgMbhS+mK21KEO8SxXjaq+Z6sn3F5 X-Received: by 2002:a17:906:f919:b0:a51:8d60:215a with SMTP id a640c23a62f3a-a59fb95a4e8mr100174866b.27.1715154337886; Wed, 08 May 2024 00:45:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCJloW+tlX1rdN71yJ2zslkMrWJlodATZZ5ms7JnKp+2p1sbtuQcShHuTFTLI9XSpoHaSE5Q== X-Received: by 2002:a17:906:f919:b0:a51:8d60:215a with SMTP id a640c23a62f3a-a59fb95a4e8mr100171466b.27.1715154337526; Wed, 08 May 2024 00:45:37 -0700 (PDT) From: Stefano Garzarella To: qemu-devel@nongnu.org Cc: Jason Wang , Coiby Xu , Paolo Bonzini , qemu-block@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Gerd Hoffmann , slp@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Brad Smith , Eduardo Habkost , Thomas Huth , Eric Blake , Kevin Wolf , Markus Armbruster , Raphael Norwitz , gmaglione@redhat.com, Laurent Vivier , stefanha@redhat.com, David Hildenbrand , Hanna Reitz , "Michael S. Tsirkin" , Igor Mammedov , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefano Garzarella Subject: [PATCH v4 07/12] vhost-user: enable frontends on any POSIX system Date: Wed, 8 May 2024 09:44:51 +0200 Message-ID: <20240508074457.12367-8-sgarzare@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240508074457.12367-1-sgarzare@redhat.com> References: <20240508074457.12367-1-sgarzare@redhat.com> MIME-Version: 1.0 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.129.124; envelope-from=sgarzare@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.581, 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.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: 1715154432164100005 Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Stefano Garzarella Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- 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 43da492372..955921dcb8 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.0