autotest/virt-test — pull request #804 by ldoktor (2013-08-29 11:28:00+00:00)
Title: shared.scripts.virtio_console_guest: Fix problem with async mode

Hi guys,

finally I took a second look on sigio test and (hopefully) found the problem. The sigio test uses async mode and from time to time when we set the port to async mode, the guest worker finished without any (sane) output. The problem was, that signals are handled with the background daemon, which was killed by unhandled SIGIO signal, thus no output was passed to the executed guest_worker.

The previous workflow:
1) port set to async
2) set custom SIGIO handler

Sometimes between 1 and 2 signal arrived
1) port set to async
2) signal arrived and was handled by SIG_DFL => background daemon was shoot to death (into the head)

New workflow:
1) set custom SIGIO handler
2) set port to async
3) enjoy the life with bullet-proof SIGIO handler

Kind regards,
Lukáš

**NOTE: You have to remove the previous /tmp/virtio_console_guest.py* in order to let virtio_console test to copy this updated one!**
NOTE2: The test passes in +- 30%, because the closed and unused port returns "IN HUP". (which is a virtio_console bug).