Re: [Qemu-devel] [PATCH] nbd-client: avoid spurious qio_channel_yield() re-entry

2017-08-23 Thread Paolo Bonzini
On 23/08/2017 16:51, Eric Blake wrote: > On 08/22/2017 07:51 AM, Stefan Hajnoczi wrote: >> The following scenario leads to an assertion failure in >> qio_channel_yield(): >> >> 1. Request coroutine calls qio_channel_yield() successfully when sending >>would block on the socket. It is now

Re: [Qemu-devel] [PATCH] nbd-client: avoid spurious qio_channel_yield() re-entry

2017-08-23 Thread Paolo Bonzini
On 23/08/2017 16:45, Stefan Hajnoczi wrote: > That depends on the BDRV_POLL_WHILE() allowing all request coroutines to > terminate before we call nbd_client_detach_aio_context(): > > qio_channel_shutdown(client->ioc, > QIO_CHANNEL_SHUTDOWN_BOTH, >

Re: [Qemu-devel] [PATCH] nbd-client: avoid spurious qio_channel_yield() re-entry

2017-08-23 Thread Eric Blake
On 08/22/2017 07:51 AM, Stefan Hajnoczi wrote: > The following scenario leads to an assertion failure in > qio_channel_yield(): > > 1. Request coroutine calls qio_channel_yield() successfully when sending >would block on the socket. It is now yielded. > 2. nbd_read_reply_entry() calls

Re: [Qemu-devel] [PATCH] nbd-client: avoid spurious qio_channel_yield() re-entry

2017-08-23 Thread Vladimir Sementsov-Ogievskiy
22.08.2017 15:51, Stefan Hajnoczi wrote: The following scenario leads to an assertion failure in qio_channel_yield(): 1. Request coroutine calls qio_channel_yield() successfully when sending would block on the socket. It is now yielded. 2. nbd_read_reply_entry() calls

Re: [Qemu-devel] [PATCH] nbd-client: avoid spurious qio_channel_yield() re-entry

2017-08-23 Thread Eric Blake
On 08/22/2017 07:51 AM, Stefan Hajnoczi wrote: > The following scenario leads to an assertion failure in > qio_channel_yield(): > > 1. Request coroutine calls qio_channel_yield() successfully when sending >would block on the socket. It is now yielded. > 2. nbd_read_reply_entry() calls

Re: [Qemu-devel] [PATCH] nbd-client: avoid spurious qio_channel_yield() re-entry

2017-08-23 Thread Stefan Hajnoczi
On Tue, Aug 22, 2017 at 03:23:32PM +0200, Paolo Bonzini wrote: > On 22/08/2017 14:51, Stefan Hajnoczi wrote: > > This should fix the issue that Dave is seeing but I'm concerned that > > there are more problems in nbd-client.c. We don't have good > > abstractions for writing coroutine socket I/O

Re: [Qemu-devel] [PATCH] nbd-client: avoid spurious qio_channel_yield() re-entry

2017-08-23 Thread Eric Blake
On 08/22/2017 07:51 AM, Stefan Hajnoczi wrote: > The following scenario leads to an assertion failure in > qio_channel_yield(): > > 1. Request coroutine calls qio_channel_yield() successfully when sending >would block on the socket. It is now yielded. > 2. nbd_read_reply_entry() calls

Re: [Qemu-devel] [PATCH] nbd-client: avoid spurious qio_channel_yield() re-entry

2017-08-22 Thread Dr. David Alan Gilbert
* Stefan Hajnoczi (stefa...@redhat.com) wrote: > The following scenario leads to an assertion failure in > qio_channel_yield(): > > 1. Request coroutine calls qio_channel_yield() successfully when sending >would block on the socket. It is now yielded. > 2. nbd_read_reply_entry() calls

Re: [Qemu-devel] [PATCH] nbd-client: avoid spurious qio_channel_yield() re-entry

2017-08-22 Thread Paolo Bonzini
On 22/08/2017 14:51, Stefan Hajnoczi wrote: > This should fix the issue that Dave is seeing but I'm concerned that > there are more problems in nbd-client.c. We don't have good > abstractions for writing coroutine socket I/O code. Something like Go's > channels would avoid manual low-level

[Qemu-devel] [PATCH] nbd-client: avoid spurious qio_channel_yield() re-entry

2017-08-22 Thread Stefan Hajnoczi
The following scenario leads to an assertion failure in qio_channel_yield(): 1. Request coroutine calls qio_channel_yield() successfully when sending would block on the socket. It is now yielded. 2. nbd_read_reply_entry() calls nbd_recv_coroutines_enter_all() because nbd_receive_reply()