]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-blk: correctly dirty guest memory
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 2 Apr 2015 17:50:44 +0000 (19:50 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 8 Apr 2015 09:39:18 +0000 (10:39 +0100)
commit2a6cdd6d35158bc7a6aacd92b5b0302f28ec480e
tree51b158464e2013fd972bc2401d74ca13d4281743
parente4603fe139e2161464d7e75faa3a650e31f057fc
virtio-blk: correctly dirty guest memory

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 when the request
is completed.

Based on a patch by Wen Congyang.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Message-id: 1427997044-392-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/block/dataplane/virtio-blk.c
hw/block/virtio-blk.c
include/hw/virtio/virtio-blk.h