On Tue, 6 Nov 2018 17:48:52 +0100 Andrew Jones <drjones@xxxxxxxxxx> wrote: > On Tue, Nov 06, 2018 at 11:31:33AM -0500, Luiz Capitulino wrote: > > > > According to README.md, users can set QEMU_ACCEL to specify > > kvm or tcg. However, get_qemu_acceletor() uses ACCEL instead, > > which is wrong since ACCEL is an "internal" variable. The end > > result is that tests will still run if the user wants to use > > kvm but kvm is unavailable. Fix get_qemu_acceletor() to use > > QEMU_ACCEL. > > Hi Luiz, > > I agree "ACCEL" isn't a very good name for an environment > variable, which is why I reserved the name QEMU_ACCEL in > the readme. However, ACCEL doesn't have to *only* be an > internal variable, i.e. 'ACCEL=tcg ./run_tests.sh' currently > works, and some users may be used to it now. For some reason I thought ACCEL=tcg ./run_tests.sh wouldn't work, but you're right it does. > Can you elaborate on the problem you're solving? Long story short, I just needed QEMU_ACCEL=kvm ./run_tests.sh to fail/skip tests if /dev/kvm is not available (instead of switching to tcg by default). Since ACCEL works, my problem is solved. IMO we need to update the README.md file or make QEMU_ACCEL work. > > Thanks, > drew > > > > > Signed-off-by: Luiz Capitulino <lcapitulino@xxxxxxxxxx> > > --- > > scripts/arch-run.bash | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash > > index d3ca19d..0997569 100644 > > --- a/scripts/arch-run.bash > > +++ b/scripts/arch-run.bash > > @@ -317,13 +317,13 @@ kvm_available () > > > > get_qemu_accelerator () > > { > > - if [ "$ACCEL" = "kvm" ] && ! kvm_available; then > > + if [ "$QEMU_ACCEL" = "kvm" ] && ! kvm_available; then > > echo "KVM is needed, but not available on this host" >&2 > > return 2 > > fi > > > > - if [ "$ACCEL" ]; then > > - echo $ACCEL > > + if [ "$QEMU_ACCEL" ]; then > > + echo $QEMU_ACCEL > > elif kvm_available; then > > echo kvm > > else > > -- > > 2.17.2 > > >