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

@@ -94,13 +94,13 @@ static int virtrng_probe(struct virtio_device *vdev)
int err;
/* We expect a single virtqueue. */
vq = vdev->config->find_vq(vdev, 0, random_recv_done, "input");
vq = virtio_find_single_vq(vdev, random_recv_done, "input");
if (IS_ERR(vq))
return PTR_ERR(vq);
err = hwrng_register(&virtio_hwrng);
if (err) {
vdev->config->del_vq(vq);
vdev->config->del_vqs(vdev);
return err;
}
@@ -112,7 +112,7 @@ static void virtrng_remove(struct virtio_device *vdev)
{
vdev->config->reset(vdev);
hwrng_unregister(&virtio_hwrng);
vdev->config->del_vq(vq);
vdev->config->del_vqs(vdev);
}
static struct virtio_device_id id_table[] = {