qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 10/10] qemu-binfmt-conf.sh: support QEMU_TARG


From: Laurent Vivier
Subject: Re: [Qemu-devel] [PATCH v3 10/10] qemu-binfmt-conf.sh: support QEMU_TARGETS
Date: Sun, 10 Mar 2019 18:25:11 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 06/03/2019 05:55, Unai Martinez-Corral wrote:
> Rename CPUS to TARGETS, and support QEMU_TARGETS environment variable.
> This does not break backward compatibility, because it is just a placeholder.
> 
> Consistently with 'path', 'suffix', 'persistent' and 'credential',
> provide an environment variable to set the list of target architectures.
> The supported formats are the same as for positional arguments, which have
> priority. If both the variable and the list of positional arguments are empty,
> defaults to 'ALL'.
> 
> Signed-off-by: Unai Martinez-Corral <address@hidden>
> ---
>  scripts/qemu-binfmt-conf.sh | 26 ++++++++++++++------------
>  1 file changed, 14 insertions(+), 12 deletions(-)
> 
> diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
> index 8ca2647ed0..0676f86512 100755
> --- a/scripts/qemu-binfmt-conf.sh
> +++ b/scripts/qemu-binfmt-conf.sh
> @@ -6,7 +6,7 @@ mips mipsel mipsn32 mipsn32el mips64 mips64el \
>  sh4 sh4eb s390x aarch64 aarch64_be hppa riscv32 riscv64 xtensa xtensaeb \
>  microblaze microblazeel or1k x86_64"
> 
> -# check if given target CPUS is/are in the supported target list
> +# check if given TARGETS is/are in the supported target list
>  qemu_check_target_list() {
>      all="$qemu_target_list"
>      if [ "x$1" = "xALL" ] ; then
> @@ -199,12 +199,12 @@ usage() {
>      cat <<EOF
>  Usage: qemu-binfmt-conf.sh [--help][--path PATH][--suffix SUFFIX]
>                             [--persistent][--credential][--exportdir PATH]
> -                           [--reset ARCHS][--systemd][--debian][CPUS]
> +                           [--reset ARCHS][--systemd][--debian][TARGETS]
> 
> -    Configure binfmt_misc to use qemu interpreter for the given CPUS.
> -    Supported formats for CPUS are: single arch or comma/space separated 
> list.
> -    See QEMU target list below. If CPUS is 'ALL' or empty, configure all 
> known
> -    cpus. If CPUS is 'NONE', no interpreter is configured.
> +    Configure binfmt_misc to use qemu interpreter for the given TARGETS.
> +    Supported formats for TARGETS are: single arch or comma/space separated 
> list.
> +    See QEMU target list below. If TARGETS is 'ALL' or empty, configure all 
> known
> +    TARGETS. If TARGETS is 'NONE', no interpreter is configured.
> 
>      --help:        display this usage.
>      --path:        set path to qemu interpreter.
> @@ -244,6 +244,7 @@ Usage: qemu-binfmt-conf.sh [--help][--path PATH][--suffix 
> SUFFIX]
>        QEMU_SUFFIX=
>        QEMU_PERSISTENT=no
>        QEMU_CREDENTIAL=no
> +      QEMU_TARGETS=

         QEMU_TARGETS=$QEMU_TARGETS

> 
>  EOF
>  }
> @@ -324,17 +325,17 @@ EOF
>  }
> 
>  qemu_set_binfmts() {
> -    if [ "x$1" = "xNONE" ] ; then
> -      return
> -    fi
> -
>      # probe cpu type
>      host_family=$(qemu_get_family)
> 
>      # reduce the list of target interpreters to those given in the CLI
> -    targets="$@"
>      if [ $# -eq 0 ] ; then
> -      targets="ALL"
> +      targets="${QEMU_TARGETS:-ALL}"
> +    else
> +      if [ "x$1" = "xNONE" ] ; then

In fact, I think it would be cleaner to have a "--dry-run" option
instead (something setting BINFMT_SET to ':' I think)

Thanks,
Laurent



reply via email to

[Prev in Thread] Current Thread [Next in Thread]