OSDN Git Service

vhost: Add svq avail_handler callback
authorEugenio Pérez <eperezma@redhat.com>
Wed, 20 Jul 2022 06:59:39 +0000 (08:59 +0200)
committerJason Wang <jasowang@redhat.com>
Wed, 20 Jul 2022 08:58:08 +0000 (16:58 +0800)
commite966c0b781aebabd2c0f5eef91678f08ce1d068c
tree84162843e8ad1706d82cda1bde20accbfdee3372
parent3f44d13dda83d390cc9563e56e7d337e4f6223f4
vhost: Add svq avail_handler callback

This allows external handlers to be aware of new buffers that the guest
places in the virtqueue.

When this callback is defined the ownership of the guest's virtqueue
element is transferred to the callback. This means that if the user
wants to forward the descriptor it needs to manually inject it. The
callback is also free to process the command by itself and use the
element with svq_push.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/virtio/vhost-shadow-virtqueue.c
hw/virtio/vhost-shadow-virtqueue.h
hw/virtio/vhost-vdpa.c