qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 3e11e0: monitor: remove 'info ioapic' HMP com


From: Richard Henderson
Subject: [Qemu-commits] [qemu/qemu] 3e11e0: monitor: remove 'info ioapic' HMP command
Date: Wed, 03 Nov 2021 05:10:55 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 3e11e0b2dd5b0ed98d129aeacf46276f3671b5f5
      
https://github.com/qemu/qemu/commit/3e11e0b2dd5b0ed98d129aeacf46276f3671b5f5
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M hmp-commands-info.hx
    M include/monitor/hmp-target.h
    M target/i386/monitor.c

  Log Message:
  -----------
  monitor: remove 'info ioapic' HMP command

This command was turned into a no-op four years ago in

  commit 0c8465440d50c18a7bb13d0a866748f0593e193a
  Author: Peter Xu <peterx@redhat.com>
  Date:   Fri Dec 29 15:31:04 2017 +0800

    hmp: obsolete "info ioapic"

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 0ca117a756a79c0f93c9030b5c5a92982e3b0ee5
      
https://github.com/qemu/qemu/commit/0ca117a756a79c0f93c9030b5c5a92982e3b0ee5
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M hw/core/machine-hmp-cmds.c
    M include/monitor/hmp.h
    M monitor/hmp-cmds.c

  Log Message:
  -----------
  monitor: make hmp_handle_error return a boolean

This turns the pattern

  if (err) {
     hmp_handle_error(mon, err);
     return;
  }

into

  if (hmp_handle_error(mon, err)) {
     return;
  }

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 0e33e3d2c40f68f71d628dfe57d460f47e416e78
      
https://github.com/qemu/qemu/commit/0e33e3d2c40f68f71d628dfe57d460f47e416e78
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M docs/devel/index.rst
    A docs/devel/writing-monitor-commands.rst
    R docs/devel/writing-qmp-commands.rst

  Log Message:
  -----------
  docs/devel: rename file for writing monitor commands

The file already covers writing HMP commands, in addition to
the QMP commands, so it deserves a more general name.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: fa2613afa1ebe50c59606f1c30ad6738fe6919a5
      
https://github.com/qemu/qemu/commit/fa2613afa1ebe50c59606f1c30ad6738fe6919a5
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M docs/devel/writing-monitor-commands.rst

  Log Message:
  -----------
  docs/devel: tweak headings in monitor command docs

The new headings reflect the intended structure of the document and will
better suit additions that follow.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 6fa6b54f5b931e10e24f773d991a48da4f79e61a
      
https://github.com/qemu/qemu/commit/6fa6b54f5b931e10e24f773d991a48da4f79e61a
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M docs/devel/writing-monitor-commands.rst

  Log Message:
  -----------
  docs/devel: update error handling guidance for HMP commands

Best practice is to use the 'hmp_handle_error' function, not
'monitor_printf' or 'error_report_err'. This ensures that the
message always gets an 'Error: ' prefix, distinguishing it
from normal command output.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: f9429c6790ce0c9f737d318eeff5c4a24f641ec2
      
https://github.com/qemu/qemu/commit/f9429c6790ce0c9f737d318eeff5c4a24f641ec2
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M include/monitor/hmp.h
    M include/monitor/monitor.h
    A include/qapi/type-helpers.h
    M monitor/hmp.c
    M monitor/misc.c
    M monitor/monitor-internal.h
    M qapi/common.json
    M qapi/meson.build
    A qapi/qapi-type-helpers.c

  Log Message:
  -----------
  monitor: introduce HumanReadableText and HMP support

This provides a foundation on which to convert simple HMP commands to
use QMP. The QMP implementation will generate formatted text targeted
for human consumption, returning it in the HumanReadableText data type.

The HMP command handler will simply print out the formatted string
within the HumanReadableText data type. Since this will be an entirely
formulaic action in the case of HMP commands taking no arguments, a
custom command handler is provided.

Thus instead of registering a 'cmd' callback for the HMP command, a
'cmd_info_hrt' callback is provided, which will simply be a pointer
to the QMP implementation.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: f2de406f29e5fbdc2fcc5c9cb48d29293fba58a5
      
https://github.com/qemu/qemu/commit/f2de406f29e5fbdc2fcc5c9cb48d29293fba58a5
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M docs/devel/writing-monitor-commands.rst

  Log Message:
  -----------
  docs/devel: document expectations for QAPI data modelling for QMP

