diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2010-03-17 13:08:05 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-04-01 13:56:43 -0500 |
commit | 3e607cb503acbd8606e5d42e6b80adcf1ccf9a92 (patch) | |
tree | d807a3e205951a642cfbc913367959ad3abdb6f8 /hw/virtio.h | |
parent | 1cbdabe203164433fbbec3a1815d8be42a085c88 (diff) |
virtio: add set_status callback
vhost net backend needs to be notified when
frontend status changes. Add a callback,
similar to set_features.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio.h')
-rw-r--r-- | hw/virtio.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/virtio.h b/hw/virtio.h index d0155e2761..d3eb714cca 100644 --- a/hw/virtio.h +++ b/hw/virtio.h @@ -115,12 +115,21 @@ struct VirtIODevice void (*get_config)(VirtIODevice *vdev, uint8_t *config); void (*set_config)(VirtIODevice *vdev, const uint8_t *config); void (*reset)(VirtIODevice *vdev); + void (*set_status)(VirtIODevice *vdev, uint8_t val); VirtQueue *vq; const VirtIOBindings *binding; void *binding_opaque; uint16_t device_id; }; +static inline void virtio_set_status(VirtIODevice *vdev, uint8_t val) +{ + if (vdev->set_status) { + vdev->set_status(vdev, val); + } + vdev->status = val; +} + VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size, void (*handle_output)(VirtIODevice *, VirtQueue *)); |