]> git.ipfire.org Git - thirdparty/qemu.git/commit
qtest: fix infinite loop when QEMU aborts abruptly
authorAnthony Liguori <aliguori@us.ibm.com>
Wed, 27 Jun 2012 13:20:43 +0000 (08:20 -0500)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 21 Aug 2012 20:36:34 +0000 (15:36 -0500)
commitf408f49165111b95a7186e2b1e01ee577c643855
treec8545c312c86235d887a91b9bccf7bf3b0b83d10
parent785adb09b9fd0d4df6707f00247ec519c42fcfc6
qtest: fix infinite loop when QEMU aborts abruptly

From Markus:

Makes "make check" hang:

    QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 gtester -k --verbose -m=quick tests/crash-test tests/rtc-test
    TEST: tests/crash-test... (pid=972)
    qemu-system-x86_64: Device needs media, but drive is empty
[Nothing happens, wait a while, then hit ^C]
    make: *** [check-qtest-x86_64] Interrupt

This was due to the fact that we weren't checked for errors when
reading from the QMP socket.  This patch adds appropriate error
checking.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 039380a8e18f618cdacf72486449c04dc1b70eef)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
tests/libqtest.c