qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Li Qiang <liq3ea@gmail.com>
To: Li Qiang <liq3ea@163.com>
Cc: Qemu Developers <qemu-devel@nongnu.org>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH] hw: virtio-pmem: detach the element fromt the virtqueue when error occurs
Date: Fri, 28 Aug 2020 09:21:07 +0800	[thread overview]
Message-ID: <CAKXe6SL3myrx1XcoOVxkD6RxpDMRiOOVorXQrfPnShC0+Y6WUg@mail.gmail.com> (raw)
In-Reply-To: <20200813165125.59928-1-liq3ea@163.com>

Kindly ping.

Li Qiang <liq3ea@163.com> 于2020年8月14日周五 上午12:52写道:
>
> If error occurs while processing the virtio request we should call
> 'virtqueue_detach_element' to detach the element from the virtqueue
> before free the elem.
>
> Signed-off-by: Li Qiang <liq3ea@163.com>
> ---
>  hw/virtio/virtio-pmem.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/hw/virtio/virtio-pmem.c b/hw/virtio/virtio-pmem.c
> index 1e0c137497..ddb0125901 100644
> --- a/hw/virtio/virtio-pmem.c
> +++ b/hw/virtio/virtio-pmem.c
> @@ -77,6 +77,7 @@ static void virtio_pmem_flush(VirtIODevice *vdev, VirtQueue *vq)
>
>      if (req_data->elem.out_num < 1 || req_data->elem.in_num < 1) {
>          virtio_error(vdev, "virtio-pmem request not proper");
> +        virtqueue_detach_element(vq, (VirtQueueElement *)req_data, 0);
>          g_free(req_data);
>          return;
>      }
> --
> 2.17.1
>
>


  parent reply	other threads:[~2020-08-28  1:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13 16:51 [PATCH] hw: virtio-pmem: detach the element fromt the virtqueue when error occurs Li Qiang
2020-08-17 12:17 ` Pankaj Gupta
2020-08-28  1:21 ` Li Qiang [this message]
2020-09-07  1:37   ` Li Qiang
2020-09-10  8:45     ` Pankaj Gupta

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=CAKXe6SL3myrx1XcoOVxkD6RxpDMRiOOVorXQrfPnShC0+Y6WUg@mail.gmail.com \
    --to=liq3ea@gmail.com \
    --cc=liq3ea@163.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).