* [Qemu-devel] [PATCH v2] linux-user/main.c: Set environments variables from command line options
@ 2015-09-10 8:10 gang.chen.5i5j
2015-09-10 8:28 ` Chen Gang
0 siblings, 1 reply; 2+ messages in thread
From: gang.chen.5i5j @ 2015-09-10 8:10 UTC (permalink / raw)
To: riku.voipio; +Cc: peter.maydell, Chen Gang, qemu-devel, xili_gchen_5257, rth
From: Chen Gang <gang.chen.5i5j@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.5i5j@gmail.com>
---
linux-user/main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/linux-user/main.c b/linux-user/main.c
index 06dd296..f1f5496 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,6 +3803,9 @@ static int parse_args(int argc, char **argv)
if (optind >= argc) {
usage();
}
+ buf = g_strdup_printf("%s=%s", arginfo->env, argv[optind]);
+ (void) envlist_setenv(envlist, buf);
+ g_free(buf);
arginfo->handle_opt(argv[optind]);
optind++;
} else {
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH v2] linux-user/main.c: Set environments variables from command line options
2015-09-10 8:10 [Qemu-devel] [PATCH v2] linux-user/main.c: Set environments variables from command line options gang.chen.5i5j
@ 2015-09-10 8:28 ` Chen Gang
0 siblings, 0 replies; 2+ messages in thread
From: Chen Gang @ 2015-09-10 8:28 UTC (permalink / raw)
To: gang.chen.5i5j@gmail.com, Riku Voipio
Cc: Peter Maydell, qemu-devel, rth@twiddle.net
Oh, very sorry! The patch v2 did not process simple options (e.g. -strace).
I should send patch v3 for it.
Thanks.
----------------------------------------
> From: gang.chen.5i5j@gmail.com
> To: riku.voipio@iki.fi
> CC: rth@twiddle.net; peter.maydell@linaro.org; xili_gchen_5257@hotmail.com; qemu-devel@nongnu.org; gang.chen.5i5j@gmail.com
> Subject: [PATCH v2] linux-user/main.c: Set environments variables from command line options
> Date: Thu, 10 Sep 2015 16:10:22 +0800
>
> From: Chen Gang <gang.chen.5i5j@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.5i5j@gmail.com>
> ---
> linux-user/main.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/linux-user/main.c b/linux-user/main.c
> index 06dd296..f1f5496 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,6 +3803,9 @@ static int parse_args(int argc, char **argv)
> if (optind>= argc) {
> usage();
> }
> + buf = g_strdup_printf("%s=%s", arginfo->env, argv[optind]);
> + (void) envlist_setenv(envlist, buf);
> + g_free(buf);
> arginfo->handle_opt(argv[optind]);
> optind++;
> } else {
> --
> 1.9.1
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-10 8:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-10 8:10 [Qemu-devel] [PATCH v2] linux-user/main.c: Set environments variables from command line options gang.chen.5i5j
2015-09-10 8:28 ` Chen Gang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).