aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEugenio Pérez <eperezma@redhat.com>2022-08-23 20:30:30 +0200
committerJason Wang <jasowang@redhat.com>2022-09-02 10:22:39 +0800
commiteb92b75380fc0f2368e22be45d1e2d1e2cd2f79c (patch)
tree15623b775f40a11c800b1bd07353816cf6f8de8f /hw
parentd368c0b052ad95d3bf4fcc5a5d25715a35c91d4b (diff)
vhost_net: Add NetClientInfo start callback
This is used by the backend to perform actions before the device is started. In particular, vdpa net use it to map CVQ buffers to the device, so it can send control commands using them. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/net/vhost_net.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index ccac5b7a64..2e0baeba26 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -244,6 +244,13 @@ static int vhost_net_start_one(struct vhost_net *net,
struct vhost_vring_file file = { };
int r;
+ if (net->nc->info->start) {
+ r = net->nc->info->start(net->nc);
+ if (r < 0) {
+ return r;
+ }
+ }
+
r = vhost_dev_enable_notifiers(&net->dev, dev);
if (r < 0) {
goto fail_notifiers;