Skip to content

Commit

Permalink
virtio-blk: tell dataplane which vq to notify
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
stefanhaRH committed Jun 28, 2016
1 parent e21737a commit b234cdd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hw/block/dataplane/virtio-blk.c
Expand Up @@ -47,9 +47,9 @@ struct VirtIOBlockDataPlane {
};

/* 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);
}

Expand Down
2 changes: 1 addition & 1 deletion hw/block/dataplane/virtio-blk.h
Expand Up @@ -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_stop(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 */
2 changes: 1 addition & 1 deletion hw/block/virtio-blk.c
Expand Up @@ -55,7 +55,7 @@ static void virtio_blk_req_complete(VirtIOBlockReq *req, unsigned char status)
stb_p(&req->in->status, status);
virtqueue_push(s->vq, &req->elem, req->in_len);
if (s->dataplane_started && !s->dataplane_disabled) {
virtio_blk_data_plane_notify(s->dataplane);
virtio_blk_data_plane_notify(s->dataplane, s->vq);
} else {
virtio_notify(vdev, s->vq);
}
Expand Down

0 comments on commit b234cdd

Please sign in to comment.