From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxGfE-0001UT-NT for qemu-devel@nongnu.org; Tue, 26 May 2015 11:21:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxGf9-0006mP-QN for qemu-devel@nongnu.org; Tue, 26 May 2015 11:21:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxGf9-0006lj-Lq for qemu-devel@nongnu.org; Tue, 26 May 2015 11:21:03 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 60997C1F03 for ; Tue, 26 May 2015 15:21:03 +0000 (UTC) From: Markus Armbruster Date: Tue, 26 May 2015 17:20:55 +0200 Message-Id: <1432653655-30745-21-git-send-email-armbru@redhat.com> In-Reply-To: <1432653655-30745-1-git-send-email-armbru@redhat.com> References: <1432653655-30745-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH v2 20/20] monitor: Change return type of monitor_cur_is_qmp() to bool List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: lcapitulino@redhat.com Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- include/monitor/monitor.h | 2 +- monitor.c | 6 ++++-- stubs/mon-is-qmp.c | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index d409b6a..57f8394 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -16,7 +16,7 @@ extern Monitor *default_mon; #define MONITOR_USE_CONTROL 0x04 #define MONITOR_USE_PRETTY 0x08 -int monitor_cur_is_qmp(void); +bool monitor_cur_is_qmp(void); void monitor_init(CharDriverState *chr, int flags); diff --git a/monitor.c b/monitor.c index 909f378..94a6026 100644 --- a/monitor.c +++ b/monitor.c @@ -239,8 +239,10 @@ static inline bool monitor_is_qmp(const Monitor *mon) return (mon->flags & MONITOR_USE_CONTROL); } -/* Return non-zero iff we have a current monitor, and it is in QMP mode. */ -int monitor_cur_is_qmp(void) +/** + * Is the current monitor, if any, a QMP monitor? + */ +bool monitor_cur_is_qmp(void) { return cur_mon && monitor_is_qmp(cur_mon); } diff --git a/stubs/mon-is-qmp.c b/stubs/mon-is-qmp.c index 1f0a8fd..1ef136a 100644 --- a/stubs/mon-is-qmp.c +++ b/stubs/mon-is-qmp.c @@ -1,7 +1,7 @@ #include "qemu-common.h" #include "monitor/monitor.h" -int monitor_cur_is_qmp(void) +bool monitor_cur_is_qmp(void) { - return 0; + return false; } -- 1.9.3