virtio: find_vqs/del_vqs virtio operations

This replaces find_vq/del_vq with find_vqs/del_vqs virtio operations,
and updates all drivers. This is needed for MSI support, because MSI
needs to know the total number of vectors upfront.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (+ lguest/9p compile fixes)
This commit is contained in:
Michael S. Tsirkin
2009-06-12 22:16:36 -06:00
committed by Rusty Russell
parent 9499f5e7ed
commit d2a7ddda9f
10 changed files with 184 additions and 90 deletions

View File

@ -246,7 +246,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)
chan->vdev = vdev;
/* We expect one virtqueue, for requests. */
chan->vq = vdev->config->find_vq(vdev, 0, req_done, "requests");
chan->vq = virtio_find_single_vq(vdev, req_done, "requests");
if (IS_ERR(chan->vq)) {
err = PTR_ERR(chan->vq);
goto out_free_vq;
@ -261,7 +261,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)
return 0;
out_free_vq:
vdev->config->del_vq(chan->vq);
vdev->config->del_vqs(vdev);
fail:
mutex_lock(&virtio_9p_lock);
chan_index--;
@ -332,7 +332,7 @@ static void p9_virtio_remove(struct virtio_device *vdev)
BUG_ON(chan->inuse);
if (chan->initialized) {
vdev->config->del_vq(chan->vq);
vdev->config->del_vqs(vdev);
chan->initialized = false;
}
}