From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>,
gaudenz@debian.org
Subject: Re: [Qemu-devel] [PATCH for-2.7 2/4] virtio: decrement vq->inuse in virtqueue_discard()
Date: Sat, 13 Aug 2016 00:31:44 +0300 [thread overview]
Message-ID: <20160813003122-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1471015978-1123-3-git-send-email-stefanha@redhat.com>
On Fri, Aug 12, 2016 at 04:32:56PM +0100, Stefan Hajnoczi wrote:
> virtqueue_descard()
discard
> moves vq->last_avail_idx back so the element can be
> popped again. It's necessary to decrement vq->inuse to avoid "leaking"
> the element count.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
With the correction above
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> hw/virtio/virtio.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 4df8274..00158b6 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -268,6 +268,7 @@ void virtqueue_discard(VirtQueue *vq, const VirtQueueElement *elem,
> unsigned int len)
> {
> vq->last_avail_idx--;
> + vq->inuse--;
> virtqueue_unmap_sg(vq, elem, len);
> }
>
> --
> 2.7.4
next prev parent reply other threads:[~2016-08-12 21:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-12 15:32 [Qemu-devel] [PATCH for-2.7 0/4] virtio-balloon: fix stats vq migration Stefan Hajnoczi
2016-08-12 15:32 ` [Qemu-devel] [PATCH for-2.7 1/4] virtio: recalculate vq->inuse after migration Stefan Hajnoczi
2016-08-12 21:30 ` Michael S. Tsirkin
2016-08-14 11:12 ` Fam Zheng
2016-08-15 8:23 ` Cornelia Huck
2016-08-12 15:32 ` [Qemu-devel] [PATCH for-2.7 2/4] virtio: decrement vq->inuse in virtqueue_discard() Stefan Hajnoczi
2016-08-12 21:31 ` Michael S. Tsirkin [this message]
2016-08-15 8:24 ` Cornelia Huck
2016-08-12 15:32 ` [Qemu-devel] [PATCH for-2.7 3/4] virtio: add virtqueue_rewind() Stefan Hajnoczi
2016-08-15 8:36 ` Cornelia Huck
2016-08-15 12:34 ` Stefan Hajnoczi
2016-08-12 15:32 ` [Qemu-devel] [PATCH for-2.7 4/4] virtio-balloon: fix stats vq migration Stefan Hajnoczi
2016-08-12 19:43 ` [Qemu-devel] [PATCH for-2.7 0/4] " no-reply
2016-08-15 19:51 ` Gaudenz Steinlin
2016-08-15 21:26 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160813003122-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=gaudenz@debian.org \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.