On Tue, Jun 08, 2021 at 02:39:03PM +0200, Philippe Mathieu-Daudé wrote: > > > > Not enough coffee earlier. I think this is a documentation problem, > > query-kvm returns a list of *runtime* accelerators: > > https://www.mail-archive.com/qemu-devel@nongnu.org/msg811144.html > > > > IIUC what Paolo said, if something asks for an accelerator that > > is not present at build-time, then this is a configuration problem, > > not relevant for the management interface. > > Argh no... sigh. So we have 4 cases: > > 1- accelerator not built > 2- accelerator built in as module but not loaded > 3- accelerator built in & loaded but not usable > 4- accelerator built in & loaded and usable > > QMP query-accels returns "accelerator built in & loaded" > without precising it is usable. > > qtest kvm_enabled() checks if the accelerator is enabled > without checking it is built-in. > > QMP query-kvm returns 'present' as in built-in (so case 1), > and 'enabled' (a.k.a. 'allowed') updated once init_machine() > succeeded (so case 4). > > So, again, IIUC Paolo, what he said is for the management layer > 1 and 2 are the same, the accelerator is not present.
Isn't 3 in the same boat? Really, the management app cares if it can use the accelerator, not whether it is present. > > For qtests, we want the 'usable' case (4) right? Whether the > accelerator is builtin / loaded is irrelevant. > > Could we improve the terminology here? Maybe is_present() and > is_usable()? Suggestions? > > Do we need to add both query-present-accels query-usable-accels > commands? Is it actually possible to return an array of 'usable' > accelerators? > > Maybe simply add query-present-accels() -> [] and > query-usable-accel(accel) -> bool. Can you just make query-accels return both pieces of information? -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org