summaryrefslogtreecommitdiff
path: root/drivers/virtio
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2009-07-26 15:48:01 +0300
committerRusty Russell <rusty@rustcorp.com.au>2009-07-30 16:03:44 +0930
commitf6c82507030d61e15928d5cad946d3eac1c4a384 (patch)
tree5c0dd65a04424dbcf985a4104a8a244085e2f179 /drivers/virtio
parentff52c3fc7188855ede75d87b022271f0da309e5b (diff)
downloadlinux-3.10-f6c82507030d61e15928d5cad946d3eac1c4a384.tar.gz
linux-3.10-f6c82507030d61e15928d5cad946d3eac1c4a384.tar.bz2
linux-3.10-f6c82507030d61e15928d5cad946d3eac1c4a384.zip
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')
-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 ca40517ef9c..a1cb1a1c652 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)
{
struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev);
struct virtio_pci_vq_info *info = vq->priv;
- unsigned long size;
+ unsigned long flags, size;
+
+ spin_lock_irqsave(&vp_dev->lock, flags);
+ list_del(&info->node);
+ spin_unlock_irqrestore(&vp_dev->lock, flags);
iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL);