From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b07DP-0000ie-HB for qemu-devel@nongnu.org; Tue, 10 May 2016 08:56:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b07DO-0006a4-1j for qemu-devel@nongnu.org; Tue, 10 May 2016 08:56:43 -0400 References: <1462552005-4887-1-git-send-email-eblake@redhat.com> <1462552005-4887-7-git-send-email-eblake@redhat.com> <20160510085544.GE4921@noname.str.redhat.com> From: Eric Blake Message-ID: <5731DA81.90702@redhat.com> Date: Tue, 10 May 2016 06:56:33 -0600 MIME-Version: 1.0 In-Reply-To: <20160510085544.GE4921@noname.str.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vXUR6HsE6bQte4TP7lsqs6088cVFMwT88" Subject: Re: [Qemu-devel] [PATCH v7 06/19] scsi-disk: Switch to byte-based aio block access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Paolo Bonzini This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vXUR6HsE6bQte4TP7lsqs6088cVFMwT88 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/10/2016 02:55 AM, Kevin Wolf wrote: > Am 06.05.2016 um 18:26 hat Eric Blake geschrieben: >> Sector-based blk_aio_readv() and blk_aio_writev() should die; switch >> to byte-based blk_aio_preadv() and blk_aio_pwritev() instead. >> >> As part of the cleanup, scsi_init_iovec() no longer needs to return >> a value, and reword a comment. >> >> Signed-off-by: Eric Blake >> >> @@ -118,7 +118,6 @@ static uint32_t scsi_init_iovec(SCSIDiskReq *r, si= ze_t size) >> } >> r->iov.iov_len =3D MIN(r->sector_count * 512, r->buflen); >> qemu_iovec_init_external(&r->qiov, &r->iov, 1); >> - return r->qiov.size / 512; >=20 > The return value was MIN(r->sector_count, SCSI_DMA_BUF_SIZE / 512). >=20 >> } >> >> static void scsi_disk_save_request(QEMUFile *f, SCSIRequest *req) >> - n =3D scsi_init_iovec(r, SCSI_DMA_BUF_SIZE); >> + scsi_init_iovec(r, SCSI_DMA_BUF_SIZE); >> block_acct_start(blk_get_stats(s->qdev.conf.blk), &r->acct, >> - n * BDRV_SECTOR_SIZE, BLOCK_ACCT_READ); >> - r->req.aiocb =3D blk_aio_readv(s->qdev.conf.blk, r->sector, &= r->qiov, n, >> - scsi_read_complete, r); >> + SCSI_DMA_BUF_SIZE, BLOCK_ACCT_READ); >=20 > But here you use SCSI_DMA_BUF_SIZE without considering r->sector_count.= > Is this correct or are requests that are smaller than SCSI_DMA_BUF_SIZE= > now accounted for more data than they actually read? >=20 > Would r->qiov.size be more obviously correct? You did that for writes. Yes. Is that something you are able to fix on commit, or should I submit a fixup? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --vXUR6HsE6bQte4TP7lsqs6088cVFMwT88 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXMdqBAAoJEKeha0olJ0NquN4IAIDXvEL/VWCNpEMjDC3bIT1w KK1M1jyrlyZky+QTKK0kZeCZZJx5Q4tcsTZNUQkr3PlFR9ibjVZRvA7ikGwqj9ga gVMsfTgVDnLjPCICNidlSVy1kUslRcR1+Mmjy5w3fFQMFAGhqbTvHOe1uaM2975K iyeBDJ2NkGCMyuLx9Ezp7En4IkaG67Oi3Kzefnv4Wb5tl+nBek8/eCrBxsV2oXA/ kGUNePwk4IWLt/Jv3e8Vqi2OAnY0mjMRIsUZZUZ1zopSCFyYE5K0505tjLh7PwDA AntiG3qMGE/PusEhh0W2cjGvpUN3BbtGKphxdsUi2rAQeqqZmpAtJBjQogYVFRM= =FQ/d -----END PGP SIGNATURE----- --vXUR6HsE6bQte4TP7lsqs6088cVFMwT88--