From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [kvm-unit-tests PATCH 6/7] arm/run: introduce basic option parsing Date: Mon, 6 Jul 2015 15:22:28 +0200 Message-ID: <20150706132228.GI17217@hawk.localdomain> References: <1435931327-8073-1-git-send-email-alex.bennee@linaro.org> <1435931327-8073-7-git-send-email-alex.bennee@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org To: Alex =?iso-8859-1?Q?Benn=E9e?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36016 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755159AbbGFNWc (ORCPT ); Mon, 6 Jul 2015 09:22:32 -0400 Content-Disposition: inline In-Reply-To: <1435931327-8073-7-git-send-email-alex.bennee@linaro.org> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Jul 03, 2015 at 02:48:46PM +0100, Alex Benn=E9e wrote: > So far this simple option parsing loop allows us to --force-tcg even > when running on ARM hardware. >=20 > Signed-off-by: Alex Benn=E9e > --- > arm/run | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) >=20 > diff --git a/arm/run b/arm/run > index a3a33b3..43d7508 100755 > --- a/arm/run > +++ b/arm/run > @@ -18,6 +18,23 @@ if [ -c /dev/kvm ]; then > fi > fi > =20 > +while :; do > + case $1 in > + --force-tcg) > + usingkvm=3D0 > + shift > + ;; > + --) > + # End of all options. > + shift > + break > + ;; > + *) > + break > + ;; > + esac > +done > + > qemu=3D"${QEMU:-qemu-system-$ARCH_NAME}" > qpath=3D$(which $qemu 2>/dev/null) I don't think we need this. If we eventually do, then I think it should be in a common location sharable by all architectures, and also run_tests.sh should be taught how to pass options through. For this use though, Paolo's suggestion should be good enough. That is to do arm/run arm/some-test.flat -machine accel=3Dtcg IIUC, since this -machine option will come later on the command line than the one in arm/run, then it will override whatever we've already done there. It doesn't look like we need to specify virt again though, so it must add to what we have, and only override the earlier specified option with what we specify later. The qemu command line is a complicated animal... Thanks, drew