From nobody Sun Sep 28 15:28:19 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1758635520; cv=none; d=zohomail.com; s=zohoarc; b=C0rddJK4Wqga8b0ndFH20TzwCe4vKdGhEi2KDkioEMEzXgmvXNPfj2tLnHr8eAHYhHL1rHTmf+FBMSZb95HsxOOqLgo4/dGbRjIUT7QDVMIoEqFJNTr6jzKplZyCUtiT9RiwLUjRuS4NMEMrSio1WK/WXakVyFS0IGNCAAxO1kE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758635520; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=NsPoRWcmxLpBxeDvuwRJ5/Pqrx9vH+1BhZj1GsKNHrQ=; b=X8OCYsxAcE/7+JwCHy+Q866IJe0U3DvogrxEsn7KD9c+eCkU4blFpJViLuC4Ft1dZWdZTHZkzNBRXwmNd5LsxcSj1O3YGj+v+R19naPo0th1zesxbl8azb+eQre0FyTIp/8hWNL2Mt5dfZcBRVy3Y4Plwht3jBJ/uL/WzSUMZJA= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 1758635520816372.325788107598; Tue, 23 Sep 2025 06:52:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v13Qa-0005De-VK; Tue, 23 Sep 2025 09:51:34 -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 1v13QZ-0005D5-1N for qemu-devel@nongnu.org; Tue, 23 Sep 2025 09:51:31 -0400 Received: from mx24.baidu.com ([111.206.215.185] helo=baidu.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v13QW-0003Sk-8n for qemu-devel@nongnu.org; Tue, 23 Sep 2025 09:51:30 -0400 To: qemu-devel CC: "Michael S . Tsirkin" , Stefano Garzarella , Jonah Palmer , Miao Kezhan , Li Zhaoxin Subject: [PATCH] vdpa-dev: add get_vhost() callback for vhost-vdpa device Date: Tue, 23 Sep 2025 21:51:10 +0800 Message-ID: X-Mailer: git-send-email 2.39.5 (Apple Git-154) MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.127.73.8] X-ClientProxiedBy: bjkjy-exc8.internal.baidu.com (172.31.50.52) To bjhj-exc18.internal.baidu.com (172.31.4.16) X-FEAS-Client-IP: 172.31.4.16 X-FE-Policy-ID: 52:10:53:SYSTEM 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=111.206.215.185; envelope-from=lizhaoxin04@baidu.com; helo=baidu.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: , Reply-to: Li Zhaoxin From: Li Zhaoxin via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1758635522415116600 Content-Type: text/plain; charset="utf-8" Commit c255488d67 "virtio: add vhost support for virtio devices" added the get_vhost() function, but it did not include vhost-vdpa devices. Now we add it. Co-developed-by: Miao Kezhan Signed-off-by: Miao Kezhan Signed-off-by: Li Zhaoxin --- hw/virtio/vdpa-dev.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c index d1da40afc8..4a7b970976 100644 --- a/hw/virtio/vdpa-dev.c +++ b/hw/virtio/vdpa-dev.c @@ -338,6 +338,12 @@ static int vhost_vdpa_device_set_status(VirtIODevice *= vdev, uint8_t status) return 0; } =20 +static struct vhost_dev *vhost_vdpa_device_get_vhost(VirtIODevice *vdev) +{ + VhostVdpaDevice *s =3D VHOST_VDPA_DEVICE(vdev); + return &s->dev; +} + static const Property vhost_vdpa_device_properties[] =3D { DEFINE_PROP_STRING("vhostdev", VhostVdpaDevice, vhostdev), DEFINE_PROP_UINT16("queue-size", VhostVdpaDevice, queue_size, 0), @@ -369,6 +375,7 @@ static void vhost_vdpa_device_class_init(ObjectClass *k= lass, const void *data) vdc->set_config =3D vhost_vdpa_device_set_config; vdc->get_features =3D vhost_vdpa_device_get_features; vdc->set_status =3D vhost_vdpa_device_set_status; + vdc->get_vhost =3D vhost_vdpa_device_get_vhost; } =20 static void vhost_vdpa_device_instance_init(Object *obj) --=20 2.34.1