On Mon, Jan 11, 2021 at 10:14:58 +0100, Paolo Bonzini wrote:
On 11/01/21 09:35, Ján Tomko wrote:
>> This unfortunately cannot be done unconditionally. You need to probe
>> for the availability of -accel, using something like
>
> What are we probing for?
Existence of "-accel". "-accel" allows configuration of
accelerator-specific, machine-independent properties. In the past they
went in -machine but the two have been separate since 5.0 (with
backwards-compatible glue).
There were two phases of -accel support in QEMU:
- 2.9 to 4.2: only one -accel option supported; specifying a fallback
couldn't be done with -accel and required the older "-machine
accel=tcg:kvm" instead
- 5.0 or newer: multiple -accel options supported, e.g. "-accel tcg
-accel kvm"
and it would be possible to distinguish them, for example using QOM
properties. However Libvirt only ever specifies one accelerator so it
makes no difference.
We use a fallback for capabilities probing (in qemuProcessQMPLaunch) so
in case the old -machine type,accel=... way is going to be deprecated,
we need to be able to detect whether multiple -accel options are allowed
and use -machine otherwise.
Jirka