Re: [Qemu-devel] [PATCH 11/16] block: explicitly acquire aiocontext in callbacks that need it

2017-01-18 Thread Stefan Hajnoczi
On Fri, Jan 13, 2017 at 02:17:26PM +0100, Paolo Bonzini wrote:
> This covers both file descriptor callbacks and polling callbacks,
> since they execute related code.
> 
> Signed-off-by: Paolo Bonzini 
> ---
>  aio-posix.c   |  7 ---
>  aio-win32.c   |  6 --
>  block/curl.c  | 16 +---
>  block/iscsi.c |  4 
>  block/linux-aio.c |  4 
>  block/nfs.c   |  6 ++
>  block/sheepdog.c  | 29 +++--
>  block/ssh.c   | 29 +
>  block/win32-aio.c | 10 ++
>  hw/block/virtio-blk.c |  5 -
>  hw/scsi/virtio-scsi.c |  6 ++
>  nbd/server.c  |  4 
>  12 files changed, 71 insertions(+), 55 deletions(-)

Reviewed-by: Stefan Hajnoczi 


signature.asc
Description: PGP signature


Re: [Qemu-devel] [PATCH 11/16] block: explicitly acquire aiocontext in callbacks that need it

2017-01-16 Thread Paolo Bonzini


On 16/01/2017 14:36, Fam Zheng wrote:
>> +/* Note that the handlers do not expect any concurrency; qemu-nbd
>> + * does not instantiate multiple AioContexts yet, nor does it call
>> + * aio_poll/aio_dispatch from multiple threads.
>> + */
>>  aio_set_fd_handler(client->exp->ctx, client->sioc->fd, true,
>> client->can_read ? nbd_read : NULL,
>> client->send_coroutine ? nbd_restart_write : 
>> NULL,
> 
> What about the built-in server (QMP nbd_server_start)?

Will fix. :)

Paolo



Re: [Qemu-devel] [PATCH 11/16] block: explicitly acquire aiocontext in callbacks that need it

2017-01-16 Thread Fam Zheng
On Fri, 01/13 14:17, Paolo Bonzini wrote:
> diff --git a/nbd/server.c b/nbd/server.c
> index efe5cb8..08fb720 100644
> --- a/nbd/server.c
> +++ b/nbd/server.c
> @@ -1366,6 +1366,10 @@ static void nbd_restart_write(void *opaque)
>  static void nbd_set_handlers(NBDClient *client)
>  {
>  if (client->exp && client->exp->ctx) {
> +/* Note that the handlers do not expect any concurrency; qemu-nbd
> + * does not instantiate multiple AioContexts yet, nor does it call
> + * aio_poll/aio_dispatch from multiple threads.
> + */
>  aio_set_fd_handler(client->exp->ctx, client->sioc->fd, true,
> client->can_read ? nbd_read : NULL,
> client->send_coroutine ? nbd_restart_write : NULL,

What about the built-in server (QMP nbd_server_start)?

> -- 
> 2.9.3
> 
>