From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCHv3 1/2] virtio: delete vq from list Date: Sun, 26 Jul 2009 18:41:27 +0300 Message-ID: <20090726154127.GA21203@redhat.com> References: <20090726124801.GB20740@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: Christian Borntraeger , virtualization@lists.linux-foundation.org, Anthony Liguori , kvm@vger.kernel.org, avi@redhat.com, Carsten Otte < Return-path: Received: from mx2.redhat.com ([66.187.237.31]:46913 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751858AbZGZPmd (ORCPT ); Sun, 26 Jul 2009 11:42:33 -0400 Content-Disposition: inline In-Reply-To: <20090726124801.GB20740@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Jul 26, 2009 at 03:48:01PM +0300, Michael S. Tsirkin wrote: > 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 > --- > drivers/virtio/virtio_pci.c | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c > index 7e21389..2eaf1fb 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); Grr, whitespace damage. Not sure how this got in, resending a corrected patch. Sorry about the churn. > iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); > > -- > 1.6.2.5 > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html