From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHULm-0006Bo-8a for qemu-devel@nongnu.org; Wed, 13 Aug 2014 04:56:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHULg-0004hf-4x for qemu-devel@nongnu.org; Wed, 13 Aug 2014 04:56:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHULf-0004hU-Tt for qemu-devel@nongnu.org; Wed, 13 Aug 2014 04:56:00 -0400 Date: Wed, 13 Aug 2014 09:55:53 +0100 From: Stefan Hajnoczi Message-ID: <20140813085553.GA27053@stefanha-thinkpad.redhat.com> References: <1407209598-2572-1-git-send-email-ming.lei@canonical.com> <20140805094844.GF4391@noname.str.redhat.com> <20140805134815.GD12251@stefanha-thinkpad.redhat.com> <20140805144728.GH4391@noname.str.redhat.com> <20140806084855.GA4090@noname.str.redhat.com> <20140810114624.0305b7af@tom-ThinkPad-T410> <53E91B5D.4090009@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline In-Reply-To: <53E91B5D.4090009@redhat.com> Subject: Re: [Qemu-devel] [PATCH v1 00/17] dataplane: optimization and multi virtqueue support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , tom.leiming@gmail.com, Ming Lei , Fam Zheng , qemu-devel --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 11, 2014 at 09:37:01PM +0200, Paolo Bonzini wrote: > Il 10/08/2014 05:46, Ming Lei ha scritto: > @@ -4356,6 +4353,20 @@ BlockDriverAIOCB *bdrv_aio_readv(BlockDriverState = *bs, int64_t sector_num, > { > trace_bdrv_aio_readv(bs, sector_num, nb_sectors, opaque); > =20 > + if (bs->drv && bs->drv->bdrv_aio_readv && > + bs->drv->bdrv_aio_readv !=3D bdrv_aio_readv_em && > + nb_sectors >=3D 0 && nb_sectors <=3D (UINT_MAX >> BDRV_SECTOR_BI= TS) && > + !bdrv_check_byte_request(bs, sector_num << BDRV_SECTOR_BITS, > + nb_sectors << BDRV_SECTOR_BITS) && > + !bs->copy_on_read && !bs->io_limits_enabled && > + bs->request_alignment <=3D BDRV_SECTOR_SIZE) { > + BlockDriverAIOCB *acb =3D > + bs->drv->bdrv_aio_readv(bs, sector_num, qiov, nb_sectors, > + cb, opaque); > + assert(acb); Minor issue: block.h:bdrv_aio_readv() guarantees the return value is non-NULL but BlockDriver->bdrv_aio_readv() does not. The floppy disk (fd_open()) code path in raw-posix.c can return NULL so we would need to return a BlockDriverAIOCB and set up a BH that will complete with -EIO. Stefan --jI8keyz6grp/JLjh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJT6ygZAAoJEJykq7OBq3PIp78H/1IbIDd6NwUo8Y/Xttft1OfB lggvo/CMilEYLR5FT2Hc8KXZ3je0bQIjb49s7eleyTa1DhRZt2jiNlTOr6SMnarK haz/TpjHlSHktvHJhl7HLP5UNtQJXYnlkBwDaubBhpHkg7p1MqCRfH6oS/Zd2Dj0 q37CwCJEKiUzzfIsjh0PluC7JIwRB/0yFce/YAPXCQ9/YejerCCwqJ2sC7Asj6+l 7xYGbS2Aq45vDsCeCjXG/t6bncInFi8wW8R6gsbj1aTMzZilp+FBP490DSNRnqvZ tK8QnydqHAMHRbL4cu5AfanoRJxLQHTAVjFbQwQy4ti+Fx+d6oIWMzPv47Rt8T0= =SVHa -----END PGP SIGNATURE----- --jI8keyz6grp/JLjh--