From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAkJm-0000IB-Q1 for qemu-devel@nongnu.org; Tue, 04 Feb 2014 13:01:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAkJh-00046w-Rb for qemu-devel@nongnu.org; Tue, 04 Feb 2014 13:01:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:4770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAkJh-00046m-Hk for qemu-devel@nongnu.org; Tue, 04 Feb 2014 13:01:49 -0500 Date: Tue, 4 Feb 2014 20:06:47 +0200 From: "Michael S. Tsirkin" Message-ID: <1391537199-13403-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] qtest: don't report signals if qtest driver enabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?us-ascii?B?PT9VVEYtOD9xP0FuZHJlYXM9MjBGPUMzPUE0cmJlcj89?= , Anthony Liguori 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=E4rber Signed-off-by: Michael S. Tsirkin --- include/sysemu/qtest.h | 2 ++ qtest.c | 5 +++++ vl.c | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/sysemu/qtest.h b/include/sysemu/qtest.h index 112a661..6aca8e4 100644 --- a/include/sysemu/qtest.h +++ b/include/sysemu/qtest.h @@ -23,6 +23,8 @@ static inline bool qtest_enabled(void) return qtest_allowed; } =20 +bool qtest_driver(void); + int qtest_init_accel(void); void qtest_init(const char *qtest_chrdev, const char *qtest_log); =20 diff --git a/qtest.c b/qtest.c index dcf1301..a738afc 100644 --- a/qtest.c +++ b/qtest.c @@ -528,3 +528,8 @@ void qtest_init(const char *qtest_chrdev, const char = *qtest_log) =20 qtest_chr =3D chr; } + +bool qtest_driver(void) +{ + return qtest_chr; +} diff --git a/vl.c b/vl.c index 60dbbcb..dddbbce 100644 --- a/vl.c +++ b/vl.c @@ -1748,7 +1748,7 @@ static int qemu_shutdown_requested(void) =20 static void qemu_kill_report(void) { - if (!qtest_enabled() && shutdown_signal !=3D -1) { + if (!qtest_driver() && shutdown_signal !=3D -1) { fprintf(stderr, "qemu: terminating on signal %d", shutdown_signa= l); if (shutdown_pid =3D=3D 0) { /* This happens for eg ^C at the terminal, so it's worth --=20 MST