Traditionally we have required that newly added QMP commands will model
any returned data using fine grained QAPI types. This is good for
commands that are intended to be consumed by machines, where clear data
representation is very important. Commands that don't satisfy this have
generally been added to HMP only.

In effect the decision of whether to add a new command to QMP vs HMP has
been used as a proxy for the decision of whether the cost of designing a
fine grained QAPI type is justified by the potential benefits.

As a result the commands present in QMP and HMP are non-overlapping
sets, although HMP comamnds can be accessed indirectly via the QMP
command 'human-monitor-command'.

One of the downsides of 'human-monitor-command' is that the QEMU monitor
APIs remain tied into various internal parts of the QEMU code. For
example any exclusively HMP command will need to use 'monitor_printf'
to get data out. It would be desirable to be able to fully isolate the
monitor implementation from QEMU internals, however, this is only
possible if all commands are exclusively based on QAPI with direct
QMP exposure.

The way to achieve this desired end goal is to finese the requirements
for QMP command design. For cases where the output of a command is only
intended for human consumption, it is reasonable to want to simplify
the implementation by returning a plain string containing formatted
data instead of designing a fine grained QAPI data type. This can be
permitted if-and-only-if the command is exposed under the 'x-' name
prefix. This indicates that the command data format is liable to
future change and that it is not following QAPI design best practice.

The poster child example for this would be the 'info registers' HMP
command which returns printf formatted data representing CPU state.
This information varies enourmously across target architectures and
changes relatively frequently as new CPU features are implemented.
It is there as debugging data for human operators, and any machine
usage would treat it as an opaque blob. It is thus reasonable to
expose this in QMP as 'x-query-registers' returning a 'str' field.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: a45cfcbb0158af05716bc06fd77f93ba883b13e7
      
https://github.com/qemu/qemu/commit/a45cfcbb0158af05716bc06fd77f93ba883b13e7
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M docs/devel/writing-monitor-commands.rst

  Log Message:
  -----------
  docs/devel: add example of command returning unstructured text

This illustrates how to add a QMP command returning unstructured text,
following the guidelines added in the previous patch. The example uses
a simplified version of 'info roms'.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 3d312f417d6c3baf7e2b3f321e17ed9d74471ff4
      
https://github.com/qemu/qemu/commit/3d312f417d6c3baf7e2b3f321e17ed9d74471ff4
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M docs/devel/writing-monitor-commands.rst

  Log Message:
  -----------
  docs/devel: document expectations for HMP commands in the future

We no longer wish to have commands implemented in HMP only. All commands
should start with a QMP implementation and the HMP merely be a shim
around this. To reduce the burden of implementing QMP commands where
there is low expectation of machine usage, requirements for QAPI
modelling are relaxed provided the command is under the "x-" name
prefix.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: dd98234c059e6bdb05a52998270df6d3d990332e
      
https://github.com/qemu/qemu/commit/dd98234c059e6bdb05a52998270df6d3d990332e
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M hmp-commands-info.hx
    M hw/core/loader.c
    M monitor/misc.c
    M qapi/machine.json

  Log Message:
  -----------
  qapi: introduce x-query-roms QMP command

This is a counterpart to the HMP "info roms" command. It is being
added with an "x-" prefix because this QMP command is intended as an
adhoc debugging tool and will thus not be modelled in QAPI as fully
structured data, nor will it have long term guaranteed stability.
The existing HMP command is rewritten to call the QMP command.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 37087fde0e6b81bdc6aefb1cd6289d90b2095ec0
      
https://github.com/qemu/qemu/commit/37087fde0e6b81bdc6aefb1cd6289d90b2095ec0
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M hmp-commands-info.hx
    M monitor/misc.c
    M monitor/qmp-cmds.c
    M qapi/machine.json
    M tests/qtest/qmp-cmd-test.c

  Log Message:
  -----------
  qapi: introduce x-query-profile QMP command

This is a counterpart to the HMP "info profile" command. It is being
added with an "x-" prefix because this QMP command is intended as an
adhoc debugging tool and will thus not be modelled in QAPI as fully
structured data, nor will it have long term guaranteed stability.
The existing HMP command is rewritten to call the QMP command.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 1b8ae799d8916dd589cc31db697a82b4e86880d0
      
https://github.com/qemu/qemu/commit/1b8ae799d8916dd589cc31db697a82b4e86880d0
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M hmp-commands-info.hx
    M hw/core/machine-hmp-cmds.c
    M hw/core/machine-qmp-cmds.c
    M qapi/machine.json

  Log Message:
  -----------
  qapi: introduce x-query-numa QMP command

