virtio-ring: move queue_index to vring_virtqueue

Instead of storing the queue index in transport-specific virtio structs,
this patch moves them to vring_virtqueue and introduces an helper to get
the value.  This lets drivers simplify their management and tracing of
virtqueues.

Signed-off-by: Jason Wang <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
This commit is contained in:
Jason Wang 2012-08-28 13:54:13 +02:00 • committed by Rusty Russell
commit 17bb6d4088
8 changed files with 29 additions and 21 deletions

View file

@ -103,7 +103,7 @@ static struct virtqueue *rp_find_vq(struct virtio_device *vdev,
* Create the new vq, and tell virtio we're not interested in
* the 'weak' smp barriers, since we're talking with a real device.
*/
vq = vring_new_virtqueue(len, rvring->align, vdev, false, addr,
vq = vring_new_virtqueue(id, len, rvring->align, vdev, false, addr,
rproc_virtio_notify, callback, name);
if (!vq) {
dev_err(dev, "vring_new_virtqueue %s failed\n", name);