diff mbox series

[07/32] hmp: Rename help_cmd() to hmp_help_cmd(), move declaration to hmp.h

Message ID 20230124121946.1139465-8-armbru@redhat.com (mailing list archive)
State New, archived
Headers show
Series Move and clean up monitor command code | expand

Commit Message

Markus Armbruster Jan. 24, 2023, 12:19 p.m. UTC
The next commit will move a caller of help_cmd() to a new file.
Including monitor/monitor-internal.h there just for help_cmd() feels
silly.  Better to provide it in monitor/hmp.h suitably renamed.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/monitor/hmp.h      | 1 +
 monitor/monitor-internal.h | 1 -
 monitor/hmp.c              | 2 +-
 monitor/misc.c             | 8 ++++----
 4 files changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
index c25bec1863..5a75f4659c 100644
--- a/include/monitor/hmp.h
+++ b/include/monitor/hmp.h
@@ -18,6 +18,7 @@ 
 #include "qapi/qapi-types-common.h"
 
 bool hmp_handle_error(Monitor *mon, Error *err);
+void hmp_help_cmd(Monitor *mon, const char *name);
 
 void hmp_info_name(Monitor *mon, const QDict *qdict);
 void hmp_info_version(Monitor *mon, const QDict *qdict);
diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h
index a2cdbbf646..53e3808054 100644
--- a/monitor/monitor-internal.h
+++ b/monitor/monitor-internal.h
@@ -186,7 +186,6 @@  void monitor_data_destroy_qmp(MonitorQMP *mon);
 void coroutine_fn monitor_qmp_dispatcher_co(void *data);
 
 int get_monitor_def(Monitor *mon, int64_t *pval, const char *name);
-void help_cmd(Monitor *mon, const char *name);
 void handle_hmp_command(MonitorHMP *mon, const char *cmdline);
 int hmp_compare_cmd(const char *name, const char *list);
 
diff --git a/monitor/hmp.c b/monitor/hmp.c
index 893e100581..844cf54c18 100644
--- a/monitor/hmp.c
+++ b/monitor/hmp.c
@@ -271,7 +271,7 @@  static void help_cmd_dump(Monitor *mon, const HMPCommand *cmds,
     }
 }
 
-void help_cmd(Monitor *mon, const char *name)
+void hmp_help_cmd(Monitor *mon, const char *name)
 {
     char *args[MAX_ARGS];
     int nb_args = 0;
diff --git a/monitor/misc.c b/monitor/misc.c
index 9da52939b2..240d137327 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -153,7 +153,7 @@  int hmp_compare_cmd(const char *name, const char *list)
 
 static void do_help_cmd(Monitor *mon, const QDict *qdict)
 {
-    help_cmd(mon, qdict_get_try_str(qdict, "name"));
+    hmp_help_cmd(mon, qdict_get_try_str(qdict, "name"));
 }
 
 static void hmp_trace_event(Monitor *mon, const QDict *qdict)
@@ -195,14 +195,14 @@  static void hmp_trace_file(Monitor *mon, const QDict *qdict)
         }
     } else {
         monitor_printf(mon, "unexpected argument \"%s\"\n", op);
-        help_cmd(mon, "trace-file");
+        hmp_help_cmd(mon, "trace-file");
     }
 }
 #endif
 
 static void hmp_info_help(Monitor *mon, const QDict *qdict)
 {
-    help_cmd(mon, "info");
+    hmp_help_cmd(mon, "info");
 }
 
 static void monitor_init_qmp_commands(void)
@@ -424,7 +424,7 @@  static void hmp_log(Monitor *mon, const QDict *qdict)
     } else {
         mask = qemu_str_to_log_mask(items);
         if (!mask) {
-            help_cmd(mon, "log");
+            hmp_help_cmd(mon, "log");
             return;
         }
     }