On 6/20/19 6:50 AM, Eric Blake wrote:
Mention things to remember for avoiding the deadlock of polling for a POLLIN from a server that has no replies to send.
Perhaps we could split the READY state into two - one for when there are no commands in flight (and get_direction returns 0 to state that polling is pointless, although a multi-threaded reader can still poll for POLLIN), and the other when there ARE commands in flight. Such a separation would also make it easier to know when nbd_aio_disconnect is not going to strand an in-flight command's response. But I'm not sure it is worth the effort. ---
I'm pushing this one now, but sending the email because of the question it raises on whether we want the user to be able to distinguish a difference between any vs. no in-flight commands.
Actually, I'm not pushing it yet. I noticed that we can also return 0 (such as on a just-created handle), and need to document that as well. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org