qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v7 3/9] qemu-binfmt-conf.sh: add QEMU_CREDENTIAL


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v7 3/9] qemu-binfmt-conf.sh: add QEMU_CREDENTIAL and QEMU_PERSISTENT
Date: Tue, 12 Mar 2019 16:13:53 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

On 3/12/19 2:51 PM, Unai Martinez-Corral wrote:
> Allow to set options '--persistent' and/or '--credential' through
> environment variables. If not defined, defaults are used ('no').
> Anyway, command-line arguments have priority over environment variables.
> 
> Signed-off-by: Unai Martinez-Corral <address@hidden>
> Reviewed-by: Laurent Vivier <address@hidden>
> ---
>  scripts/qemu-binfmt-conf.sh | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
> index ca15ff8092..ad9ae731a0 100755
> --- a/scripts/qemu-binfmt-conf.sh
> +++ b/scripts/qemu-binfmt-conf.sh
> @@ -186,9 +186,11 @@ Usage: qemu-binfmt-conf.sh [--qemu-path 
> PATH][--debian][--systemd CPU]
>                        (default: $SYSTEMDDIR or $DEBIANDIR)

Remember, this is in an unquoted heredoc, so it looks something like:

(default: /etc/systemd or /usr/share/binfmts)

when actually printed.

>         --credential:  if present, credential and security tokens are
>                        calculated according to the binary to interpret
> +                      ($QEMU_CREDENTIAL=yes)
>         --persistent:  if present, the interpreter is loaded when binfmt is
>                        configured and remains in memory. All future uses
>                        are cloned from the open file.
> +                      ($QEMU_PERSISTENT=yes)
> 

And with your change, when the environment starts empty (and thus the
script's default initialization of QEMU_PERSISTENT kicks in), this will
look like:

(no=yes)

You probably meant to write:

(default: \$QEMU_PERSISTENT=no)

to produce output of:

(default: $QEMU_PERSISTENT=no)

or:

(default: \${QEMU_PERSISTENT:-no})

to produce output of:

(default: ${QEMU_PERSISTENT:-no})

both to clarify that it defaults from the environment, and that its
default is no rather than yes.


> +
> +QEMU_PERSISTENT="${QEMU_PERSISTENT:-no}"
> +QEMU_CREDENTIAL="${QEMU_CREDENTIAL:-no}"
> +
>  QEMU_SUFFIX=""
> 
-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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