From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5Md0-00042m-S2 for qemu-devel@nongnu.org; Tue, 24 May 2016 20:24:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5Mcz-0003lo-Lp for qemu-devel@nongnu.org; Tue, 24 May 2016 20:24:50 -0400 References: <1464097654-12977-1-git-send-email-kwolf@redhat.com> <1464097654-12977-6-git-send-email-kwolf@redhat.com> From: Eric Blake Message-ID: <5744F0C9.7050105@redhat.com> Date: Tue, 24 May 2016 18:24:41 -0600 MIME-Version: 1.0 In-Reply-To: <1464097654-12977-6-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wWgxMpvmb72Xbth2GGEt4bkiXqdbUGKik" Subject: Re: [Qemu-devel] [PATCH v2 05/14] block: Make blk_co_preadv/pwritev() public List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: berto@igalia.com, jcody@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, jsnow@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wWgxMpvmb72Xbth2GGEt4bkiXqdbUGKik Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/24/2016 07:47 AM, Kevin Wolf wrote: > Also add trace points now that the function can be directly called. >=20 > Signed-off-by: Kevin Wolf > --- > block/block-backend.c | 21 ++++++++++++++------- > include/sysemu/block-backend.h | 6 ++++++ > trace-events | 4 ++++ > 3 files changed, 24 insertions(+), 7 deletions(-) >=20 > @@ -741,11 +742,15 @@ static int blk_check_request(BlockBackend *blk, i= nt64_t sector_num, > nb_sectors * BDRV_SECTOR_SIZE); > } > =20 > -static int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offse= t, > - unsigned int bytes, QEMUIOVector= *qiov, > - BdrvRequestFlags flags) > +int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset, > + unsigned int bytes, QEMUIOVector *qiov,= Isn't bytes redundant with qiov->size? Or can qiov be NULL? Should we assert(!qiov || qiov->size =3D=3D bytes)? > +int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset, > + unsigned int bytes, QEMUIOVector *qiov= , > + BdrvRequestFlags flags) > { Ditto. When doing write_zeroes, do we want qiov =3D=3D NULL, must we alwa= ys have qiov but just leave qiov->iov[0].base as NULL? Probably worth documenting as part of making it public. > +++ b/include/sysemu/block-backend.h > @@ -113,6 +113,12 @@ void *blk_get_attached_dev(BlockBackend *blk); > void blk_set_dev_ops(BlockBackend *blk, const BlockDevOps *ops, void *= opaque); > int blk_pread_unthrottled(BlockBackend *blk, int64_t offset, uint8_t *= buf, > int count); > +int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset, > + unsigned int bytes, QEMUIOVector *qiov,= > + BdrvRequestFlags flags); > +int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset, > + unsigned int bytes, QEMUIOVector *qiov,= > + BdrvRequestFlags flags); Note that my earlier addition of blk_aio_pwritev intentionally omitted the bytes argument, relying solely on qiov->size. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --wWgxMpvmb72Xbth2GGEt4bkiXqdbUGKik 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/ iQEcBAEBCAAGBQJXRPDJAAoJEKeha0olJ0NqaGAH/jH3R+HElGxIR1bWnEIaB4Bo 90DwVKlbyd2j6VMIzSnJd3gm4EpCT96hoxkyCGB5NhMqu5PUu+t+DxlsjPsauynr +C01aKMxHsqxn3DICeCim39Gd+tmLGakmzw78bFNTZ+yZ1ECeXXccwhmfQCV6cs0 +wsOul/S7TlGjF5fND8qjqIDOmrzdaVdpyO+jQiyDhSJjUF1EZaMBnTXs+3cQT11 Y1VOzAVA1KK9KkYURmg6PCnZKSev252go4G5lHhhlR99jKZpNqlxnw+whb4D6qpq ssRjchkBnvDvycmyuJi7Kjslb4HWpjCZ2NBi7FSZhvkDLGGZ+bpzensvXXxX4qE= =hP33 -----END PGP SIGNATURE----- --wWgxMpvmb72Xbth2GGEt4bkiXqdbUGKik--