diff mbox series

[v2,3/3] monitor: Remove monitor_register_hmp()

Message ID 20240611102305.60735-4-philmd@linaro.org
State New
Headers show
Series hw/usb: Introduce x-query-usbhost QMP command | expand

Commit Message

Philippe Mathieu-Daudé June 11, 2024, 10:23 a.m. UTC
Previous commit removed the last use of monitor_register_hmp(),
remove it so new commands are implemented using
monitor_register_hmp_info_hrt().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/monitor/monitor.h |  2 --
 monitor/hmp-target.c      | 16 ----------------
 2 files changed, 18 deletions(-)

Comments

Daniel P. Berrangé June 11, 2024, 12:30 p.m. UTC | #1
On Tue, Jun 11, 2024 at 12:23:05PM +0200, Philippe Mathieu-Daudé wrote:
> Previous commit removed the last use of monitor_register_hmp(),
> remove it so new commands are implemented using
> monitor_register_hmp_info_hrt().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  include/monitor/monitor.h |  2 --
>  monitor/hmp-target.c      | 16 ----------------
>  2 files changed, 18 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
diff mbox series

Patch

diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index 965f5d5450..2199a74913 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -55,8 +55,6 @@  int monitor_fdset_dup_fd_add(int64_t fdset_id, int flags);
 void monitor_fdset_dup_fd_remove(int dup_fd);
 int64_t monitor_fdset_dup_fd_find(int dup_fd);
 
-void monitor_register_hmp(const char *name, bool info,
-                          void (*cmd)(Monitor *mon, const QDict *qdict));
 void monitor_register_hmp_info_hrt(const char *name,
                                    HumanReadableText *(*handler)(Error **errp));
 
diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c
index 1eb72ac1bf..86f48c613b 100644
--- a/monitor/hmp-target.c
+++ b/monitor/hmp-target.c
@@ -145,22 +145,6 @@  static void __attribute__((__constructor__)) sortcmdlist(void)
           compare_mon_cmd);
 }
 
-void monitor_register_hmp(const char *name, bool info,
-                          void (*cmd)(Monitor *mon, const QDict *qdict))
-{
-    HMPCommand *table = info ? hmp_info_cmds : hmp_cmds;
-
-    while (table->name != NULL) {
-        if (strcmp(table->name, name) == 0) {
-            g_assert(table->cmd == NULL && table->cmd_info_hrt == NULL);
-            table->cmd = cmd;
-            return;
-        }
-        table++;
-    }
-    g_assert_not_reached();
-}
-
 void monitor_register_hmp_info_hrt(const char *name,
                                    HumanReadableText *(*handler)(Error **errp))
 {