qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 7/9] log: report HMP command and event


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 7/9] log: report HMP command and event
Date: Mon, 14 Mar 2016 15:36:11 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 14/03/2016 12:21, Denis V. Lunev wrote:
> From: Pavel Butsykin <address@hidden>

Please explain the usecase here.  Is it for debugging the hypervisor or
for something else?

Paolo

> Signed-off-by: Pavel Butsykin <address@hidden>
> Signed-off-by: Denis V. Lunev <address@hidden>
> CC: Stefan Hajnoczi <address@hidden>
> CC: Paolo Bonzini <address@hidden>
> CC: Luiz Capitulino <address@hidden>
> CC: Markus Armbruster <address@hidden>
> CC: Eric Blake <address@hidden>
> ---
>  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 },
>  };
>  
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]