aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/virtio/virtio_pci.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2009-07-26 08:48:01 -0400
committerRusty Russell <rusty@rustcorp.com.au>2009-07-30 02:33:44 -0400
commitf6c82507030d61e15928d5cad946d3eac1c4a384 (patch)
tree5c0dd65a04424dbcf985a4104a8a244085e2f179 /drivers/virtio/virtio_pci.c
parentff52c3fc7188855ede75d87b022271f0da309e5b (diff)
virtio: delete vq from list
This makes delete vq the reverse of find vq. This is required to make it possible to retry find_vqs after a failure, otherwise the list gets corrupted. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/virtio/virtio_pci.c')
-rw-r--r--drivers/virtio/virtio_pci.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index ca40517ef9c2..a1cb1a1c6522 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -464,7 +464,11 @@ static void vp_del_vq(struct virtqueue *vq)
464{ 464{
465 struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); 465 struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev);
466 struct virtio_pci_vq_info *info = vq->priv; 466 struct virtio_pci_vq_info *info = vq->priv;
467 unsigned long size; 467 unsigned long flags, size;
468
469 spin_lock_irqsave(&vp_dev->lock, flags);
470 list_del(&info->node);
471 spin_unlock_irqrestore(&vp_dev->lock, flags);
468 472
469 iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); 473 iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL);
470 474