Received: from eggs.gnu.org ([209.51.188.92]:55408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwWBp-0008P0-ME for qemu-devel@nongnu.org; Wed, 20 Feb 2019 13:01:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwWBn-0004jW-KN for qemu-devel@nongnu.org; Wed, 20 Feb 2019 13:01:49 -0500 References: <20190220174843.8847-1-kwolf@redhat.com> <20190220174843.8847-6-kwolf@redhat.com> From: Paolo Bonzini Message-ID: Date: Wed, 20 Feb 2019 19:01:22 +0100 MIME-Version: 1.0 In-Reply-To: <20190220174843.8847-6-kwolf@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 05/13] io: Remove redundant read/write_coroutine assignments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: mreitz@redhat.com, eblake@redhat.com, qemu-devel@nongnu.org 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