diff --git a/MAINTAINERS b/MAINTAINERS index afa178c5cc..ac47299fd8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3403,6 +3403,8 @@ F: monitor/monitor.c F: monitor/hmp* F: hmp.h F: hmp-commands*.hx +F: include/monitor/hmp.h +F: include/monitor/hmp-completion.h F: include/monitor/hmp-target.h F: tests/qtest/test-hmp.c F: include/qemu/qemu-print.h diff --git a/chardev/char-hmp-cmds.c b/chardev/char-hmp-cmds.c index 8e9e1c1c02..f377e00b69 100644 --- a/chardev/char-hmp-cmds.c +++ b/chardev/char-hmp-cmds.c @@ -16,6 +16,7 @@ #include "qemu/osdep.h" #include "chardev/char.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "qapi/error.h" #include "qapi/qapi-commands-char.h" diff --git a/include/monitor/hmp-completion.h b/include/monitor/hmp-completion.h new file mode 100644 index 0000000000..dab21867dc --- /dev/null +++ b/include/monitor/hmp-completion.h @@ -0,0 +1,40 @@ +/* + * Human Monitor Completion handlers + * + * Copyright IBM, Corp. 2011 + * + * Authors: + * Anthony Liguori + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef HMP_COMPLETION_H +#define HMP_COMPLETION_H + +#include "qemu/readline.h" + +void object_add_completion(ReadLineState *rs, int nb_args, const char *str); +void object_del_completion(ReadLineState *rs, int nb_args, const char *str); +void device_add_completion(ReadLineState *rs, int nb_args, const char *str); +void device_del_completion(ReadLineState *rs, int nb_args, const char *str); +void sendkey_completion(ReadLineState *rs, int nb_args, const char *str); +void chardev_remove_completion(ReadLineState *rs, int nb_args, const char *str); +void chardev_add_completion(ReadLineState *rs, int nb_args, const char *str); +void set_link_completion(ReadLineState *rs, int nb_args, const char *str); +void netdev_add_completion(ReadLineState *rs, int nb_args, const char *str); +void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str); +void ringbuf_write_completion(ReadLineState *rs, int nb_args, const char *str); +void info_trace_events_completion(ReadLineState *rs, int nb_args, + const char *str); +void trace_event_completion(ReadLineState *rs, int nb_args, const char *str); +void watchdog_action_completion(ReadLineState *rs, int nb_args, + const char *str); +void migrate_set_capability_completion(ReadLineState *rs, int nb_args, + const char *str); +void migrate_set_parameter_completion(ReadLineState *rs, int nb_args, + const char *str); +void delvm_completion(ReadLineState *rs, int nb_args, const char *str); +void loadvm_completion(ReadLineState *rs, int nb_args, const char *str); + +#endif diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index 9b66458d21..27ce1c303f 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -114,27 +114,6 @@ void hmp_vhost_queue_status(Monitor *mon, const QDict *qdict); void hmp_virtio_queue_element(Monitor *mon, const QDict *qdict); void hmp_xen_event_inject(Monitor *mon, const QDict *qdict); void hmp_xen_event_list(Monitor *mon, const QDict *qdict); -void object_add_completion(ReadLineState *rs, int nb_args, const char *str); -void object_del_completion(ReadLineState *rs, int nb_args, const char *str); -void device_add_completion(ReadLineState *rs, int nb_args, const char *str); -void device_del_completion(ReadLineState *rs, int nb_args, const char *str); -void sendkey_completion(ReadLineState *rs, int nb_args, const char *str); -void chardev_remove_completion(ReadLineState *rs, int nb_args, const char *str); -void chardev_add_completion(ReadLineState *rs, int nb_args, const char *str); -void set_link_completion(ReadLineState *rs, int nb_args, const char *str); -void netdev_add_completion(ReadLineState *rs, int nb_args, const char *str); -void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str); -void ringbuf_write_completion(ReadLineState *rs, int nb_args, const char *str); -void info_trace_events_completion(ReadLineState *rs, int nb_args, const char *str); -void trace_event_completion(ReadLineState *rs, int nb_args, const char *str); -void watchdog_action_completion(ReadLineState *rs, int nb_args, - const char *str); -void migrate_set_capability_completion(ReadLineState *rs, int nb_args, - const char *str); -void migrate_set_parameter_completion(ReadLineState *rs, int nb_args, - const char *str); -void delvm_completion(ReadLineState *rs, int nb_args, const char *str); -void loadvm_completion(ReadLineState *rs, int nb_args, const char *str); void hmp_rocker(Monitor *mon, const QDict *qdict); void hmp_rocker_ports(Monitor *mon, const QDict *qdict); void hmp_rocker_of_dpa_flows(Monitor *mon, const QDict *qdict); diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 0a193b8f54..d5712d11b8 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -17,6 +17,7 @@ #include "block/qapi.h" #include "migration/snapshot.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "qapi/error.h" #include "qapi/qapi-commands-migration.h" diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c index 3f019ae2a2..da7dd7f31f 100644 --- a/monitor/hmp-target.c +++ b/monitor/hmp-target.c @@ -29,6 +29,7 @@ #include "system/device_tree.h" #include "monitor/hmp-target.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "block/block-hmp-cmds.h" #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-misc.h" diff --git a/net/net-hmp-cmds.c b/net/net-hmp-cmds.c index e7c55d2787..2b24c9e604 100644 --- a/net/net-hmp-cmds.c +++ b/net/net-hmp-cmds.c @@ -16,6 +16,7 @@ #include "qemu/osdep.h" #include "migration/misc.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "net/net.h" #include "net/hub.h" diff --git a/qom/qom-hmp-cmds.c b/qom/qom-hmp-cmds.c index 32e40630c9..47110ca58c 100644 --- a/qom/qom-hmp-cmds.c +++ b/qom/qom-hmp-cmds.c @@ -8,6 +8,7 @@ #include "qemu/osdep.h" #include "hw/core/qdev.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "qapi/error.h" #include "qapi/qapi-commands-qom.h" diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 5c00bbf483..e90eb6247e 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "hw/core/sysbus.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "monitor/qdev.h" #include "system/arch_init.h" diff --git a/system/runstate-hmp-cmds.c b/system/runstate-hmp-cmds.c index be1d676992..02d1d42bf3 100644 --- a/system/runstate-hmp-cmds.c +++ b/system/runstate-hmp-cmds.c @@ -16,6 +16,7 @@ #include "qemu/osdep.h" #include "exec/cpu-common.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "qapi/error.h" #include "qapi/qapi-commands-run-state.h" diff --git a/trace/trace-hmp-cmds.c b/trace/trace-hmp-cmds.c index 45f4335ff5..390173095c 100644 --- a/trace/trace-hmp-cmds.c +++ b/trace/trace-hmp-cmds.c @@ -24,6 +24,7 @@ #include "qemu/osdep.h" #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor.h" #include "qapi/error.h" #include "qapi/qapi-commands-trace.h" diff --git a/ui/ui-hmp-cmds.c b/ui/ui-hmp-cmds.c index 6c93d452c9..1e9bc77bd8 100644 --- a/ui/ui-hmp-cmds.c +++ b/ui/ui-hmp-cmds.c @@ -18,6 +18,7 @@ #include #endif #include "monitor/hmp.h" +#include "monitor/hmp-completion.h" #include "monitor/monitor-internal.h" #include "qapi/error.h" #include "qapi/qapi-commands-ui.h"