virtio-blk: tell dataplane which vq to notify
Let the virtio_blk_data_plane_notify() caller decide which virtqueue to notify. This will allow the function to be used with multiqueue. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 1466511196-12612-4-git-send-email-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
e21737ab15
commit
b234cdda95
@ -47,9 +47,9 @@ struct VirtIOBlockDataPlane {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Raise an interrupt to signal guest, if necessary */
|
/* Raise an interrupt to signal guest, if necessary */
|
||||||
void virtio_blk_data_plane_notify(VirtIOBlockDataPlane *s)
|
void virtio_blk_data_plane_notify(VirtIOBlockDataPlane *s, VirtQueue *vq)
|
||||||
{
|
{
|
||||||
set_bit(0, s->batch_notify_vqs);
|
set_bit(virtio_get_queue_index(vq), s->batch_notify_vqs);
|
||||||
qemu_bh_schedule(s->bh);
|
qemu_bh_schedule(s->bh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,6 @@ void virtio_blk_data_plane_destroy(VirtIOBlockDataPlane *s);
|
|||||||
void virtio_blk_data_plane_start(VirtIOBlockDataPlane *s);
|
void virtio_blk_data_plane_start(VirtIOBlockDataPlane *s);
|
||||||
void virtio_blk_data_plane_stop(VirtIOBlockDataPlane *s);
|
void virtio_blk_data_plane_stop(VirtIOBlockDataPlane *s);
|
||||||
void virtio_blk_data_plane_drain(VirtIOBlockDataPlane *s);
|
void virtio_blk_data_plane_drain(VirtIOBlockDataPlane *s);
|
||||||
void virtio_blk_data_plane_notify(VirtIOBlockDataPlane *s);
|
void virtio_blk_data_plane_notify(VirtIOBlockDataPlane *s, VirtQueue *vq);
|
||||||
|
|
||||||
#endif /* HW_DATAPLANE_VIRTIO_BLK_H */
|
#endif /* HW_DATAPLANE_VIRTIO_BLK_H */
|
||||||
|
@ -55,7 +55,7 @@ static void virtio_blk_req_complete(VirtIOBlockReq *req, unsigned char status)
|
|||||||
stb_p(&req->in->status, status);
|
stb_p(&req->in->status, status);
|
||||||
virtqueue_push(s->vq, &req->elem, req->in_len);
|
virtqueue_push(s->vq, &req->elem, req->in_len);
|
||||||
if (s->dataplane_started && !s->dataplane_disabled) {
|
if (s->dataplane_started && !s->dataplane_disabled) {
|
||||||
virtio_blk_data_plane_notify(s->dataplane);
|
virtio_blk_data_plane_notify(s->dataplane, s->vq);
|
||||||
} else {
|
} else {
|
||||||
virtio_notify(vdev, s->vq);
|
virtio_notify(vdev, s->vq);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user