From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBTNZ-0004iN-A3 for qemu-devel@nongnu.org; Fri, 10 Jun 2016 16:50:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBTNY-0001ZX-2n for qemu-devel@nongnu.org; Fri, 10 Jun 2016 16:50:09 -0400 References: <1465574722-27656-1-git-send-email-kwolf@redhat.com> <1465574722-27656-2-git-send-email-kwolf@redhat.com> From: Eric Blake Message-ID: <575B27F8.70702@redhat.com> Date: Fri, 10 Jun 2016 14:50:00 -0600 MIME-Version: 1.0 In-Reply-To: <1465574722-27656-2-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5IspNHDGUw1FLPhbMMNCcTisnlDcXDien" Subject: Re: [Qemu-devel] [PATCH 1/6] block: Introduce bdrv_preadv() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: mreitz@redhat.com, qemu-devel@nongnu.org, famz@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --5IspNHDGUw1FLPhbMMNCcTisnlDcXDien Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/10/2016 10:05 AM, Kevin Wolf wrote: > We already have a byte-based bdrv_pwritev(), but the read counterpart > was still missing. This commit adds it. >=20 > Signed-off-by: Kevin Wolf > --- > block/io.c | 20 +++++++++++++------- > include/block/block.h | 1 + > 2 files changed, 14 insertions(+), 7 deletions(-) >=20 Worth adding a flags argument while at it? But bdrv_pwritev() lacks one, so for symmetry reasons, I'm okay if you don't bother. > +int bdrv_preadv(BlockDriverState *bs, int64_t offset, QEMUIOVector *qi= ov) > +{ > + int ret; > + > + ret =3D bdrv_prwv_co(bs, offset, qiov, false, 0); > + if (ret < 0) { > + return ret; > + } > + > + return qiov->size; This implies we never have a short read, it's an all-or-none error or success. Matches what we've done elsewhere, so I guess it's right. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --5IspNHDGUw1FLPhbMMNCcTisnlDcXDien 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/ iQEcBAEBCAAGBQJXWyf4AAoJEKeha0olJ0NqbIAH+wbyezLUmlBVKn71Y/15v0zE U+U4vRK8rF/uHmquyERTsNpv61xg1wNljcPpwlX2HVgNjrGqk6gHYdrCaV/Lq8JZ nE23UPod1TKFRLKcd511IMEc8LnRf4bxJ2WtQZRpGq5QWXHJPeBYJbYN2LPczXV7 DKK1n9JAymOcfEuKI2zLZhsk8TKLLl1SOGsmh3C1YdLAuKMFmzG7cF3rSqFLu04J LNPdoP1lTVMpKAQlnybfWJYNDSsay9SbOZJFvh3SlV/IBUnx6ESqAEuq0chtfDJ4 KkWh6ms16x9doYcseB2prl+Quy3m9snHOn/rKhQAdagdA483gXSRCvPZIrbms3Y= =3BDA -----END PGP SIGNATURE----- --5IspNHDGUw1FLPhbMMNCcTisnlDcXDien--