On Sun, Aug 16, 2026 at 11:12:35PM +0400, Marc-André Lureau wrote:
> mon_cpu_path and reset_seen are only used by HMP monitors; move them
> from the base Monitor struct into MonitorHMP to properly encapsulate
> HMP-specific state.
> 
> Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
> Signed-off-by: Marc-André Lureau <[email protected]>
> ---
>  monitor/hmp-cmds.c         | 16 +++++++++-------
>  monitor/hmp.c              |  9 +++++----
>  monitor/monitor-internal.h |  4 ++--
>  monitor/monitor.c          |  1 -
>  4 files changed, 16 insertions(+), 14 deletions(-)
> 
> diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
> index 6b1114fdaf13..6718fec97047 100644
> --- a/monitor/hmp-cmds.c
> +++ b/monitor/hmp-cmds.c
> @@ -499,31 +499,33 @@ void hmp_dumpdtb(Monitor *mon, const QDict *qdict)
>  /* Set the current CPU defined by the user. Callers must hold BQL. */
>  int monitor_set_cpu(Monitor *mon, int cpu_index)
>  {
> +    MonitorHMP *hmp_mon = MONITOR_HMP(mon);

Nitpicking,  'hmp_mon' is redundant IMHO - 'hmp' is sufficient and
used elsewhere in monitor/ code.

>      CPUState *cpu;
>  
>      cpu = qemu_get_cpu(cpu_index);
>      if (cpu == NULL) {
>          return -1;
>      }
> -    g_free(mon->mon_cpu_path);
> -    mon->mon_cpu_path = object_get_canonical_path(OBJECT(cpu));
> +    g_free(hmp_mon->mon_cpu_path);
> +    hmp_mon->mon_cpu_path = object_get_canonical_path(OBJECT(cpu));
>      return 0;
>  }

None the less

  Reviewed-by: Daniel P. Berrangé <[email protected]>


With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|


Reply via email to