Re: [Qemu-devel] [PATCH v2 for-2.3] virtio-blk: correctly dirty guest memory

2015-04-08 Thread Stefan Hajnoczi
On Thu, Apr 02, 2015 at 07:50:44PM +0200, Paolo Bonzini 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. (Writ

Re: [Qemu-devel] [PATCH v2 for-2.3] virtio-blk: correctly dirty guest memory

2015-04-08 Thread Stefan Hajnoczi
On Tue, Apr 7, 2015 at 3:11 PM, Stefan Hajnoczi wrote: > On Thu, Apr 02, 2015 at 07:50:44PM +0200, Paolo Bonzini 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-

Re: [Qemu-devel] [PATCH v2 for-2.3] virtio-blk: correctly dirty guest memory

2015-04-07 Thread Stefan Hajnoczi
On Thu, Apr 02, 2015 at 07:50:44PM +0200, Paolo Bonzini 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. (Writ

Re: [Qemu-devel] [PATCH v2 for-2.3] virtio-blk: correctly dirty guest memory

2015-04-02 Thread Li Zhijian
On 04/03/2015 01:50 AM, Paolo Bonzini 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). Save the

Re: [Qemu-devel] [PATCH v2 for-2.3] virtio-blk: correctly dirty guest memory

2015-04-02 Thread Michael S. Tsirkin
On Thu, Apr 02, 2015 at 08:53:04PM +0200, Paolo Bonzini wrote: > > > On 02/04/2015 20:46, Michael S. Tsirkin wrote: > > Oh, true in fact. It might be a good idea to add something like this to > > the commit log: > > > > Additionally, virtio spec requires that device writes at least > >

Re: [Qemu-devel] [PATCH v2 for-2.3] virtio-blk: correctly dirty guest memory

2015-04-02 Thread Paolo Bonzini
On 02/04/2015 20:46, Michael S. Tsirkin wrote: > Oh, true in fact. It might be a good idea to add something like this to > the commit log: > > Additionally, virtio spec requires that device writes at least > len bytes to descriptor - so that driver can rely on > bytes 0..len-1

Re: [Qemu-devel] [PATCH v2 for-2.3] virtio-blk: correctly dirty guest memory

2015-04-02 Thread Michael S. Tsirkin
On Thu, Apr 02, 2015 at 07:57:22PM +0200, Paolo Bonzini wrote: > > > On 02/04/2015 19:54, Michael S. Tsirkin wrote: > > On Thu, Apr 02, 2015 at 07:50:44PM +0200, Paolo Bonzini wrote: > >> After qemu_iovec_destroy, the QEMUIOVector's size is zeroed and > >> the zero size ultimately is used to comp

Re: [Qemu-devel] [PATCH v2 for-2.3] virtio-blk: correctly dirty guest memory

2015-04-02 Thread Paolo Bonzini
On 02/04/2015 19:54, Michael S. Tsirkin wrote: > On Thu, Apr 02, 2015 at 07:50:44PM +0200, Paolo Bonzini 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 dev

Re: [Qemu-devel] [PATCH v2 for-2.3] virtio-blk: correctly dirty guest memory

2015-04-02 Thread Michael S. Tsirkin
On Thu, Apr 02, 2015 at 07:50:44PM +0200, Paolo Bonzini 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. (Writ

[Qemu-devel] [PATCH v2 for-2.3] virtio-blk: correctly dirty guest memory

2015-04-02 Thread Paolo Bonzini
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). Save the size in virtio_blk_handle_request, and use it