From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8rqm-0008Mb-A6 for qemu-devel@nongnu.org; Fri, 03 Jun 2016 12:21:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8rql-0000KW-CI for qemu-devel@nongnu.org; Fri, 03 Jun 2016 12:21:32 -0400 Date: Fri, 3 Jun 2016 18:21:22 +0200 From: Kevin Wolf Message-ID: <20160603162122.GD5712@noname.redhat.com> References: <1464815413-613-1-git-send-email-eblake@redhat.com> <1464815413-613-11-git-send-email-eblake@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464815413-613-11-git-send-email-eblake@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 10/13] raw-posix: Convert to bdrv_co_pwrite_zeroes() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Max Reitz Am 01.06.2016 um 23:10 hat Eric Blake geschrieben: > Another step on our continuing quest to switch to byte-based > interfaces. > > Signed-off-by: Eric Blake > --- > block/raw-posix.c | 34 +++++++++++++++++----------------- > trace-events | 2 +- > 2 files changed, 18 insertions(+), 18 deletions(-) > > diff --git a/block/raw-posix.c b/block/raw-posix.c > index a4f5a1b..8bfcb4a 100644 > --- a/block/raw-posix.c > +++ b/block/raw-posix.c > @@ -1252,8 +1252,8 @@ static int aio_worker(void *arg) > } > > static int paio_submit_co(BlockDriverState *bs, int fd, > - int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, > - int type) > + int64_t offset, QEMUIOVector *qiov, > + int count, int type) > { > RawPosixAIOData *acb = g_new(RawPosixAIOData, 1); > ThreadPool *pool; > @@ -1262,16 +1262,16 @@ static int paio_submit_co(BlockDriverState *bs, int fd, > acb->aio_type = type; > acb->aio_fildes = fd; > > - acb->aio_nbytes = nb_sectors * BDRV_SECTOR_SIZE; > - acb->aio_offset = sector_num * BDRV_SECTOR_SIZE; > + acb->aio_nbytes = count; > + acb->aio_offset = offset; > > if (qiov) { > acb->aio_iov = qiov->iov; > acb->aio_niov = qiov->niov; > - assert(qiov->size == acb->aio_nbytes); > + assert(qiov->size == count); > } > > - trace_paio_submit_co(sector_num, nb_sectors, type); > + trace_paio_submit_co(offset, qiov->size, type); As discussed on IRC, I'm fixing this up in my branch with s/qiov->size/count/ because qiov can be NULL. This fixes qemu-iotests 048 for raw. > pool = aio_get_thread_pool(bdrv_get_aio_context(bs)); > return thread_pool_submit_co(pool, aio_worker, acb); > } Kevin