diff options
| author | Laurent Vivier <lvivier@redhat.com> | 2025-07-09 10:24:21 +0200 |
|---|---|---|
| committer | Jason Wang <jasowang@redhat.com> | 2025-07-14 13:27:09 +0800 |
| commit | 1652f1b335fb5bec921c64ff7f378e6732510ca4 (patch) | |
| tree | e12898426fc54280467eac9723d8de8e87492bbb /net | |
| parent | bd38794a1119ec8e3f0a7473458ce4cdd229bc42 (diff) | |
| download | focaccia-qemu-1652f1b335fb5bec921c64ff7f378e6732510ca4.tar.gz focaccia-qemu-1652f1b335fb5bec921c64ff7f378e6732510ca4.zip | |
net: Add save_acked_features callback to vhost_net
This commit introduces a save_acked_features function pointer to vhost_net and converts the vhost_net function into a generic dispatcher. The vhost-user backend provides the callback, making its function static. With this change, no other module has a direct dependency on the vhost-user implementation. This cleanup allows for the complete removal of the net/vhost-user.h header file. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net')
| -rw-r--r-- | net/tap.c | 1 | ||||
| -rw-r--r-- | net/vhost-user-stub.c | 1 | ||||
| -rw-r--r-- | net/vhost-user.c | 4 | ||||
| -rw-r--r-- | net/vhost-vdpa.c | 1 |
4 files changed, 4 insertions, 3 deletions
diff --git a/net/tap.c b/net/tap.c index acd77f816f..79fa02a65c 100644 --- a/net/tap.c +++ b/net/tap.c @@ -745,6 +745,7 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer, options.nvqs = 2; options.feature_bits = kernel_feature_bits; options.get_acked_features = NULL; + options.save_acked_features = NULL; s->vhost_net = vhost_net_init(&options); if (!s->vhost_net) { diff --git a/net/vhost-user-stub.c b/net/vhost-user-stub.c index 52ab4e13f1..283dee87db 100644 --- a/net/vhost-user-stub.c +++ b/net/vhost-user-stub.c @@ -11,7 +11,6 @@ #include "qemu/osdep.h" #include "clients.h" #include "net/vhost_net.h" -#include "net/vhost-user.h" #include "qemu/error-report.h" #include "qapi/error.h" diff --git a/net/vhost-user.c b/net/vhost-user.c index 93b413b49f..8a3df27b02 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -11,7 +11,6 @@ #include "qemu/osdep.h" #include "clients.h" #include "net/vhost_net.h" -#include "net/vhost-user.h" #include "hw/virtio/vhost.h" #include "hw/virtio/vhost-user.h" #include "standard-headers/linux/virtio_net.h" @@ -88,7 +87,7 @@ static uint64_t vhost_user_get_acked_features(NetClientState *nc) return s->acked_features; } -void vhost_user_save_acked_features(NetClientState *nc) +static void vhost_user_save_acked_features(NetClientState *nc) { NetVhostUserState *s; @@ -140,6 +139,7 @@ static int vhost_user_start(int queues, NetClientState *ncs[], options.nvqs = 2; options.feature_bits = user_feature_bits; options.get_acked_features = vhost_user_get_acked_features; + options.save_acked_features = vhost_user_save_acked_features; net = vhost_net_init(&options); if (!net) { diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index a3980d1fb5..c63225d3d2 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -203,6 +203,7 @@ static int vhost_vdpa_add(NetClientState *ncs, void *be, options.nvqs = nvqs; options.feature_bits = vdpa_feature_bits; options.get_acked_features = NULL; + options.save_acked_features = NULL; net = vhost_net_init(&options); if (!net) { |