On 04.10.2016 14:41, Paolo Bonzini wrote: > > > On 04/10/2016 13:30, Laurent Vivier wrote: >> But sometime, user wants to use a real accelerator without knowing >> if he really can, with, for instance accel=kvm:tcg. >> In this case, and if the accelerator is not available we >> have a noisy "XXX accelerator not found". >> >> By allowing the user to ask the "best" accelerator for the given >> target, we can avoid this problem. >> >> This patch introduces a new parameter for the "accel" property, the >> "best" keyword. >> >> You can ask to use the best accelerator with "-M accel=best", >> or if you want to use your favorite accelerator and if it is not >> available, the best one, you can use, for instance >> "-M accel=kvm:best". > > I don't think there's a single definition of a "best" accelerator. For > example, some "-cpu" features may be available only with TCG. In that > case, "kvm:tcg" has a clear meaning ("kvm" if it exists, otherwise > "tcg") but "best" doesn't. > > I agree with Daniel that unit tests should use "tcg" exclusively, at > least as a default.
Using only tcg has also some disadvantages: For some tests, it's interesting to know whether they also work properly with KVM (e.g. migration tests), and only using tcg by default slows down the "make check" quite a bit - which might become an issue now that we're adding more and more tests. So maybe we need something like a qtest_get_accel() function that returns "tcg" by default, but if the user set an environment variable like QTEST_ACCEL, it uses that value instead? Thomas