qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v2 05/13] io: Remove redundant read/write_corout


From: Paolo Bonzini
Subject: Re: [Qemu-block] [PATCH v2 05/13] io: Remove redundant read/write_coroutine assignments
Date: Wed, 20 Feb 2019 19:01:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 20/02/19 18:48, Kevin Wolf wrote:
> -static void qio_channel_set_aio_fd_handlers(QIOChannel *ioc);
> -
>  static void qio_channel_restart_read(void *opaque)
>  {
>      QIOChannel *ioc = opaque;
>      Coroutine *co = ioc->read_coroutine;
>  
> -    ioc->read_coroutine = NULL;
> -    qio_channel_set_aio_fd_handlers(ioc);
> -    aio_co_wake(co);
> +    assert(qemu_get_current_aio_context() ==
> +           qemu_coroutine_get_aio_context(co));
> +    qemu_coroutine_enter(co);
>  }
>  
>  static void qio_channel_restart_write(void *opaque)
> @@ -417,9 +415,9 @@ static void qio_channel_restart_write(void *opaque)
>      QIOChannel *ioc = opaque;
>      Coroutine *co = ioc->write_coroutine;
>  
> -    ioc->write_coroutine = NULL;
> -    qio_channel_set_aio_fd_handlers(ioc);
> -    aio_co_wake(co);
> +    assert(qemu_get_current_aio_context() ==
> +           qemu_coroutine_get_aio_context(co));
> +    qemu_coroutine_enter(co);
>  }
>  
>  static void qio_channel_set_aio_fd_handlers(QIOChannel *ioc)
> 

aio_co_wake was also acquiring/releasing the AioContext, so
that needs to stay for now.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]