[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/16] monitor: Move {hmp, qmp}.c to monitor/{hmp, qm
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL 09/16] monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c |
Date: |
Mon, 17 Jun 2019 20:48:56 +0200 |
From: Kevin Wolf <address@hidden>
Now that we have a monitor/ subdirectory, let's move hmp.c and qmp.c
from the root directory there. As they contain implementations of
monitor commands, rename them to {hmp,qmp}-cmds.c, so that {hmp,qmp}.c
are free for the HMP and QMP infrastructure.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
---
MAINTAINERS | 5 +++--
Makefile.objs | 2 +-
docs/devel/writing-qmp-commands.txt | 9 +++++----
monitor/Makefile.objs | 1 +
hmp.c => monitor/hmp-cmds.c | 2 +-
qmp.c => monitor/qmp-cmds.c | 2 +-
6 files changed, 12 insertions(+), 9 deletions(-)
rename hmp.c => monitor/hmp-cmds.c (99%)
rename qmp.c => monitor/qmp-cmds.c (99%)
diff --git a/MAINTAINERS b/MAINTAINERS
index 575ea6e68d..3c7d366727 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1919,7 +1919,8 @@ Human Monitor (HMP)
M: Dr. David Alan Gilbert <address@hidden>
S: Maintained
F: monitor/misc.c
-F: hmp.[ch]
+F: monitor/hmp*
+F: hmp.h
F: hmp-commands*.hx
F: include/monitor/hmp-target.h
F: tests/test-hmp.c
@@ -2039,7 +2040,7 @@ F: tests/check-qom-proplist.c
QMP
M: Markus Armbruster <address@hidden>
S: Supported
-F: qmp.c
+F: monitor/qmp*
F: monitor/misc.c
F: docs/devel/*qmp-*
F: docs/interop/*qmp-*
diff --git a/Makefile.objs b/Makefile.objs
index dd39a70b48..9495fcbc7e 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -83,8 +83,8 @@ common-obj-$(CONFIG_FDT) += device_tree.o
######################################################################
# qapi
-common-obj-y += qmp.o hmp.o
common-obj-y += qapi/
+common-obj-y += monitor/
endif
#######################################################################
diff --git a/docs/devel/writing-qmp-commands.txt
b/docs/devel/writing-qmp-commands.txt
index cc6ecd6d5d..46a6c48683 100644
--- a/docs/devel/writing-qmp-commands.txt
+++ b/docs/devel/writing-qmp-commands.txt
@@ -20,7 +20,7 @@ new QMP command.
2. Write the QMP command itself, which is a regular C function. Preferably,
the command should be exported by some QEMU subsystem. But it can also be
- added to the qmp.c file
+ added to the monitor/qmp-cmds.c file
3. At this point the command can be tested under the QMP protocol
@@ -101,7 +101,8 @@ protocol data.
The next step is to write the "hello-world" implementation. As explained
earlier, it's preferable for commands to live in QEMU subsystems. But
-"hello-world" doesn't pertain to any, so we put its implementation in qmp.c:
+"hello-world" doesn't pertain to any, so we put its implementation in
+monitor/qmp-cmds.c:
void qmp_hello_world(Error **errp)
{
@@ -146,7 +147,7 @@ for mandatory arguments). Finally, 'str' is the argument's
type, which
stands for "string". The QAPI also supports integers, booleans, enumerations
and user defined types.
-Now, let's update our C implementation in qmp.c:
+Now, let's update our C implementation in monitor/qmp-cmds.c:
void qmp_hello_world(bool has_message, const char *message, Error **errp)
{
@@ -267,7 +268,7 @@ monitor (HMP).
With the introduction of the QAPI, HMP commands make QMP calls. Most of the
time HMP commands are simple wrappers. All HMP commands implementation exist in
-the hmp.c file.
+the monitor/hmp-cmds.c file.
Here's the implementation of the "hello-world" HMP command:
diff --git a/monitor/Makefile.objs b/monitor/Makefile.objs
index e783b0616b..a7170af6e1 100644
--- a/monitor/Makefile.objs
+++ b/monitor/Makefile.objs
@@ -1 +1,2 @@
obj-y += misc.o
+common-obj-y += qmp-cmds.o hmp-cmds.o
diff --git a/hmp.c b/monitor/hmp-cmds.c
similarity index 99%
rename from hmp.c
rename to monitor/hmp-cmds.c
index e6ea7cb9c2..c917e24d9c 100644
--- a/hmp.c
+++ b/monitor/hmp-cmds.c
@@ -1,5 +1,5 @@
/*
- * Human Monitor Interface
+ * Human Monitor Interface commands
*
* Copyright IBM, Corp. 2011
*
diff --git a/qmp.c b/monitor/qmp-cmds.c
similarity index 99%
rename from qmp.c
rename to monitor/qmp-cmds.c
index 6797568444..f1b1e4f08b 100644
--- a/qmp.c
+++ b/monitor/qmp-cmds.c
@@ -1,5 +1,5 @@
/*
- * QEMU Management Protocol
+ * QEMU Management Protocol commands
*
* Copyright IBM, Corp. 2011
*
--
2.21.0
- [Qemu-devel] [PULL 00/16] Monitor patches for 2019-06-17, Markus Armbruster, 2019/06/17
- [Qemu-devel] [PULL 03/16] monitor: Split monitor_init in HMP and QMP function, Markus Armbruster, 2019/06/17
- [Qemu-devel] [PULL 01/16] monitor: Fix return type of monitor_fdset_dup_fd_find, Markus Armbruster, 2019/06/17
- [Qemu-devel] [PULL 04/16] monitor: Make MonitorQMP a child class of Monitor, Markus Armbruster, 2019/06/17
- [Qemu-devel] [PULL 09/16] monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c,
Markus Armbruster <=
- [Qemu-devel] [PULL 08/16] Move monitor.c to monitor/misc.c, Markus Armbruster, 2019/06/17
- [Qemu-devel] [PULL 14/16] monitor: Split Monitor.flags into separate bools, Markus Armbruster, 2019/06/17
- [Qemu-devel] [PULL 06/16] monitor: Remove Monitor.cmd_table indirection, Markus Armbruster, 2019/06/17
- [Qemu-devel] [PULL 02/16] monitor: Remove unused password prompting fields, Markus Armbruster, 2019/06/17
- [Qemu-devel] [PULL 11/16] monitor: Split out monitor/qmp.c, Markus Armbruster, 2019/06/17
- [Qemu-devel] [PULL 15/16] monitor: Replace monitor_init() with monitor_init_{hmp, qmp}(), Markus Armbruster, 2019/06/17
- [Qemu-devel] [PULL 05/16] monitor: Create MonitorHMP with readline state, Markus Armbruster, 2019/06/17
- [Qemu-devel] [PULL 16/16] vl: Deprecate -mon pretty=... for HMP monitors, Markus Armbruster, 2019/06/17