From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdynB-000192-2H for qemu-devel@nongnu.org; Mon, 21 Sep 2015 06:57:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zdyn8-0006rn-LE for qemu-devel@nongnu.org; Mon, 21 Sep 2015 06:57:52 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:3834 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zdyn8-0006r2-8a for qemu-devel@nongnu.org; Mon, 21 Sep 2015 06:57:50 -0400 From: "Denis V. Lunev" Date: Mon, 21 Sep 2015 13:57:33 +0300 Message-Id: <1442833057-8186-6-git-send-email-den@openvz.org> In-Reply-To: <1442833057-8186-1-git-send-email-den@openvz.org> References: <1442833057-8186-1-git-send-email-den@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 5/9] monitor: make monitor_fprintf and mon_get_cpu externally visible List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Denis V. Lunev" , Paolo Bonzini , qemu-devel@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Pavel Butsykin From: Pavel Butsykin monitor_fprintf and mon_get_cpu will be used in the target-specific monit= or, so it is advisable to make it external. Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Andreas F=C3=A4rber --- disas.c | 10 ---------- include/monitor/hmp-target.h | 1 + include/monitor/monitor.h | 1 + monitor.c | 5 ++--- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/disas.c b/disas.c index 0ae70c2..45878fa 100644 --- a/disas.c +++ b/disas.c @@ -392,16 +392,6 @@ monitor_read_memory (bfd_vma memaddr, bfd_byte *myad= dr, int length, return 0; } =20 -static int GCC_FMT_ATTR(2, 3) -monitor_fprintf(FILE *stream, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - monitor_vprintf((Monitor *)stream, fmt, ap); - va_end(ap); - return 0; -} - /* Disassembler for the monitor. See target_disas for a description of flags. */ void monitor_disas(Monitor *mon, CPUState *cpu, diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index 611541d..c64f523 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -37,6 +37,7 @@ struct MonitorDef { const MonitorDef *target_monitor_defs(void); =20 CPUArchState *mon_get_cpu_env(void); +CPUState *mon_get_cpu(void); =20 void hmp_info_mem(Monitor *mon, const QDict *qdict); void hmp_info_tlb(Monitor *mon, const QDict *qdict); diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 9aff47e..f95a384 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -34,6 +34,7 @@ int monitor_fd_param(Monitor *mon, const char *fdname, = Error **errp); void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); void monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, = 3); +int monitor_fprintf(FILE *stream, const char *fmt, ...) GCC_FMT_ATTR(2, = 3); void monitor_flush(Monitor *mon); int monitor_set_cpu(int cpu_index); int monitor_get_cpu_index(void); diff --git a/monitor.c b/monitor.c index 1f43263..d303579 100644 --- a/monitor.c +++ b/monitor.c @@ -371,8 +371,7 @@ void monitor_printf(Monitor *mon, const char *fmt, ..= .) va_end(ap); } =20 -static int GCC_FMT_ATTR(2, 3) monitor_fprintf(FILE *stream, - const char *fmt, ...) +int monitor_fprintf(FILE *stream, const char *fmt, ...) { va_list ap; va_start(ap, fmt); @@ -941,7 +940,7 @@ int monitor_set_cpu(int cpu_index) return 0; } =20 -static CPUState *mon_get_cpu(void) +CPUState *mon_get_cpu(void) { if (!cur_mon->mon_cpu) { monitor_set_cpu(0); --=20 2.1.4