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

Re: [Xen-devel] [PATCH v6 2/2] qdisk - hw/block/xen_disk: grant copy implementation



On Thu, 8 Sep 2016, Paulina Szubarczyk wrote:
> > > @@ -582,6 +722,9 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
> > >       }
> > >       default:
> > >           /* unknown operation (shouldn't happen -- parse catches this) */
> > > +        if (!ioreq->blkdev->feature_grant_copy) {
> > > +            ioreq_unmap(ioreq);
> > > +        }
> > 
> > Why are you adding this? Is it a bug fix? If so, please explain in the
> > commit message.
> > 
> It is not a bug fix. In the ioreq_runio_qemu_aio there were two error labels
> 'err_no_map' and 'err' each of them used once. So before the patch the labels
> are looking this way:
> err:
>     ioreq_unmap(ioreq);
> err_no_map:
>     ioreq_finish(ioreq);
>     ioreq->status = BLKIF_RSP_ERROR;
>     return -1;
> 
> I removed the 'err_no_map' label and from the 'err' section I removed the
> ioreq_unmap. The 'err' label was previously used in that default section of
> the switch because the grant_map is called regardless the
> ioreq->req.operation.
> 
> In the patch, there is no need for any special behavior for grant_copy,
> because buffers were not allocated in this case, so there is only jump to
> 'err'.
> 
> An advantage of this change is one unified error path for both grant
> operations.

Thanks for the explanation, it looks fine.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.