This is a counterpart to the HMP "info numa" command. It is being
added with an "x-" prefix because this QMP command is intended as an
adhoc debugging tool and will thus not be modelled in QAPI as fully
structured data, nor will it have long term guaranteed stability.
The existing HMP command is rewritten to call the QMP command.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: fc30920731470a44c69c8359be45b72ac7314fb6
      
https://github.com/qemu/qemu/commit/fc30920731470a44c69c8359be45b72ac7314fb6
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M hmp-commands-info.hx
    M hw/usb/bus.c
    M qapi/machine.json
    M stubs/usb-dev-stub.c
    M tests/qtest/qmp-cmd-test.c

  Log Message:
  -----------
  qapi: introduce x-query-usb QMP command

This is a counterpart to the HMP "info usb" command. It is being
added with an "x-" prefix because this QMP command is intended as an
adhoc debugging tool and will thus not be modelled in QAPI as fully
structured data, nor will it have long term guaranteed stability.
The existing HMP command is rewritten to call the QMP command.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 8dbbca5c056842d53498f643a15cac8593d51424
      
https://github.com/qemu/qemu/commit/8dbbca5c056842d53498f643a15cac8593d51424
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M hmp-commands-info.hx
    M hw/rdma/rdma_rm.c
    M hw/rdma/rdma_rm.h
    M hw/rdma/vmw/pvrdma_main.c
    M include/hw/rdma/rdma.h
    M monitor/hmp-cmds.c
    M monitor/qmp-cmds.c
    M qapi/machine.json

  Log Message:
  -----------
  qapi: introduce x-query-rdma QMP command

This is a counterpart to the HMP "info rdma" command. It is being
added with an "x-" prefix because this QMP command is intended as an
adhoc debugging tool and will thus not be modelled in QAPI as fully
structured data, nor will it have long term guaranteed stability.
The existing HMP command is rewritten to call the QMP command.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: ca411b7c8a230af7e83bcebda88b265335f0e4f8
      
https://github.com/qemu/qemu/commit/ca411b7c8a230af7e83bcebda88b265335f0e4f8
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M hmp-commands-info.hx
    M include/exec/ramlist.h
    M monitor/hmp-cmds.c
    M monitor/qmp-cmds.c
    M qapi/machine.json
    M softmmu/physmem.c

  Log Message:
  -----------
  qapi: introduce x-query-ramblock QMP command

This is a counterpart to the HMP "info ramblock" command. It is being
added with an "x-" prefix because this QMP command is intended as an
adhoc debugging tool and will thus not be modelled in QAPI as fully
structured data, nor will it have long term guaranteed stability.
The existing HMP command is rewritten to call the QMP command.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 91f2fa7045e3f6c298b14ea7c66c486c27fe3b9f
      
https://github.com/qemu/qemu/commit/91f2fa7045e3f6c298b14ea7c66c486c27fe3b9f
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M hmp-commands-info.hx
    M monitor/hmp-cmds.c
    M monitor/qmp-cmds.c
    M qapi/machine.json

  Log Message:
  -----------
  qapi: introduce x-query-irq QMP command

This is a counterpart to the HMP "info irq" command. It is being
added with an "x-" prefix because this QMP command is intended as an
adhoc debugging tool and will thus not be modelled in QAPI as fully
structured data, nor will it have long term guaranteed stability.
The existing HMP command is rewritten to call the QMP command.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: 3a841ab53f165910224dc4bebabf1a8f1d04200c
      
https://github.com/qemu/qemu/commit/3a841ab53f165910224dc4bebabf1a8f1d04200c
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M accel/tcg/cpu-exec.c
    M accel/tcg/hmp.c
    M accel/tcg/translate-all.c
    M include/exec/cpu-all.h
    M include/tcg/tcg.h
    M qapi/machine.json
    M tcg/tcg.c
    M tests/qtest/qmp-cmd-test.c

  Log Message:
  -----------
  qapi: introduce x-query-jit QMP command

This is a counterpart to the HMP "info jit" command. It is being
added with an "x-" prefix because this QMP command is intended as an
ad hoc debugging tool and will thus not be modelled in QAPI as fully
structured data, nor will it have long term guaranteed stability.
The existing HMP command is rewritten to call the QMP command.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: b6a7f3e0d28248861cf46f59521129b179e8748d
      
