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); > > + if (bs->drv && bs->drv->bdrv_aio_readv && > + bs->drv->bdrv_aio_readv != bdrv_aio_readv_em && > + nb_sectors >= 0 && nb_sectors <= (UINT_MAX >> BDRV_SECTOR_BITS) && > + !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 <= BDRV_SECTOR_SIZE) { > + BlockDriverAIOCB *acb = > + 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
pgpjpQYmymSZA.pgp
Description: PGP signature