From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfUDf-0001e0-Ry for qemu-devel@nongnu.org; Tue, 07 Apr 2015 10:11:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YfUDd-00089Q-5r for qemu-devel@nongnu.org; Tue, 07 Apr 2015 10:11:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfUDc-00089J-WD for qemu-devel@nongnu.org; Tue, 07 Apr 2015 10:11:09 -0400 Date: Tue, 7 Apr 2015 15:11:04 +0100 From: Stefan Hajnoczi Message-ID: <20150407141104.GE21559@stefanha-thinkpad.redhat.com> References: <1427997044-392-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="idY8LE8SD6/8DnRI" Content-Disposition: inline In-Reply-To: <1427997044-392-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 for-2.3] virtio-blk: correctly dirty guest memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, famz@redhat.com, zhang.zhanghailiang@huawei.com, mst@redhat.com, qemu-devel@nongnu.org --idY8LE8SD6/8DnRI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. (Writes were okay). >=20 > Save the size in virtio_blk_handle_request, and use it when the request > is completed. >=20 > Based on a patch by Wen Congyang. >=20 > Signed-off-by: Wen Congyang > Signed-off-by: Paolo Bonzini > --- > hw/block/dataplane/virtio-blk.c | 3 +-- > hw/block/virtio-blk.c | 13 ++++++++++++- > include/hw/virtio/virtio-blk.h | 1 + > 3 files changed, 14 insertions(+), 3 deletions(-) This also changes len for VIRTIO_BLK_T_SCSI_CMD and VIRTIO_BLK_T_GET_ID. The Linux virtio_blk.ko and Windows viostor drivers ignore the value anyway so what's the worst thing that could happen? :) Reviewed-by: Stefan Hajnoczi --idY8LE8SD6/8DnRI Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVI+V4AAoJEJykq7OBq3PIbjoH/itwCg88ATPPUqSZTcczXxmu QiXIqVOoOCxOhgBIVsmmuTb/7sozNPc1mHt4CZUqgWjW8Vgn+EnNK1ENBviblL+v PjANCFJpu8MlTAVt4eB4VtF9oiloJfd5idOfJQXn4i1GFgliIWkPvId7TepPfZD2 WsyX4HIjimMXBFiEqdQ5zAqjXlMwY2YEtt/wlh+XIXKTMAfw7yUTsISoGSl3jY/y 8Zmo0IXEjpmnyL1anbLfMXRBVC+MgYMagtyoNeU93AlCXE/iBBqeJ61J0BgpDUnz KoLgSSLvumdoy7YtTUkYoXREtplIRFFbuPqCjvoND0BLyV5qNhVXJ1ZNcKXFg38= =tofI -----END PGP SIGNATURE----- --idY8LE8SD6/8DnRI--