https://github.com/qemu/qemu/commit/b6a7f3e0d28248861cf46f59521129b179e8748d
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M accel/tcg/cpu-exec.c
    M accel/tcg/hmp.c
    M accel/tcg/translate-all.c
    M include/exec/cpu-all.h
    M include/tcg/tcg.h
    M qapi/machine.json
    M tcg/tcg.c
    M tests/qtest/qmp-cmd-test.c

  Log Message:
  -----------
  qapi: introduce x-query-opcount QMP command

This is a counterpart to the HMP "info opcount" command. It is being
added with an "x-" prefix because this QMP command is intended as an
ad hoc debugging tool and will thus not be modelled in QAPI as fully
structured data, nor will it have long term guaranteed stability.
The existing HMP command is rewritten to call the QMP command.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


  Commit: e86e00a2493254d072581960b48461eb96481e45
      
https://github.com/qemu/qemu/commit/e86e00a2493254d072581960b48461eb96481e45
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-11-03 (Wed, 03 Nov 2021)

  Changed paths:
    M accel/tcg/cpu-exec.c
    M accel/tcg/hmp.c
    M accel/tcg/translate-all.c
    M docs/devel/index.rst
    A docs/devel/writing-monitor-commands.rst
    R docs/devel/writing-qmp-commands.rst
    M hmp-commands-info.hx
    M hw/core/loader.c
    M hw/core/machine-hmp-cmds.c
    M hw/core/machine-qmp-cmds.c
    M hw/rdma/rdma_rm.c
    M hw/rdma/rdma_rm.h
    M hw/rdma/vmw/pvrdma_main.c
    M hw/usb/bus.c
    M include/exec/cpu-all.h
    M include/exec/ramlist.h
    M include/hw/rdma/rdma.h
    M include/monitor/hmp-target.h
    M include/monitor/hmp.h
    M include/monitor/monitor.h
    A include/qapi/type-helpers.h
    M include/tcg/tcg.h
    M monitor/hmp-cmds.c
    M monitor/hmp.c
    M monitor/misc.c
    M monitor/monitor-internal.h
    M monitor/qmp-cmds.c
    M qapi/common.json
    M qapi/machine.json
    M qapi/meson.build
    A qapi/qapi-type-helpers.c
    M softmmu/physmem.c
    M stubs/usb-dev-stub.c
    M target/i386/monitor.c
    M tcg/tcg.c
    M tests/qtest/qmp-cmd-test.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/berrange/tags/hmp-x-qmp-620-pull-request' into staging

Initial conversion of HMP debugging commands to QMP

This introduces a new policy that all HMP commands will be converted to
have QMP equivalents, marked unstable if no formal QAPI modelling is
intended to be done.

New unstable commands are added as follows:

  - HMP "info roms" => QMP "x-query-roms"
  - HMP "info profile" => QMP "x-query-profile"
  - HMP "info numa" => QMP "x-query-numa"
  - HMP "info usb" => QMP "x-query-usb"
  - HMP "info rdma" => QMP "x-query-rdma"
  - HMP "info ramblock" => QMP "x-query-ramblock"
  - HMP "info irq" => QMP "x-query-irq"
  - HMP "info jit" => QMP "x-query-jit"
  - HMP "info opcount" => QMP "x-query-opcount"

# gpg: Signature made Tue 02 Nov 2021 01:54:28 PM EDT
# gpg:                using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
# gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>" [full]

* remotes/berrange/tags/hmp-x-qmp-620-pull-request:
  qapi: introduce x-query-opcount QMP command
  qapi: introduce x-query-jit QMP command
  qapi: introduce x-query-irq QMP command
  qapi: introduce x-query-ramblock QMP command
  qapi: introduce x-query-rdma QMP command
  qapi: introduce x-query-usb QMP command
  qapi: introduce x-query-numa QMP command
  qapi: introduce x-query-profile QMP command
  qapi: introduce x-query-roms QMP command
  docs/devel: document expectations for HMP commands in the future
  docs/devel: add example of command returning unstructured text
  docs/devel: document expectations for QAPI data modelling for QMP
  monitor: introduce HumanReadableText and HMP support
  docs/devel: update error handling guidance for HMP commands
  docs/devel: tweak headings in monitor command docs
  docs/devel: rename file for writing monitor commands
  monitor: make hmp_handle_error return a boolean
  monitor: remove 'info ioapic' HMP command

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Compare: https://github.com/qemu/qemu/compare/58b647616451...e86e00a24932



reply via email to

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