qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH 3/4] dataplane: change vring API to use VirtQueueElement
Date: Wed, 4 Dec 2013 15:06:49 +0100	[thread overview]
Message-ID: <20131204140649.GA27759@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1381417639-22547-4-git-send-email-pbonzini@redhat.com>

On Thu, Oct 10, 2013 at 05:07:18PM +0200, Paolo Bonzini wrote:
> @@ -298,30 +278,31 @@ static void handle_notify(EventNotifier *e)
>          vring_disable_notification(s->vdev, &s->vring);
>  
>          for (;;) {
> -            head = vring_pop(s->vdev, &s->vring, iov, end, &out_num, &in_num);
> -            if (head < 0) {
> +            ret = vring_pop(s->vdev, &s->vring, &elem);
> +            if (ret < 0) {
> +                assert(elem == NULL);
>                  break; /* no more requests */
>              }
>  
> -            trace_virtio_blk_data_plane_process_request(s, out_num, in_num,
> -                                                        head);
> +            trace_virtio_blk_data_plane_process_request(s, elem->out_num,
> +                                                        elem->in_num, elem->index);
>  
> -            if (process_request(&s->ioqueue, iov, out_num, in_num, head) < 0) {
> +            if (process_request(&s->ioqueue, elem) < 0) {
>                  vring_set_broken(&s->vring);
> +                vring_push(&s->vring, elem, 0);

If we give up on the vring I don't think we should push the element
back.  It may cause the guest to panic.

I guess what we really need here is to unmap scatter-gather buffers and
delete elem.

Stefan

  reply	other threads:[~2013-12-04 14:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-10 15:07 [Qemu-devel] [PATCH 0/4] dataplane: use more of the generic virtio data structures, drop hostmem Paolo Bonzini
2013-10-10 15:07 ` [Qemu-devel] [PATCH 1/4] vring: create a common function to parse descriptors Paolo Bonzini
2013-10-10 15:07 ` [Qemu-devel] [PATCH 2/4] vring: factor common code for error exits Paolo Bonzini
2013-10-10 20:53   ` Richard Henderson
2013-10-11  9:19     ` Paolo Bonzini
2013-10-10 15:07 ` [Qemu-devel] [PATCH 3/4] dataplane: change vring API to use VirtQueueElement Paolo Bonzini
2013-12-04 14:06   ` Stefan Hajnoczi [this message]
2013-12-04 17:40     ` Paolo Bonzini
2013-12-05  9:24       ` Stefan Hajnoczi
2013-12-05 10:34         ` Paolo Bonzini
2013-12-06  9:02           ` Stefan Hajnoczi
2013-10-10 15:07 ` [Qemu-devel] [PATCH 4/4] dataplane: replace hostmem with memory_region_find Paolo Bonzini
2013-12-04 14:12 ` [Qemu-devel] [PATCH 0/4] dataplane: use more of the generic virtio data structures, drop hostmem Stefan Hajnoczi

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=20131204140649.GA27759@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=pbonzini@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 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).