Set the iothread's eventfd/pipe descriptors to non-blocking
commit6963fe4014a6233d804ab1236fd0307e61015fc1
authorDor Laor <dlaor@redhat.com>
Thu, 16 Jul 2009 22:18:58 +0000 (17 01:18 +0300)
committerMarcelo Tosatti <mtosatti@redhat.com>
Sun, 19 Jul 2009 00:15:15 +0000 (18 21:15 -0300)
treef468d3f90c3fb6f843ed848d231c3a746936917d
parent91a5fec39e9dcf99b85c6df689933d02f713dd7b
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>
qemu-kvm.c