qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/4] linux-user: Restore original behavior of th


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 4/4] linux-user: Restore original behavior of the -E and -U command-line options.
Date: Thu, 27 Jun 2013 18:54:01 +0100

On 29 May 2013 14:50, Thomas Schwinge <address@hidden> wrote:
> Revert the change in behavior that had been introducecd in commit
> fc9c54124d134dbd76338a92a91804dab2df8166 for the -E and -U command-line
> options, but keep the comma-splitting for the QEMU_SET_ENV and QEMU_UNSET_ENV
> environment variables.
>
> Signed-off-by: Thomas Schwinge <address@hidden>
> ---
>  linux-user/main.c |   51 +++++++++++++++++++++++++++++++++++----------------
>  1 file changed, 35 insertions(+), 16 deletions(-)
>
> diff --git linux-user/main.c linux-user/main.c
> index b7d49f4..874791b 100644
> --- linux-user/main.c
> +++ linux-user/main.c
> @@ -3209,15 +3209,37 @@ static void handle_arg_log_filename(arg_origin 
> whence, const char *arg)
>
>  static void handle_arg_set_env(arg_origin whence, const char *arg)
>  {
> -    if (envlist_parse_set(envlist, arg) != 0) {
> -        usage();
> +    switch (whence) {
> +    case ARG_ORIGIN_ENV:
> +        if (envlist_parse_set(envlist, arg) != 0) {
> +            usage();
> +        }
> +        break;
> +    case ARG_ORIGIN_CMDLINE:
> +        if (envlist_setenv(envlist, arg) != 0) {
> +            usage();
> +        }
> +        break;
> +    default:
> +        abort();
>      }
>  }

I agree with Alex's comments; also this function could use a brief
comment explaining why we treat env and command line differently,
as a guard against somebody at a future date undoing this change
in the name of simplification and conistency.

thanks
-- PMM



reply via email to

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