Next commits will split monitor.c to monitor.c and monitor-system.c. Change some functions from static to public in order to prepare for this.
Signed-off-by: Benoît Canet <benoit.ca...@nodalink.com> Reviewed-by: Eric Blake <ebl...@redhat.com> --- include/monitor/monitor.h | 10 ++++++++++ monitor.c | 24 ++++++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 3d6929d..bd9a1f2 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -66,5 +66,15 @@ int monitor_fdset_get_fd(int64_t fdset_id, int flags); int monitor_fdset_dup_fd_add(int64_t fdset_id, int dup_fd); int monitor_fdset_dup_fd_remove(int dup_fd); int monitor_fdset_dup_fd_find(int dup_fd); +int monitor_ctrl_mode(const Monitor *mon); +void monitor_data_init(Monitor *mon); +int compare_cmd(const char *name, const char *list); +int parse_cmdline(const char *cmdline, int *pnb_args, char **args); +void free_cmdline_args(char **args, int nb_args); +void handle_user_command(Monitor *mon, const char *cmdline); +void add_completion_option(ReadLineState *rs, const char *str, + const char *option); +void monitor_user_noop(Monitor *mon, const QObject *data); +int do_qmp_capabilities(Monitor *mon, const QDict *params, QObject **ret_data); #endif /* !MONITOR_H */ diff --git a/monitor.c b/monitor.c index cdbaa60..c6b450b 100644 --- a/monitor.c +++ b/monitor.c @@ -241,7 +241,7 @@ static inline int qmp_cmd_mode(const Monitor *mon) } /* Return true if in control mode, false otherwise */ -static inline int monitor_ctrl_mode(const Monitor *mon) +inline int monitor_ctrl_mode(const Monitor *mon) { return (mon->flags & MONITOR_USE_CONTROL); } @@ -389,7 +389,7 @@ static int GCC_FMT_ATTR(2, 3) monitor_fprintf(FILE *stream, return 0; } -static void monitor_user_noop(Monitor *mon, const QObject *data) { } +void monitor_user_noop(Monitor *mon, const QObject *data) { } static inline int handler_is_qobject(const mon_cmd_t *cmd) { @@ -593,8 +593,7 @@ static void monitor_qapi_event_init(void) qmp_event_set_func_emit(monitor_qapi_event_queue); } -static int do_qmp_capabilities(Monitor *mon, const QDict *params, - QObject **ret_data) +int do_qmp_capabilities(Monitor *mon, const QDict *params, QObject **ret_data) { /* Will setup QMP capabilities in the future */ if (monitor_ctrl_mode(mon)) { @@ -604,9 +603,7 @@ static int do_qmp_capabilities(Monitor *mon, const QDict *params, return 0; } -static void handle_user_command(Monitor *mon, const char *cmdline); - -static void monitor_data_init(Monitor *mon) +void monitor_data_init(Monitor *mon) { memset(mon, 0, sizeof(Monitor)); qemu_mutex_init(&mon->out_lock); @@ -659,7 +656,7 @@ out: return output; } -static int compare_cmd(const char *name, const char *list) +int compare_cmd(const char *name, const char *list) { const char *p, *pstart; int len; @@ -747,7 +744,7 @@ static int get_str(char *buf, int buf_size, const char **pp) #define MAX_ARGS 16 -static void free_cmdline_args(char **args, int nb_args) +void free_cmdline_args(char **args, int nb_args) { int i; @@ -772,8 +769,7 @@ static void free_cmdline_args(char **args, int nb_args) * of args have a limit of MAX_ARGS. If cmdline contains more, it will * return with failure. */ -static int parse_cmdline(const char *cmdline, - int *pnb_args, char **args) +int parse_cmdline(const char *cmdline, int *pnb_args, char **args) { const char *p; int nb_args, ret; @@ -4093,7 +4089,7 @@ static void handler_audit(Monitor *mon, const mon_cmd_t *cmd, int ret) } } -static void handle_user_command(Monitor *mon, const char *cmdline) +void handle_user_command(Monitor *mon, const char *cmdline) { QDict *qdict; const mon_cmd_t *cmd; @@ -4230,8 +4226,8 @@ static const char *next_arg_type(const char *typestr) return (p != NULL ? ++p : typestr); } -static void add_completion_option(ReadLineState *rs, const char *str, - const char *option) +void add_completion_option(ReadLineState *rs, const char *str, + const char *option) { if (!str || !option) { return; -- 2.1.0.rc1