From patchwork Sat Jul 23 08:54:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cindy Lu X-Patchwork-Id: 12927131 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5A7FBC43334 for ; Sat, 23 Jul 2022 08:58:39 +0000 (UTC) Received: from localhost ([::1]:32980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFAy6-0005Zi-7O for qemu-devel@archiver.kernel.org; Sat, 23 Jul 2022 04:58:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFAvH-00029i-EH for qemu-devel@nongnu.org; Sat, 23 Jul 2022 04:55:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28129) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFAuw-0001YB-4a for qemu-devel@nongnu.org; Sat, 23 Jul 2022 04:55:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658566514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5nmOVXL/SR5yCeobh2NA4CICnqWXk6eVdaDNm/tGkHA=; b=LZjpjRk2EG5JYMSBZp30R1WLmbMGRWsaPdJ58ysL3KyzF4F5Oc+L0c1Wh5zOAYwA9z1Xgt kvfVeN0gAF5km/2Sgtaja1tIcjCP+pzWJGsiZPm07wdMUJbwlPqFN5BcojL7IyUnIYUOy/ wse/91FTSCWBAkJprvHA8SCSwW8JPiY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-50-aubbJB0jOo-Cd4mmN71DRQ-1; Sat, 23 Jul 2022 04:55:10 -0400 X-MC-Unique: aubbJB0jOo-Cd4mmN71DRQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A0B623802B8A; Sat, 23 Jul 2022 08:55:10 +0000 (UTC) Received: from server.redhat.com (ovpn-13-31.pek2.redhat.com [10.72.13.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id C7DB6492C3B; Sat, 23 Jul 2022 08:55:06 +0000 (UTC) From: Cindy Lu To: lulu@redhat.com, qemu-devel@nongnu.org Cc: Stefan Hajnoczi , "Michael S. Tsirkin" , "Dr. David Alan Gilbert" , virtio-fs@redhat.com, "Gonglei (Arei)" , Gerd Hoffmann , Jason Wang , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Subject: [PATCH v14 04/10] vhost: introduce new VhostOps vhost_set_config_call Date: Sat, 23 Jul 2022 16:54:19 +0800 Message-Id: <20220723085425.823472-5-lulu@redhat.com> In-Reply-To: <20220723085425.823472-1-lulu@redhat.com> References: <20220723085425.823472-1-lulu@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Received-SPF: pass client-ip=170.10.133.124; envelope-from=lulu@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This patch introduces new VhostOps vhost_set_config_call. This function allows the qemu to set the config event fd to kernel driver. Signed-off-by: Cindy Lu --- include/hw/virtio/vhost-backend.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-backend.h index 81bf3109f8..ff34eb7c8a 100644 --- a/include/hw/virtio/vhost-backend.h +++ b/include/hw/virtio/vhost-backend.h @@ -126,6 +126,8 @@ typedef int (*vhost_get_device_id_op)(struct vhost_dev *dev, uint32_t *dev_id); typedef bool (*vhost_force_iommu_op)(struct vhost_dev *dev); +typedef int (*vhost_set_config_call_op)(struct vhost_dev *dev, + int fd); typedef struct VhostOps { VhostBackendType backend_type; vhost_backend_init vhost_backend_init; @@ -171,6 +173,7 @@ typedef struct VhostOps { vhost_vq_get_addr_op vhost_vq_get_addr; vhost_get_device_id_op vhost_get_device_id; vhost_force_iommu_op vhost_force_iommu; + vhost_set_config_call_op vhost_set_config_call; } VhostOps; int vhost_backend_update_device_iotlb(struct vhost_dev *dev,