diff options
| author | Eugenio Pérez | 2022-08-23 20:30:35 +0200 |
|---|---|---|
| committer | Jason Wang | 2022-09-02 04:22:39 +0200 |
| commit | 539573c317dc0b8d50a128db60550f2f2898d2fc (patch) | |
| tree | 4feb1d596fa4513ee1ea950bc4e8d753d8b7fedb /hw/net | |
| parent | vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail (diff) | |
| download | qemu-539573c317dc0b8d50a128db60550f2f2898d2fc.tar.gz qemu-539573c317dc0b8d50a128db60550f2f2898d2fc.tar.xz qemu-539573c317dc0b8d50a128db60550f2f2898d2fc.zip | |
vhost_net: add NetClientState->load() callback
It allows per-net client operations right after device's successful
start. In particular, to load the device status.
Vhost-vdpa net will use it to add the CVQ buffers to restore the device
status.
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/net')
| -rw-r--r-- | hw/net/vhost_net.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 9d4b334453..d28f8b974b 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -281,6 +281,13 @@ static int vhost_net_start_one(struct vhost_net *net, } } } + + if (net->nc->info->load) { + r = net->nc->info->load(net->nc); + if (r < 0) { + goto fail; + } + } return 0; fail: file.fd = -1; |
