Set the iothread's eventfd/pipe descriptors to non-blocking
It fixes migration issue when the destination is loaded.
If the migration socket is full, we get EAGAIN for the write.
The set_fd_handler2 defers the write for later on. The function
tries to wake up the iothread by qemu_kvm_notify_work.
Since this happens in a loop, multiple times, the pipe that emulates eventfd
becomes full and we get a deadlock.
Mark McLoughlin suggested to remove spurious wake-up of the migration code
when we get EAGAIN and wait for the socket to become writeable. (+1)
Nevertheless, the pipe descriptors shouldn't be blocking and the reader can
also read several chunks in a time.
Signed-off-by: Dor Laor <dor@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>