Pull request

Minor virtio-blk fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJcENnZAAoJEJykq7OBq3PI01IH/j1i5kcsKYNUHzk0tI7du1Nc
 EtZj6Ekf9GQGQjyIJYlX42dkLPVR7fQhGbyj47p/ruSialkUhj6kh4TUX9r3bBG7
 nyLxKbYRNDwtPLC/ZWvHwoOiw8IlnKal4Jx/QGID5/0oRaU8HC98+6r47AZagyg2
 6mLc23icfsx3YL/QAEVKL/OJvFhI/vpUZzL1alpAIRFJWxFEIKgQWvZUbzJq5+Cr
 SyNOZ3G9X5es/cbzEjD5+oqwpMOSkuIRqp2Nb+VHyV8ana1g/y19ZVstj+XkP2qQ
 OeMRl9VV460hh6SFS4Iyq5VzY6qaQ+bSFMRyLuO+rALo9Md+6a6Zw5Si6I/++WE=
 =dWKB
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

Pull request

Minor virtio-blk fixes.

# gpg: Signature made Wed 12 Dec 2018 09:50:17 GMT
# gpg:                using RSA key 9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  virtio-blk: fix comment for virtio_blk_rw_complete as nalloc is initially -1
  virtio-blk: rename iov to out_iov in virtio_blk_handle_request()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2018-12-13 11:35:42 +00:00
commit b39c027d82

View File

@ -96,7 +96,7 @@ static void virtio_blk_rw_complete(void *opaque, int ret)
trace_virtio_blk_rw_complete(vdev, req, ret);
if (req->qiov.nalloc != -1) {
/* If nalloc is != 1 req->qiov is a local copy of the original
/* If nalloc is != -1 req->qiov is a local copy of the original
* external iovec. It was allocated in submit_requests to be
* able to merge requests. */
qemu_iovec_destroy(&req->qiov);
@ -482,7 +482,7 @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
{
uint32_t type;
struct iovec *in_iov = req->elem.in_sg;
struct iovec *iov = req->elem.out_sg;
struct iovec *out_iov = req->elem.out_sg;
unsigned in_num = req->elem.in_num;
unsigned out_num = req->elem.out_num;
VirtIOBlock *s = req->dev;
@ -493,13 +493,13 @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
return -1;
}
if (unlikely(iov_to_buf(iov, out_num, 0, &req->out,
if (unlikely(iov_to_buf(out_iov, out_num, 0, &req->out,
sizeof(req->out)) != sizeof(req->out))) {
virtio_error(vdev, "virtio-blk request outhdr too short");
return -1;
}
iov_discard_front(&iov, &out_num, sizeof(req->out));
iov_discard_front(&out_iov, &out_num, sizeof(req->out));
if (in_iov[in_num - 1].iov_len < sizeof(struct virtio_blk_inhdr)) {
virtio_error(vdev, "virtio-blk request inhdr too short");
@ -526,7 +526,7 @@ static int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
&req->out.sector);
if (is_write) {
qemu_iovec_init_external(&req->qiov, iov, out_num);
qemu_iovec_init_external(&req->qiov, out_iov, out_num);
trace_virtio_blk_handle_write(vdev, req, req->sector_num,
req->qiov.size / BDRV_SECTOR_SIZE);
} else {