[Qemu-devel] [PATCH] linux-user: drop redundant handling of environment variables

Max Filippov posted 1 patch 4 years, 7 months ago
Test docker-clang@ubuntu failed
Test FreeBSD passed
Test checkpatch passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190906165736.5612-1-jcmvbkbc@gmail.com
Maintainers: Laurent Vivier <laurent@vivier.eu>, Riku Voipio <riku.voipio@iki.fi>
linux-user/main.c | 7 -------
1 file changed, 7 deletions(-)
[Qemu-devel] [PATCH] linux-user: drop redundant handling of environment variables
Posted by Max Filippov 4 years, 7 months ago
QEMU_STRACE and QEMU_RAND_SEED are handled by the parse_args, no need to
do it again in main.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 linux-user/main.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/linux-user/main.c b/linux-user/main.c
index c9d97d2b1fc6..22ae2b3e65d1 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -701,13 +701,6 @@ int main(int argc, char **argv, char **envp)
 
     thread_cpu = cpu;
 
-    if (getenv("QEMU_STRACE")) {
-        do_strace = 1;
-    }
-
-    if (seed_optarg == NULL) {
-        seed_optarg = getenv("QEMU_RAND_SEED");
-    }
     {
         Error *err = NULL;
         if (seed_optarg != NULL) {
-- 
2.11.0


Re: [Qemu-devel] [PATCH] linux-user: drop redundant handling of environment variables
Posted by Laurent Vivier 4 years, 7 months ago
Le 06/09/2019 à 18:57, Max Filippov a écrit :
> QEMU_STRACE and QEMU_RAND_SEED are handled by the parse_args, no need to
> do it again in main.
> 
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> ---
>  linux-user/main.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/linux-user/main.c b/linux-user/main.c
> index c9d97d2b1fc6..22ae2b3e65d1 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -701,13 +701,6 @@ int main(int argc, char **argv, char **envp)
>  
>      thread_cpu = cpu;
>  
> -    if (getenv("QEMU_STRACE")) {
> -        do_strace = 1;
> -    }
> -
> -    if (seed_optarg == NULL) {
> -        seed_optarg = getenv("QEMU_RAND_SEED");
> -    }
>      {
>          Error *err = NULL;
>          if (seed_optarg != NULL) {
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

Re: [Qemu-devel] [PATCH] linux-user: drop redundant handling of environment variables
Posted by Laurent Vivier 4 years, 7 months ago
Le 06/09/2019 à 18:57, Max Filippov a écrit :
> QEMU_STRACE and QEMU_RAND_SEED are handled by the parse_args, no need to
> do it again in main.
> 
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> ---
>  linux-user/main.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/linux-user/main.c b/linux-user/main.c
> index c9d97d2b1fc6..22ae2b3e65d1 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -701,13 +701,6 @@ int main(int argc, char **argv, char **envp)
>  
>      thread_cpu = cpu;
>  
> -    if (getenv("QEMU_STRACE")) {
> -        do_strace = 1;
> -    }
> -
> -    if (seed_optarg == NULL) {
> -        seed_optarg = getenv("QEMU_RAND_SEED");
> -    }
>      {
>          Error *err = NULL;
>          if (seed_optarg != NULL) {
> 

Applied to my linux-user branch.

Thanks,
Laurent