This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 0c3b0d0f5f2f195a46eef2102781098b32ddcf98
Author: Bowen Wang <[email protected]>
AuthorDate: Wed Jun 4 14:44:54 2025 +0800

    vsock/vsock_vhost: get feature first to store feature to vdev->features
    
    Read the device features with virtio_get_features() before storing them
    into vdev->features.
    
    Signed-off-by: Bowen Wang <[email protected]>
---
 net/vsock/vsock_vhost.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/vsock/vsock_vhost.c b/net/vsock/vsock_vhost.c
index 545688224fd..cd642c9cdc2 100644
--- a/net/vsock/vsock_vhost.c
+++ b/net/vsock/vsock_vhost.c
@@ -282,6 +282,7 @@ static int vsock_vhost_probe(FAR struct vhost_device *hdev)
   FAR struct vsock_vhost_priv_s *priv;
   FAR const char *vqnames[VSOCK_VQ_NUM];
   vq_callback callbacks[VSOCK_VQ_NUM];
+  uint64_t features;
   int ret;
 
   priv = kmm_zalloc(sizeof(*priv));
@@ -312,6 +313,7 @@ static int vsock_vhost_probe(FAR struct vhost_device *hdev)
       goto err;
     }
 
+  virtio_get_features(hdev, &features);
   virtio_read_config_member(priv->hdev, struct virtio_vsock_config_s,
                             guest_cid, &priv->guest_cid);
 

Reply via email to