Browse Source

Move monitor.c to monitor/misc.c

Create a new monitor/ subdirectory and move monitor.c there. As the plan
is to move the monitor core into separate files, use the chance to
rename it to misc.c.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190613153405.24769-8-kwolf@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Kevin Wolf 6 years ago
parent
commit
e84328faa9
8 changed files with 19 additions and 15 deletions
  1. 2 2
      MAINTAINERS
  2. 1 0
      Makefile.objs
  3. 2 1
      Makefile.target
  4. 1 1
      docs/devel/writing-qmp-commands.txt
  5. 1 0
      monitor/Makefile.objs
  6. 1 1
      monitor/misc.c
  7. 11 0
      monitor/trace-events
  8. 0 10
      trace-events

+ 2 - 2
MAINTAINERS

@@ -1918,7 +1918,7 @@ F: qapi/run-state.json
 Human Monitor (HMP)
 Human Monitor (HMP)
 M: Dr. David Alan Gilbert <dgilbert@redhat.com>
 M: Dr. David Alan Gilbert <dgilbert@redhat.com>
 S: Maintained
 S: Maintained
-F: monitor.c
+F: monitor/misc.c
 F: hmp.[ch]
 F: hmp.[ch]
 F: hmp-commands*.hx
 F: hmp-commands*.hx
 F: include/monitor/hmp-target.h
 F: include/monitor/hmp-target.h
@@ -2040,7 +2040,7 @@ QMP
 M: Markus Armbruster <armbru@redhat.com>
 M: Markus Armbruster <armbru@redhat.com>
 S: Supported
 S: Supported
 F: qmp.c
 F: qmp.c
-F: monitor.c
+F: monitor/misc.c
 F: docs/devel/*qmp-*
 F: docs/devel/*qmp-*
 F: docs/interop/*qmp-*
 F: docs/interop/*qmp-*
 F: scripts/qmp/
 F: scripts/qmp/

+ 1 - 0
Makefile.objs

@@ -130,6 +130,7 @@ trace-events-subdirs =
 trace-events-subdirs += accel/kvm
 trace-events-subdirs += accel/kvm
 trace-events-subdirs += accel/tcg
 trace-events-subdirs += accel/tcg
 trace-events-subdirs += crypto
 trace-events-subdirs += crypto
+trace-events-subdirs += monitor
 ifeq ($(CONFIG_USER_ONLY),y)
 ifeq ($(CONFIG_USER_ONLY),y)
 trace-events-subdirs += linux-user
 trace-events-subdirs += linux-user
 endif
 endif

+ 2 - 1
Makefile.target

@@ -148,9 +148,10 @@ endif #CONFIG_BSD_USER
 #########################################################
 #########################################################
 # System emulator target
 # System emulator target
 ifdef CONFIG_SOFTMMU
 ifdef CONFIG_SOFTMMU
-obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o
+obj-y += arch_init.o cpus.o gdbstub.o balloon.o ioport.o numa.o
 obj-y += qtest.o
 obj-y += qtest.o
 obj-y += hw/
 obj-y += hw/
+obj-y += monitor/
 obj-y += qapi/
 obj-y += qapi/
 obj-y += memory.o
 obj-y += memory.o
 obj-y += memory_mapping.o
 obj-y += memory_mapping.o

+ 1 - 1
docs/devel/writing-qmp-commands.txt

@@ -470,7 +470,7 @@ it's good practice to always check for errors.
 
 
 Another important detail is that HMP's "info" commands don't go into the
 Another important detail is that HMP's "info" commands don't go into the
 hmp-commands.hx. Instead, they go into the info_cmds[] table, which is defined
 hmp-commands.hx. Instead, they go into the info_cmds[] table, which is defined
-in the monitor.c file. The entry for the "info alarmclock" follows:
+in the monitor/misc.c file. The entry for the "info alarmclock" follows:
 
 
     {
     {
         .name       = "alarmclock",
         .name       = "alarmclock",

+ 1 - 0
monitor/Makefile.objs

@@ -0,0 +1 @@
+obj-y += misc.o

+ 1 - 1
monitor.c → monitor/misc.c

@@ -64,7 +64,7 @@
 #include "qapi/qmp/json-parser.h"
 #include "qapi/qmp/json-parser.h"
 #include "qapi/qmp/qlist.h"
 #include "qapi/qmp/qlist.h"
 #include "qom/object_interfaces.h"
 #include "qom/object_interfaces.h"
-#include "trace-root.h"
+#include "trace.h"
 #include "trace/control.h"
 #include "trace/control.h"
 #include "monitor/hmp-target.h"
 #include "monitor/hmp-target.h"
 #ifdef CONFIG_TRACE_SIMPLE
 #ifdef CONFIG_TRACE_SIMPLE

+ 11 - 0
monitor/trace-events

@@ -0,0 +1,11 @@
+# See docs/devel/tracing.txt for syntax documentation.
+
+# misc.c
+monitor_protocol_event_handler(uint32_t event, void *qdict) "event=%d data=%p"
+monitor_protocol_event_emit(uint32_t event, void *data) "event=%d data=%p"
+monitor_protocol_event_queue(uint32_t event, void *qdict, uint64_t rate) "event=%d data=%p rate=%" PRId64
+handle_hmp_command(void *mon, const char *cmdline) "mon %p cmdline: %s"
+handle_qmp_command(void *mon, const char *req) "mon %p req: %s"
+monitor_suspend(void *ptr, int cnt) "mon %p: %d"
+monitor_qmp_cmd_in_band(const char *id) "%s"
+monitor_qmp_cmd_out_of_band(const char *id) "%s"

+ 0 - 10
trace-events

@@ -41,16 +41,6 @@ system_wakeup_request(int reason) "reason=%d"
 qemu_system_shutdown_request(int reason) "reason=%d"
 qemu_system_shutdown_request(int reason) "reason=%d"
 qemu_system_powerdown_request(void) ""
 qemu_system_powerdown_request(void) ""
 
 
-# monitor.c
-monitor_protocol_event_handler(uint32_t event, void *qdict) "event=%d data=%p"
-monitor_protocol_event_emit(uint32_t event, void *data) "event=%d data=%p"
-monitor_protocol_event_queue(uint32_t event, void *qdict, uint64_t rate) "event=%d data=%p rate=%" PRId64
-handle_hmp_command(void *mon, const char *cmdline) "mon %p cmdline: %s"
-handle_qmp_command(void *mon, const char *req) "mon %p req: %s"
-monitor_suspend(void *ptr, int cnt) "mon %p: %d"
-monitor_qmp_cmd_in_band(const char *id) "%s"
-monitor_qmp_cmd_out_of_band(const char *id) "%s"
-
 # dma-helpers.c
 # dma-helpers.c
 dma_blk_io(void *dbs, void *bs, int64_t offset, bool to_dev) "dbs=%p bs=%p offset=%" PRId64 " to_dev=%d"
 dma_blk_io(void *dbs, void *bs, int64_t offset, bool to_dev) "dbs=%p bs=%p offset=%" PRId64 " to_dev=%d"
 dma_aio_cancel(void *dbs) "dbs=%p"
 dma_aio_cancel(void *dbs) "dbs=%p"