[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] qtest: fix infinite loop when QEMU aborts abruptly

From: Anthony Liguori
Subject: [Qemu-devel] [PATCH] qtest: fix infinite loop when QEMU aborts abruptly
Date: Wed, 27 Jun 2012 08:23:16 -0500

>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

Reported-by: Markus Armbruster <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>
 tests/libqtest.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tests/libqtest.c b/tests/libqtest.c
index 1d73fd1..071b6be 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -291,6 +291,11 @@ void qtest_qmp(QTestState *s, const char *fmt, ...)
+        if (len == -1 || len == 0) {
+            fprintf(stderr, "Broken pipe\n");
+            exit(1);
+        }
         switch (c) {
         case '{':

reply via email to

[Prev in Thread] Current Thread [Next in Thread]