]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qtest: don't report signals if qtest driver enabled
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 4 Feb 2014 18:04:21 +0000 (20:04 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 5 Feb 2014 14:55:50 +0000 (16:55 +0200)
qtest driver always uses signals to kill qemu
no need to report it, whatever the accelerator state.

Add API to detect qtest driver, and suppress reporting
signals in this case.

Reported-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
include/sysemu/qtest.h
qtest.c
vl.c

index 112a661ac4b0d215fdb4a1eaace2433c8835f99a..6aca8e4c1fc71b12a66fa71286f55a097b9e9870 100644 (file)
@@ -23,6 +23,8 @@ static inline bool qtest_enabled(void)
     return qtest_allowed;
 }
 
+bool qtest_driver(void);
+
 int qtest_init_accel(void);
 void qtest_init(const char *qtest_chrdev, const char *qtest_log);
 
diff --git a/qtest.c b/qtest.c
index dcf130122961dcb4c3e82e7138112e663e503f3a..a738afc724a3d89f49998e4f178557b77c50354e 100644 (file)
--- a/qtest.c
+++ b/qtest.c
@@ -528,3 +528,8 @@ void qtest_init(const char *qtest_chrdev, const char *qtest_log)
 
     qtest_chr = chr;
 }
+
+bool qtest_driver(void)
+{
+    return qtest_chr;
+}
diff --git a/vl.c b/vl.c
index 383be1b617c8c53122a7208d67b596b124bc12d0..a7b00cdd3755653a67a41b12be19e798865244d2 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -1750,7 +1750,7 @@ static int qemu_shutdown_requested(void)
 
 static void qemu_kill_report(void)
 {
-    if (!qtest_enabled() && shutdown_signal != -1) {
+    if (!qtest_driver() && shutdown_signal != -1) {
         fprintf(stderr, "qemu: terminating on signal %d", shutdown_signal);
         if (shutdown_pid == 0) {
             /* This happens for eg ^C at the terminal, so it's worth