[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 11/25] nfs: implement .bdrv_detach/attach_aio
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v2 11/25] nfs: implement .bdrv_detach/attach_aio_context() |
Date: |
Thu, 8 May 2014 15:46:36 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, May 07, 2014 at 04:12:12PM +0200, Peter Lieven wrote:
> On 07.05.2014 12:27, Stefan Hajnoczi wrote:
> >Drop the assumption that we're using the main AioContext. The following
> >functions need to be converted:
> > * qemu_bh_new() -> aio_bh_new()
> > * qemu_aio_set_fd_handler() -> aio_set_fd_handler()
> > * qemu_aio_wait() -> aio_poll()
> >
> >The .bdrv_detach/attach_aio_context() interfaces also need to be
> >implemented to move the fd handler from the old to the new AioContext.
> >
> >Cc: Peter Lieven <address@hidden>
> >Signed-off-by: Stefan Hajnoczi <address@hidden>
> >---
> > block/nfs.c | 80
> > ++++++++++++++++++++++++++++++++++++++++++-------------------
> > 1 file changed, 56 insertions(+), 24 deletions(-)
> >
> >diff --git a/block/nfs.c b/block/nfs.c
> >index 9fa831f..33f198b 100644
> >--- a/block/nfs.c
> >+++ b/block/nfs.c
> >@@ -40,6 +40,7 @@ typedef struct NFSClient {
> > struct nfsfh *fh;
> > int events;
> > bool has_zero_init;
> >+ AioContext *aio_context;
> > } NFSClient;
> > typedef struct NFSRPC {
> >@@ -49,6 +50,7 @@ typedef struct NFSRPC {
> > struct stat *st;
> > Coroutine *co;
> > QEMUBH *bh;
> >+ AioContext *aio_context;
> > } NFSRPC;
>
> If you need to respin for some reason, I would copy the pointer
> to the whole NFSClient struct here just in case we need any other
> member of that struct in the future.
Fixed in v3.
> >@@ -403,7 +432,7 @@ static int64_t
> >nfs_get_allocated_file_size(BlockDriverState *bs)
> > while (!task.complete) {
> > nfs_set_events(client);
> >- qemu_aio_wait();
> >+ aio_poll(bdrv_get_aio_context(bs), true);
> > }
>
> Why not
>
> aio_poll(client->aio_context, true);
>
> ?
Fixed in v3.
Stefan
- [Qemu-devel] [PATCH v2 12/25] qed: use BlockDriverState's AioContext, (continued)
- [Qemu-devel] [PATCH v2 12/25] qed: use BlockDriverState's AioContext, Stefan Hajnoczi, 2014/05/07
- [Qemu-devel] [PATCH v2 14/25] block/raw-posix: implement .bdrv_detach/attach_aio_context(), Stefan Hajnoczi, 2014/05/07
- [Qemu-devel] [PATCH v2 13/25] quorum: implement .bdrv_detach/attach_aio_context(), Stefan Hajnoczi, 2014/05/07
- [Qemu-devel] [PATCH v2 15/25] block/linux-aio: fix memory and fd leak, Stefan Hajnoczi, 2014/05/07
- [Qemu-devel] [PATCH v2 16/25] block/raw-win32: create one QEMUWin32AIOState per BDRVRawState, Stefan Hajnoczi, 2014/05/07
- [Qemu-devel] [PATCH v2 11/25] nfs: implement .bdrv_detach/attach_aio_context(), Stefan Hajnoczi, 2014/05/07
- [Qemu-devel] [PATCH v2 18/25] rbd: use BlockDriverState's AioContext, Stefan Hajnoczi, 2014/05/07
- [Qemu-devel] [PATCH v2 17/25] block/raw-win32: implement .bdrv_detach/attach_aio_context(), Stefan Hajnoczi, 2014/05/07
- [Qemu-devel] [PATCH v2 20/25] ssh: use BlockDriverState's AioContext, Stefan Hajnoczi, 2014/05/07
- [Qemu-devel] [PATCH v2 21/25] vmdk: implement .bdrv_detach/attach_aio_context(), Stefan Hajnoczi, 2014/05/07
- [Qemu-devel] [PATCH v2 22/25] dataplane: use the QEMU block layer for I/O, Stefan Hajnoczi, 2014/05/07
- [Qemu-devel] [PATCH v2 23/25] dataplane: delete IOQueue since it is no longer used, Stefan Hajnoczi, 2014/05/07
- [Qemu-devel] [PATCH v2 24/25] dataplane: implement async flush, Stefan Hajnoczi, 2014/05/07
- [Qemu-devel] [PATCH v2 25/25] raw-posix: drop raw_get_aio_fd() since it is no longer used, Stefan Hajnoczi, 2014/05/07