[PATCH 0/2] monitor: generalized query for accelerator availability

Paolo Bonzini posted 2 patches 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251013112650.935921-1-pbonzini@redhat.com
Maintainers: "Dr. David Alan Gilbert" <dave@treblig.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>
qapi/accelerator.json      | 47 +++++++++++++++++++++++++++++---------
include/monitor/hmp.h      |  2 +-
hw/core/machine-hmp-cmds.c | 21 +++++++++--------
hw/core/machine-qmp-cmds.c | 20 ++++++++++++----
hmp-commands-info.hx       | 19 +++++++++------
5 files changed, 76 insertions(+), 33 deletions(-)
[PATCH 0/2] monitor: generalized query for accelerator availability
Posted by Paolo Bonzini 1 month ago
The recently-introduced query-mshv command is a duplicate of query-kvm,
and neither provides a full view of which accelerators are supported
by a particular binary of QEMU and which is in use.

KVM was the first accelerator added to QEMU, predating QOM and TYPE_ACCEL,
so it got a pass.  But now, instead of adding a badly designed copy, solve
the problem completely for all accelerators with a command that provides
the whole picture:

    >> {"execute": "query-accelerators"}
    << {"return": {"enabled": "tcg", "present": ["kvm", "mshv", "qtest", "tcg", "xen"]}}

Since query-mshv was not in any released version, drop it.  Because the
code looks similar, I am not splitting this into removal of query-mshv
and addition of the new command.

Paolo

Paolo Bonzini (2):
  monitor: clarify "info accel" help message
  monitor: generalize query-mshv/"info mshv" to query-accelerators/"info
    accelerators"

 qapi/accelerator.json      | 47 +++++++++++++++++++++++++++++---------
 include/monitor/hmp.h      |  2 +-
 hw/core/machine-hmp-cmds.c | 21 +++++++++--------
 hw/core/machine-qmp-cmds.c | 20 ++++++++++++----
 hmp-commands-info.hx       | 19 +++++++++------
 5 files changed, 76 insertions(+), 33 deletions(-)

-- 
2.51.0