On 9/8/21 12:37 PM, Daniel P. Berrangé wrote: > Now that we have a QMP command 'x-query-registers', the HMP counterpart > 'info registers' can be refactored to call the former. > > Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> > --- > monitor/misc.c | 25 ++++++++++++++++--------- > 1 file changed, 16 insertions(+), 9 deletions(-) > > diff --git a/monitor/misc.c b/monitor/misc.c > index ffe7966870..f0b94c3084 100644 > --- a/monitor/misc.c > +++ b/monitor/misc.c > @@ -67,6 +67,7 @@ > #include "block/block-hmp-cmds.h" > #include "qapi/qapi-commands-char.h" > #include "qapi/qapi-commands-control.h" > +#include "qapi/qapi-commands-machine.h" > #include "qapi/qapi-commands-migration.h" > #include "qapi/qapi-commands-misc.h" > #include "qapi/qapi-commands-qom.h" > @@ -301,23 +302,29 @@ int monitor_get_cpu_index(Monitor *mon) > static void hmp_info_registers(Monitor *mon, const QDict *qdict) > { > bool all_cpus = qdict_get_try_bool(qdict, "cpustate_all", false); > - CPUState *cs; > + bool has_cpu = !all_cpus; > + int64_t cpu = 0; > + Error *local_err = NULL; > + g_autoptr(RegisterInfo) info = NULL; > > - if (all_cpus) { > - CPU_FOREACH(cs) { > - monitor_printf(mon, "\nCPU#%d\n", cs->cpu_index); > - cpu_dump_state(cs, NULL, CPU_DUMP_FPU);
And once all targets are converted we can remove cpu_dump_state().