[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 07/26] monitor: Extract monitor_fprintf to monito
From: |
Benoît Canet |
Subject: |
[Qemu-devel] [PATCH v2 07/26] monitor: Extract monitor_fprintf to monitor-system.c |
Date: |
Fri, 15 Aug 2014 15:35:39 +0200 |
Signed-off-by: Benoît Canet <address@hidden>
---
Makefile.target | 1 +
disas.c | 10 ++++++
include/monitor/monitor-system.h | 3 ++
include/monitor/monitor.h | 2 --
monitor-system.c | 69 ++++++++++++++++++++++++++++++++++++++++
monitor.c | 10 ------
6 files changed, 83 insertions(+), 12 deletions(-)
create mode 100644 monitor-system.c
diff --git a/Makefile.target b/Makefile.target
index 137d0b0..684a82f 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -120,6 +120,7 @@ endif #CONFIG_BSD_USER
# System emulator target
ifdef CONFIG_SOFTMMU
obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o
+obj-y += monitor-system.o
obj-y += qtest.o
obj-y += hw/
obj-$(CONFIG_FDT) += device_tree.o
diff --git a/disas.c b/disas.c
index b174f26..44a019a 100644
--- a/disas.c
+++ b/disas.c
@@ -435,6 +435,16 @@ monitor_read_memory (bfd_vma memaddr, bfd_byte *myaddr,
int length,
return 0;
}
+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, CPUArchState *env,
diff --git a/include/monitor/monitor-system.h b/include/monitor/monitor-system.h
index e7b99ce..5a83379 100644
--- a/include/monitor/monitor-system.h
+++ b/include/monitor/monitor-system.h
@@ -96,4 +96,7 @@ typedef struct MonitorCommand {
int get_expr(Monitor *mon, int64_t *pval, const char **pp);
int get_double(Monitor *mon, double *pval, const char **pp);
+int GCC_FMT_ATTR(2, 3) monitor_fprintf(FILE *stream,
+ const char *fmt, ...);
+
#endif
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index 0155390..bd9a1f2 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -77,6 +77,4 @@ void add_completion_option(ReadLineState *rs, const char *str,
void monitor_user_noop(Monitor *mon, const QObject *data);
int do_qmp_capabilities(Monitor *mon, const QDict *params, QObject **ret_data);
-int GCC_FMT_ATTR(2, 3) monitor_fprintf(FILE *stream, const char *fmt, ...);
-
#endif /* !MONITOR_H */
diff --git a/monitor-system.c b/monitor-system.c
new file mode 100644
index 0000000..51ca21f
--- /dev/null
+++ b/monitor-system.c
@@ -0,0 +1,69 @@
+/*
+ * QEMU monitor
+ *
+ * Copyright (c) 2003-2004 Fabrice Bellard
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/* Monitor system related parts */
+
+#include "net/net.h"
+#include "exec/address-spaces.h"
+#include "exec/gdbstub.h"
+#include "hw/usb.h"
+#include "hw/pcmcia.h"
+#include "hw/i386/pc.h"
+#include "monitor/monitor-system.h"
+#include "qemu/acl.h"
+#include "qmp-commands.h"
+#include "sysemu/watchdog.h"
+#include "trace/control.h"
+#ifdef CONFIG_TRACE_SIMPLE
+#include "trace/simple.h"
+#endif
+#include "ui/console.h"
+#include "ui/qemu-spice.h"
+#include "ui/input.h"
+#include "monitor/qdev.h"
+#include "audio/audio.h"
+#include "hmp.h"
+#include "hw/loader.h"
+#include "net/slirp.h"
+#include "sysemu/blockdev.h"
+#include "qemu/config-file.h"
+
+/* for pic/irq_info */
+#if defined(TARGET_SPARC)
+#include "hw/sparc/sun4m.h"
+#endif
+#include "hw/lm32/lm32_pic.h"
+
+extern const char *monitor_event_names[];
+
+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;
+}
+
diff --git a/monitor.c b/monitor.c
index 5e73536..24f4a53 100644
--- a/monitor.c
+++ b/monitor.c
@@ -328,16 +328,6 @@ void monitor_printf(Monitor *mon, const char *fmt, ...)
va_end(ap);
}
-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;
-}
-
void monitor_user_noop(Monitor *mon, const QObject *data) { }
static inline int handler_is_qobject(const MonitorCommand *cmd)
--
2.1.0.rc1
- [Qemu-devel] [PATCH v2 00/26] Extract qmp.c and monitor.c core and wire QMP into qemu-nbd, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 03/26] monitor: Convert Monitor reset_seen field too boolean, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 04/26] monitor: Convert mon_cmd_t to MonitorCommand, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 06/26] monitor: Make monitor_fprintf public before extracting it, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 01/26] qmp: Extract system emulation related code from qmp.c into qmp-system.c, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 11/26] monitor: Make do_info_help public, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 07/26] monitor: Extract monitor_fprintf to monitor-system.c,
Benoît Canet <=
- [Qemu-devel] [PATCH v2 12/26] monitor: Extract do_info_help in monitor-system.c, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 02/26] monitor: Make some function public, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 08/26] monitor: Extract qmp_human_monitor_command into monitor-system.c, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 24/26] qemu-nbd: build QAPI block core into qemu-nbd, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 05/26] monitor: Extract monitor-system.h header, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 20/26] monitor: Move qmp_rtc_reset_reinjection from monitor.c to monitor-system.c, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 10/26] monitor: Extract a couple of function to monitor-system.c, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 22/26] monitor: Extract hardware dependent completion function from monitor.c to monitor-system.c, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 09/26] monitor: Make some function to extract public, Benoît Canet, 2014/08/15
- [Qemu-devel] [PATCH v2 19/26] monitor: Move two net functions from monitor.c to monitor-system.c, Benoît Canet, 2014/08/15