qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/4] dataplane: change vring API to use VirtQueu


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 3/4] dataplane: change vring API to use VirtQueueElement
Date: Wed, 4 Dec 2013 15:06:49 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]