libqtest: Fix possible deadlock in qtest initialization
commitf8762027a33e2f5d0915c56a904962b1481f75c1
authorMarcel Apfelbaum <marcel.a@redhat.com>
Tue, 11 Mar 2014 13:00:34 +0000 (11 15:00 +0200)
committerAndreas Färber <afaerber@suse.de>
Thu, 13 Mar 2014 00:21:57 +0000 (13 01:21 +0100)
tree49b46d06869f74798a305c8a71f4444667edcc16
parentd2f69df746f06d785ffbf6cc9711f7df9d014e35
libqtest: Fix possible deadlock in qtest initialization

'socket_accept' waits for QEMU to init its unix socket.
If QEMU encounters an error during command line parsing,
it can exit before initializing the communication channel.

Using a timeout for sockets fixes the issue.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
tests/libqtest.c