#include "hw/qdev-core.h"
#include "monitor-internal.h"
#include "monitor/hmp.h"
-#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qnum.h"
#include "qemu/config-file.h"
#include "qemu/option.h"
#include "qemu/units.h"
#include "sysemu/block-backend.h"
-#include "sysemu/runstate.h"
#include "trace.h"
static void monitor_command_cb(void *opaque, const char *cmdline,
}
}
-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;
if (!strcmp(name, "log")) {
const QEMULogItem *item;
monitor_printf(mon, "Log items (comma separated):\n");
- monitor_printf(mon, "%-10s %s\n", "none", "remove all logs");
+ monitor_printf(mon, "%-15s %s\n", "none", "remove all logs");
for (item = qemu_log_items; item->mask != 0; item++) {
- monitor_printf(mon, "%-10s %s\n", item->name, item->help);
+ monitor_printf(mon, "%-15s %s\n", item->name, item->help);
}
+#ifdef CONFIG_TRACE_LOG
+ monitor_printf(mon, "trace:PATTERN enable trace events\n");
+ monitor_printf(mon, "\nUse \"log trace:help\" to get a list of "
+ "trace events.\n\n");
+#endif
return;
}
return;
}
- monitor_printf(mon, "%s", info->human_readable_text);
+ monitor_puts(mon, info->human_readable_text);
}
static void handle_hmp_command_exec(Monitor *mon,
}
memcpy(cmd, pstart, len);
cmd[len] = '\0';
- if (name[0] == '\0' || !strncmp(name, cmd, strlen(name))) {
- readline_add_completion(mon->rs, cmd);
- }
+ readline_add_completion_of(mon->rs, name, cmd);
if (*p == '\0') {
break;
}
{
const char *cmdname;
int i;
- const char *ptype, *old_ptype, *str, *name;
+ const char *ptype, *old_ptype, *str;
const HMPCommand *cmd;
BlockBackend *blk = NULL;
/* block device name completion */
readline_set_completion_index(mon->rs, strlen(str));
while ((blk = blk_next(blk)) != NULL) {
- name = blk_name(blk);
- if (str[0] == '\0' ||
- !strncmp(name, str, strlen(str))) {
- readline_add_completion(mon->rs, name);
- }
+ readline_add_completion_of(mon->rs, str, blk_name(blk));
}
break;
case 's':