[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/5] monitor: rewrite 'info registers' in terms of 'x-query-r
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 5/5] monitor: rewrite 'info registers' in terms of 'x-query-registers' |
Date: |
Wed, 8 Sep 2021 13:01:21 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
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é <berrange@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().
- [PATCH 3/5] target/i386: convert to use format_state instead of dump_state, (continued)
- [PATCH 4/5] qapi: introduce x-query-registers QMP command, Daniel P . Berrangé, 2021/09/08
- [PATCH 5/5] monitor: rewrite 'info registers' in terms of 'x-query-registers', Daniel P . Berrangé, 2021/09/08
- Re: [PATCH 5/5] monitor: rewrite 'info registers' in terms of 'x-query-registers',
Philippe Mathieu-Daudé <=
- Re: [PATCH 0/5] Stop adding HMP-only commands, allow QMP for all, Ján Tomko, 2021/09/08
- Re: [PATCH 0/5] Stop adding HMP-only commands, allow QMP for all, Markus Armbruster, 2021/09/08
- Re: [PATCH 0/5] Stop adding HMP-only commands, allow QMP for all, Philippe Mathieu-Daudé, 2021/09/08
- Re: [PATCH 0/5] Stop adding HMP-only commands, allow QMP for all, Paolo Bonzini, 2021/09/09