From effdacbf28d76ca0eec9086539649e547e510bbc Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Wed, 9 Jul 2025 10:24:19 +0200 Subject: net: Consolidate vhost feature bits into vhost_net structure Previously, the vhost_net_get_feature_bits() function in hw/net/vhost_net.c used a large switch statement to determine the appropriate feature bits based on the NetClientDriver type. This created unnecessary coupling between the generic vhost layer and specific network backends (like TAP, vhost-user, and vhost-vdpa). This patch moves the definition of vhost feature bits directly into the vhost_net structure for each relevant network client. Signed-off-by: Laurent Vivier Signed-off-by: Jason Wang --- include/hw/virtio/vhost.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/hw') diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index 38800a7..6a75fdc 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio/vhost.h @@ -143,6 +143,7 @@ struct vhost_net { struct vhost_dev dev; struct vhost_virtqueue vqs[2]; int backend; + const int *feature_bits; NetClientState *nc; }; -- cgit v1.1