Re: [PATCH v5 03/19] clean root dir of all x86-ness

Andrew Jones
2014-06-12T10:40:11Z

On Thu, Jun 12, 2014 at 12:31:54PM +0200, Paolo Bonzini wrote:
> Il 11/06/2014 16:01, Andrew Jones ha scritto:
> >diff --git a/configure b/configure
> >index d0c62e24dd1d2..6cfc64943f6e6 100755
> >--- a/configure
> >+++ b/configure
> >@@ -15,6 +15,7 @@ usage() {
> > Usage: $0 [options]
> >
> > Options include:
> >+ --test-dir=DIR the main directory for tests ($arch)
> > --arch=ARCH architecture to compile for ($arch)
> > --cross-prefix=PREFIX cross compiler prefix
> > --cc=CC c compiler to use ($cc)
> >@@ -33,6 +34,9 @@ while [[ "$1" = -* ]]; do
> > opt="${opt%%=*}"
> > fi
> > case "$opt" in
> >+ --test-dir)
> >+ testdir="$arg"
> >+ ;;
> > --prefix)
> > prefix="$arg"
> > ;;
> >@@ -62,6 +66,18 @@ while [[ "$1" = -* ]]; do
> > ;;
> > esac
> > done
> >+if [ -z "$testdir" -a \( "$arch" = "i386" -o "$arch" = "x86_64" \) ]; then
> >+ testdir=x86
> >+elif [ -z "$testdir" ]; then
> >+ testdir=$arch
> >+fi
> >+if [ ! -d $testdir ]; then
> >+ echo "$testdir does not exist!"
> >+ exit 1
> >+fi
> >+if [ -f $testdir/run ]; then
> >+ ln -fs $testdir/run $testdir-run
> >+fi
>
> Why is --test-dir useful? Can you just use --arch instead?

testdir is not always the same as arch, e.g. arch=x86_64, testdir=x86,
and setting --arch x86 would lose useful information. We wouldn't know
if arch is supposed to be i386 or x86_64. The same argument will apply
to arch=arm vs. arch=aarch64.

>
> >diff --git a/docs/testdev.txt b/docs/testdev.txt
> >new file mode 100644
> >index 0000000000000..854fe20d56f66
> >--- /dev/null
> >+++ b/docs/testdev.txt
> >@@ -0,0 +1,13 @@
> >+This file describes the virtual device of qemu for supporting this
> >+test suite.
> >+
> >+Services supplied by the testdev device:
> >+ serial output: write-only, on io port 0xf1
> >+ exit process: write-only, on io port 0xf4, value used as
> >+ the exit code
> >+ ram size: read-only, on io port 0xd1, 4 bytes' size
> >+ irq line setting: write-only, on io ports 0x2000 - 0x2018,
> >+ value to set/clear
> >+ simple io: read/write, on io port 0xe0, 1/2/4 bytes
> >+
> >+The test device uses a char device for actual output.
>
> I'm removing this file altogether and adding it to QEMU instead. Most of
> the content is obsolete too.

Sounds good to me.

drew