On 14/03/2016 12:21, Denis V. Lunev wrote: > From: Pavel Butsykin <pbutsy...@virtuozzo.com>
Please explain the usecase here. Is it for debugging the hypervisor or for something else? Paolo > Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> > Signed-off-by: Denis V. Lunev <d...@openvz.org> > CC: Stefan Hajnoczi <stefa...@redhat.com> > CC: Paolo Bonzini <pbonz...@redhat.com> > CC: Luiz Capitulino <lcapitul...@redhat.com> > CC: Markus Armbruster <arm...@redhat.com> > CC: Eric Blake <ebl...@redhat.com> > --- > include/qemu/log.h | 1 + > monitor.c | 4 ++++ > util/log.c | 2 ++ > 3 files changed, 7 insertions(+) > > diff --git a/include/qemu/log.h b/include/qemu/log.h > index 55bceae..9264bbf 100644 > --- a/include/qemu/log.h > +++ b/include/qemu/log.h > @@ -43,6 +43,7 @@ static inline bool qemu_log_separate(void) > #define CPU_LOG_PAGE (1 << 14) > #define LOG_TRACE (1 << 15) > #define LOG_QMP (1 << 16) > +#define LOG_HMP (1 << 17) > > /* Returns true if a bit is set in the current loglevel mask > */ > diff --git a/monitor.c b/monitor.c > index eec4e58..4bf4f31 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -2893,6 +2893,8 @@ static void handle_hmp_command(Monitor *mon, const char > *cmdline) > QDict *qdict; > const mon_cmd_t *cmd; > > + qemu_log_mask(LOG_HMP, "HMP command: %s\n", cmdline); > + > cmd = monitor_parse_command(mon, &cmdline, mon->cmd_table); > if (!cmd) { > return; > @@ -4053,11 +4055,13 @@ static void monitor_event(void *opaque, int event) > } > mon->reset_seen = 1; > mon_refcount++; > + qemu_log_mask(LOG_HMP, "HMP: new connection established\n"); > break; > > case CHR_EVENT_CLOSED: > mon_refcount--; > monitor_fdsets_cleanup(); > + qemu_log_mask(LOG_HMP, "HMP: connection closed\n"); > break; > } > } > diff --git a/util/log.c b/util/log.c > index 5fc517b..795aaea 100644 > --- a/util/log.c > +++ b/util/log.c > @@ -133,6 +133,8 @@ const QEMULogItem qemu_log_items[] = { > "complete traces" }, > { LOG_QMP, "qmp", > "log the QMP commands and events" }, > + { LOG_HMP, "hmp", > + "log the HMP commands and events" }, > { 0, NULL, NULL }, > }; > >