aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2025-07-09 10:24:20 +0200
committerJason Wang <jasowang@redhat.com>2025-07-14 13:27:09 +0800
commitbd38794a1119ec8e3f0a7473458ce4cdd229bc42 (patch)
tree6e264376152bf678bd825bbaf463154d5d237317 /include
parenteffdacbf28d76ca0eec9086539649e547e510bbc (diff)
downloadqemu-bd38794a1119ec8e3f0a7473458ce4cdd229bc42.zip
qemu-bd38794a1119ec8e3f0a7473458ce4cdd229bc42.tar.gz
qemu-bd38794a1119ec8e3f0a7473458ce4cdd229bc42.tar.bz2
net: Add get_acked_features callback to VhostNetOptions
This patch continues the effort to decouple the generic vhost layer from specific network backend implementations. Previously, the vhost_net initialization code contained a hardcoded check for the vhost-user client type to retrieve its acked features by calling vhost_user_get_acked_features(). This exposed an internal vhost-user function in a public header and coupled the two modules. The vhost-user backend is updated to provide a callback, and its getter function is now static. The call site in vhost_net.c is simplified to use the new generic helper, removing the type check and the direct dependency. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/vhost-user.h2
-rw-r--r--include/net/vhost_net.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/include/net/vhost-user.h b/include/net/vhost-user.h
index 0b233a2..a4d0ce4 100644
--- a/include/net/vhost-user.h
+++ b/include/net/vhost-user.h
@@ -11,8 +11,6 @@
#ifndef VHOST_USER_H
#define VHOST_USER_H
-struct vhost_net;
-uint64_t vhost_user_get_acked_features(NetClientState *nc);
void vhost_user_save_acked_features(NetClientState *nc);
#endif /* VHOST_USER_H */
diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h
index fbed373..a8d281c 100644
--- a/include/net/vhost_net.h
+++ b/include/net/vhost_net.h
@@ -7,12 +7,15 @@
struct vhost_net;
typedef struct vhost_net VHostNetState;
+typedef uint64_t (GetAckedFeatures)(NetClientState *nc);
+
typedef struct VhostNetOptions {
VhostBackendType backend_type;
NetClientState *net_backend;
uint32_t busyloop_timeout;
unsigned int nvqs;
const int *feature_bits;
+ GetAckedFeatures *get_acked_features;
void *opaque;
} VhostNetOptions;