From: Chen Gang <gang.chen.5...@gmail.com> When qemu execute execve() system call, the related command line options can not be passed to the second qemu process, which causes the second process fail.
Signed-off-by: Chen Gang <gang.chen.5...@gmail.com> --- linux-user/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index 06dd296..dfbccbe 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3767,6 +3767,7 @@ static void usage(void) static int parse_args(int argc, char **argv) { const char *r; + char *buf; int optind; const struct qemu_argument *arginfo; @@ -3802,11 +3803,15 @@ static int parse_args(int argc, char **argv) if (optind >= argc) { usage(); } + buf = g_strdup_printf("%s=%s", arginfo->env, argv[optind]); arginfo->handle_opt(argv[optind]); optind++; } else { + buf = g_strdup_printf("%s=", arginfo->env); arginfo->handle_opt(NULL); } + (void) envlist_setenv(envlist, buf); + g_free(buf); break; } } -- 1.9.1