On 02/04/2015 17:16, Fam Zheng wrote:
>>>> > >> After qemu_iovec_destroy, the QEMUIOVector's size is zeroed and
>>>> > >> the zero size ultimately is used to compute virtqueue_push's len
>>>> > >> argument.  Therefore, reads from virtio-blk devices did not
>>>> > >> migrate their results correctly.  (Writes were okay).
>>> > > 
>>> > > Can't we move qemu_iovec_destroy to virtio_blk_free_request?
>> > 
>> > You would still have to add more code to differentiate reads and
>> > writes---I think.
> Yeah, but the extra field will not be needed.

Can you post an alternative patch?  One small complication is that
is_write is in mrb but not in mrb->reqs[x].  virtio_blk_rw_complete is
already doing

    int p = virtio_ldl_p(VIRTIO_DEVICE(req->dev), &req->out.type);
    bool is_read = !(p & VIRTIO_BLK_T_OUT);

but only in a slow path.

Paolo

Reply via email to