On 5/26/21 1:04 PM, Philippe Mathieu-Daudé wrote:
Introduce the 'query-accels' QMP command which returns a list of built-in accelerator names. > - Accelerator is a QAPI enum of all existing accelerators,- AcceleratorInfo is a QAPI structure providing accelerator specific information. Currently the common structure base provides the name of the accelerator, while the specific part is empty, but each accelerator can expand it. - 'query-accels' QMP command returns a list of @AcceleratorInfo For example on a KVM-only build we get: { "execute": "query-accels" } { "return": [ { "name": "qtest" }, { "name": "kvm" } ] } Reviewed-by: Eric Blake <[email protected]> Reviewed-by: Alex Bennée <[email protected]> Tested-by: Alex Bennée <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]> --- v8: - Include code snippet from Markus adding to machine-target.json to be able to use enum values or union branches conditional. - Use accel_find() on enum to be sure the accelerator is enabled at runtime (chat with jsnow / eblake).
Hi Phil -- Unfortunately I think I am going to defer on this one until Markus is back. I need to chat with him about the right way to design this, since I'm also not entirely clear on it myself.
--js
Cc: Eric Blake <[email protected]> Cc: John Snow <[email protected]> Cc: Markus Armbruster <[email protected]>
