Received: from eggs.gnu.org ([2001:4830:134:3::10]:50566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCtww-0005Lo-Dd for qemu-devel@nongnu.org; Mon, 10 Feb 2014 11:43:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCtwr-0005Cj-Gg for qemu-devel@nongnu.org; Mon, 10 Feb 2014 11:43:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCtwr-0005Ce-7O for qemu-devel@nongnu.org; Mon, 10 Feb 2014 11:43:09 -0500 Date: Mon, 10 Feb 2014 18:48:03 +0200 From: "Michael S. Tsirkin" Message-ID: <1392050814-31814-8-git-send-email-mst@redhat.com> References: <1392050814-31814-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1392050814-31814-1-git-send-email-mst@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 07/20] 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: Peter Maydell , =?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 383be1b..a7b00cd 100644 --- a/vl.c +++ b/vl.c @@ -1750,7 +1750,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