All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Add new user mode option -ignore-environment
@ 2010-07-15 20:28 Stefan Weil
  2010-07-16  7:04 ` Markus Armbruster
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Weil @ 2010-07-15 20:28 UTC (permalink / raw)
  To: QEMU Developers

An empty environment is sometimes useful in user mode.
The new option provides it for linux-user and bsd-user
(darwin-user still has no environment related options).

The patch also adds the documentation for other
environment related options.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 bsd-user/main.c   |    6 ++++++
 linux-user/main.c |    6 ++++++
 qemu-doc.texi     |   14 ++++++++++++++
 3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/bsd-user/main.c b/bsd-user/main.c
index aff9f13..6b12f8b 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -795,6 +795,12 @@ int main(int argc, char **argv)
             r = argv[optind++];
             if (envlist_setenv(envlist, r) != 0)
                 usage();
+        } else if (!strcmp(r, "ignore-environment")) {
+            envlist_free(envlist);
+            if ((envlist = envlist_create()) == NULL) {
+                (void) fprintf(stderr, "Unable to allocate envlist\n");
+                exit(1);
+            }
         } else if (!strcmp(r, "U")) {
             r = argv[optind++];
             if (envlist_unsetenv(envlist, r) != 0)
diff --git a/linux-user/main.c b/linux-user/main.c
index 403c8d3..bf60922 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2759,6 +2759,12 @@ int main(int argc, char **argv, char **envp)
             r = argv[optind++];
             if (envlist_setenv(envlist, r) != 0)
                 usage();
+        } else if (!strcmp(r, "ignore-environment")) {
+            envlist_free(envlist);
+            if ((envlist = envlist_create()) == NULL) {
+                (void) fprintf(stderr, "Unable to allocate envlist\n");
+                exit(1);
+            }
         } else if (!strcmp(r, "U")) {
             r = argv[optind++];
             if (envlist_unsetenv(envlist, r) != 0)
diff --git a/qemu-doc.texi b/qemu-doc.texi
index e67bf44..ec7820e 100644
--- a/qemu-doc.texi
+++ b/qemu-doc.texi
@@ -2136,6 +2136,13 @@ Set the x86 elf interpreter prefix (default=/usr/local/qemu-i386)
 Set the x86 stack size in bytes (default=524288)
 @item -cpu model
 Select CPU model (-cpu ? for list and additional feature selection)
+@item -ignore-environment
+Start with an empty environment. Without this option,
+the inital environment is a copy of the caller's environment.
+@item -E @var{var}=@var{value}
+Set environment @var{var} to @var{value}.
+@item -U @var{var}
+Remove @var{var} from the environment.
 @item -B offset
 Offset guest address by the specified number of bytes.  This is useful when
 the address region required by guest applications is reserved on the host.
@@ -2359,6 +2366,13 @@ Print the help
 Set the library root path (default=/)
 @item -s size
 Set the stack size in bytes (default=524288)
+@item -ignore-environment
+Start with an empty environment. Without this option,
+the inital environment is a copy of the caller's environment.
+@item -E @var{var}=@var{value}
+Set environment @var{var} to @var{value}.
+@item -U @var{var}
+Remove @var{var} from the environment.
 @item -bsd type
 Set the type of the emulated BSD Operating system. Valid values are
 FreeBSD, NetBSD and OpenBSD (default).
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] Add new user mode option -ignore-environment
  2010-07-15 20:28 [Qemu-devel] [PATCH] Add new user mode option -ignore-environment Stefan Weil
@ 2010-07-16  7:04 ` Markus Armbruster
  2010-07-16 13:09   ` Stefan Weil
  2010-09-09 17:30   ` Stefan Weil
  0 siblings, 2 replies; 13+ messages in thread
From: Markus Armbruster @ 2010-07-16  7:04 UTC (permalink / raw)
  To: Stefan Weil; +Cc: QEMU Developers

Stefan Weil <weil@mail.berlios.de> writes:

> An empty environment is sometimes useful in user mode.
> The new option provides it for linux-user and bsd-user
> (darwin-user still has no environment related options).

Stupid question: why is /usr/bin/env insufficient?

[...]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] Add new user mode option -ignore-environment
  2010-07-16  7:04 ` Markus Armbruster
@ 2010-07-16 13:09   ` Stefan Weil
  2010-08-01 11:48     ` Stefan Weil
  2010-09-09 17:30   ` Stefan Weil
  1 sibling, 1 reply; 13+ messages in thread
From: Stefan Weil @ 2010-07-16 13:09 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: QEMU Developers

Am 16.07.2010 09:04, schrieb Markus Armbruster:
> Stefan Weil<weil@mail.berlios.de>  writes:
>
>    
>> An empty environment is sometimes useful in user mode.
>> The new option provides it for linux-user and bsd-user
>> (darwin-user still has no environment related options).
>>      
> Stupid question: why is /usr/bin/env insufficient?
>
> [...]
>
>    

In most cases it is sufficient (but not always available - Windows...).
The options -U and -E are also redundant and can be replaced by
/usr/bin/env.

But -U and -E exist, so completing the set of environment related
options seems to be logical. The name of the new option was
inspired by /usr/bin/env!

And finally, there is a use case where /usr/bin/env is a bad choice:
just look for "getenv" and you will find one in linux-user/main.c.
Removing the environment via /usr/bin/env will also remove
environment variables which are read by qemu's runtime code.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] Add new user mode option -ignore-environment
  2010-07-16 13:09   ` Stefan Weil
@ 2010-08-01 11:48     ` Stefan Weil
  2010-08-11  8:45       ` Stefan Weil
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Weil @ 2010-08-01 11:48 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Markus Armbruster

Am 16.07.2010 15:09, schrieb Stefan Weil:
> Am 16.07.2010 09:04, schrieb Markus Armbruster:
>> Stefan Weil<weil@mail.berlios.de>  writes:
>>
>>> An empty environment is sometimes useful in user mode.
>>> The new option provides it for linux-user and bsd-user
>>> (darwin-user still has no environment related options).
>> Stupid question: why is /usr/bin/env insufficient?
>>
>> [...]
>>
>
> In most cases it is sufficient (but not always available - Windows...).
> The options -U and -E are also redundant and can be replaced by
> /usr/bin/env.
>
> But -U and -E exist, so completing the set of environment related
> options seems to be logical. The name of the new option was
> inspired by /usr/bin/env!
>
> And finally, there is a use case where /usr/bin/env is a bad choice:
> just look for "getenv" and you will find one in linux-user/main.c.
> Removing the environment via /usr/bin/env will also remove
> environment variables which are read by qemu's runtime code.


Is there any more feedback on this patch?
Or can it be commited to git master?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] Add new user mode option -ignore-environment
  2010-08-01 11:48     ` Stefan Weil
@ 2010-08-11  8:45       ` Stefan Weil
  0 siblings, 0 replies; 13+ messages in thread
From: Stefan Weil @ 2010-08-11  8:45 UTC (permalink / raw)
  To: QEMU Developers

Am 01.08.2010 13:48, schrieb Stefan Weil:
> Am 16.07.2010 15:09, schrieb Stefan Weil:
>> Am 16.07.2010 09:04, schrieb Markus Armbruster:
>>> Stefan Weil<weil@mail.berlios.de>  writes:
>>>
>>>> An empty environment is sometimes useful in user mode.
>>>> The new option provides it for linux-user and bsd-user
>>>> (darwin-user still has no environment related options).
>>> Stupid question: why is /usr/bin/env insufficient?
>>>
>>> [...]
>>>
>>
>> In most cases it is sufficient (but not always available - Windows...).
>> The options -U and -E are also redundant and can be replaced by
>> /usr/bin/env.
>>
>> But -U and -E exist, so completing the set of environment related
>> options seems to be logical. The name of the new option was
>> inspired by /usr/bin/env!
>>
>> And finally, there is a use case where /usr/bin/env is a bad choice:
>> just look for "getenv" and you will find one in linux-user/main.c.
>> Removing the environment via /usr/bin/env will also remove
>> environment variables which are read by qemu's runtime code.
>
>
> Is there any more feedback on this patch?
> Or can it be commited to git master?


Ping? The patch is still missing.

Regards,
Stefan

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] Add new user mode option -ignore-environment
  2010-07-16  7:04 ` Markus Armbruster
  2010-07-16 13:09   ` Stefan Weil
@ 2010-09-09 17:30   ` Stefan Weil
  2010-09-09 17:34     ` Anthony Liguori
  2010-09-10  8:26     ` [Qemu-devel] [PATCH] Add new user mode option -ignore-environment Markus Armbruster
  1 sibling, 2 replies; 13+ messages in thread
From: Stefan Weil @ 2010-09-09 17:30 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: Anthony Liguori, QEMU Developers

Am 16.07.2010 09:04, schrieb Markus Armbruster:
> Stefan Weil<weil@mail.berlios.de>  writes:
>
>    
>> An empty environment is sometimes useful in user mode.
>> The new option provides it for linux-user and bsd-user
>> (darwin-user still has no environment related options).
>>      
> Stupid question: why is /usr/bin/env insufficient?
>
> [...]
>    

Hi Markus,

was your question answered (and can Antony commit this change to QEMU 
master)?

Regards
Stefan

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] Add new user mode option -ignore-environment
  2010-09-09 17:30   ` Stefan Weil
@ 2010-09-09 17:34     ` Anthony Liguori
  2010-09-09 19:32       ` [Qemu-devel] [PATCH] MAINTAINERS: Add new maintainer for Linux user Stefan Weil
  2010-09-10  8:26     ` [Qemu-devel] [PATCH] Add new user mode option -ignore-environment Markus Armbruster
  1 sibling, 1 reply; 13+ messages in thread
From: Anthony Liguori @ 2010-09-09 17:34 UTC (permalink / raw)
  To: Stefan Weil
  Cc: Anthony Liguori, Riku Voipio, Markus Armbruster, QEMU Developers

On 09/09/2010 12:30 PM, Stefan Weil wrote:
> Am 16.07.2010 09:04, schrieb Markus Armbruster:
>> Stefan Weil<weil@mail.berlios.de>  writes:
>>
>>> An empty environment is sometimes useful in user mode.
>>> The new option provides it for linux-user and bsd-user
>>> (darwin-user still has no environment related options).
>> Stupid question: why is /usr/bin/env insufficient?
>>
>> [...]
>
> Hi Markus,
>
> was your question answered (and can Antony commit this change to QEMU 
> master)?

Riku is the linux-user maintainer so it really ought to go through his tree.

Regards,

Anthony Liguori

> Regards
> Stefan
>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH] MAINTAINERS: Add new maintainer for Linux user
  2010-09-09 17:34     ` Anthony Liguori
@ 2010-09-09 19:32       ` Stefan Weil
  2010-09-09 19:43         ` Andreas Färber
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Weil @ 2010-09-09 19:32 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Antony Liguori, Riku Voipio

According to Antony, Riku is the maintainer for Linux user,
so make this visible for everyone.

(The patch also fixes a whitespace issue at end of line -
required by git and by my editor).

Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Antony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 MAINTAINERS |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index e5165fb..63deb87 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -68,7 +68,7 @@ S390
   s390-*.c                Alexander Graf
 
 Generic Subsystems:
--------------------  
+-------------------
 
 Dynamic translator        Fabrice Bellard
 Main loop                 Fabrice Bellard (new maintainer needed)
@@ -83,6 +83,6 @@ Audio device layer        Vassili Karpov (malc)
 Character device layer    ?
 Network device layer      ?
 GDB stub                  ?
-Linux user                ?
+Linux user                Riku Voipio
 Darwin user               ?
 SLIRP                     ?
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] MAINTAINERS: Add new maintainer for Linux user
  2010-09-09 19:32       ` [Qemu-devel] [PATCH] MAINTAINERS: Add new maintainer for Linux user Stefan Weil
@ 2010-09-09 19:43         ` Andreas Färber
  2010-09-09 19:48           ` Stefan Weil
  0 siblings, 1 reply; 13+ messages in thread
From: Andreas Färber @ 2010-09-09 19:43 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Anthony Liguori, Riku Voipio, QEMU Developers

Am 09.09.2010 um 21:32 schrieb Stefan Weil:

> According to Antony, Riku is the maintainer for Linux user,
> so make this visible for everyone.

You beat me! :)

Acked-by: Andreas Färber <andreas.faerber@web.de>

Andreas

> (The patch also fixes a whitespace issue at end of line -
> required by git and by my editor).
>
> Cc: Riku Voipio <riku.voipio@iki.fi>
> Cc: Antony Liguori <aliguori@us.ibm.com>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>

P.S. It's Anthony.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] MAINTAINERS: Add new maintainer for Linux user
  2010-09-09 19:43         ` Andreas Färber
@ 2010-09-09 19:48           ` Stefan Weil
  2010-09-09 19:50             ` Stefan Weil
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Weil @ 2010-09-09 19:48 UTC (permalink / raw)
  To: Andreas Färber; +Cc: Anthony Liguori, QEMU Developers

Am 09.09.2010 21:43, schrieb Andreas Färber:
> Am 09.09.2010 um 21:32 schrieb Stefan Weil:
>
>> According to Antony, Riku is the maintainer for Linux user,
>> so make this visible for everyone.
>
> You beat me! :)
>
> Acked-by: Andreas Färber <andreas.faerber@web.de>
>
> Andreas
>
>> (The patch also fixes a whitespace issue at end of line -
>> required by git and by my editor).
>>
>> Cc: Riku Voipio <riku.voipio@iki.fi>
>> Cc: Antony Liguori <aliguori@us.ibm.com>
>> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
>
> P.S. It's Anthony.


Sorry, Anthony. Thanks, Andreas, for the hint.
I'll sent a new patch which corrects this important issue.

Stefan

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Qemu-devel] [PATCH] MAINTAINERS: Add new maintainer for Linux user
  2010-09-09 19:48           ` Stefan Weil
@ 2010-09-09 19:50             ` Stefan Weil
  2010-09-09 19:55               ` Anthony Liguori
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Weil @ 2010-09-09 19:50 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Anthony Liguori, Riku Voipio

According to Anthony, Riku is the maintainer for Linux user,
so make this visible for everyone.

(The patch also fixes a whitespace issue at end of line -
required by git and by my editor).

Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 MAINTAINERS |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index e5165fb..63deb87 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -68,7 +68,7 @@ S390
   s390-*.c                Alexander Graf
 
 Generic Subsystems:
--------------------  
+-------------------
 
 Dynamic translator        Fabrice Bellard
 Main loop                 Fabrice Bellard (new maintainer needed)
@@ -83,6 +83,6 @@ Audio device layer        Vassili Karpov (malc)
 Character device layer    ?
 Network device layer      ?
 GDB stub                  ?
-Linux user                ?
+Linux user                Riku Voipio
 Darwin user               ?
 SLIRP                     ?
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] MAINTAINERS: Add new maintainer for Linux user
  2010-09-09 19:50             ` Stefan Weil
@ 2010-09-09 19:55               ` Anthony Liguori
  0 siblings, 0 replies; 13+ messages in thread
From: Anthony Liguori @ 2010-09-09 19:55 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Riku Voipio, QEMU Developers

On 09/09/2010 02:50 PM, Stefan Weil wrote:
> According to Anthony, Riku is the maintainer for Linux user,
> so make this visible for everyone.
>
> (The patch also fixes a whitespace issue at end of line -
> required by git and by my editor).
>
> Cc: Riku Voipio<riku.voipio@iki.fi>
> Cc: Anthony Liguori<aliguori@us.ibm.com>
> Signed-off-by: Stefan Weil<weil@mail.berlios.de>
>    

I've got mixed feelings about it, but let me take a stab at doing a more 
thorough update to MAINTAINERS.  Comments appreciated.

Regards,

Anthony Liguori

> ---
>   MAINTAINERS |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index e5165fb..63deb87 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -68,7 +68,7 @@ S390
>     s390-*.c                Alexander Graf
>
>   Generic Subsystems:
> --------------------
> +-------------------
>
>   Dynamic translator        Fabrice Bellard
>   Main loop                 Fabrice Bellard (new maintainer needed)
> @@ -83,6 +83,6 @@ Audio device layer        Vassili Karpov (malc)
>   Character device layer    ?
>   Network device layer      ?
>   GDB stub                  ?
> -Linux user                ?
> +Linux user                Riku Voipio
>   Darwin user               ?
>   SLIRP                     ?
>    

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Qemu-devel] [PATCH] Add new user mode option -ignore-environment
  2010-09-09 17:30   ` Stefan Weil
  2010-09-09 17:34     ` Anthony Liguori
@ 2010-09-10  8:26     ` Markus Armbruster
  1 sibling, 0 replies; 13+ messages in thread
From: Markus Armbruster @ 2010-09-10  8:26 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Anthony Liguori, QEMU Developers

Stefan Weil <weil@mail.berlios.de> writes:

> Am 16.07.2010 09:04, schrieb Markus Armbruster:
>> Stefan Weil<weil@mail.berlios.de>  writes:
>>
>>    
>>> An empty environment is sometimes useful in user mode.
>>> The new option provides it for linux-user and bsd-user
>>> (darwin-user still has no environment related options).
>>>      
>> Stupid question: why is /usr/bin/env insufficient?
>>
>> [...]
>>    
>
> Hi Markus,
>
> was your question answered (and can Antony commit this change to QEMU
> master)?

I don't mind.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-09-10  8:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-15 20:28 [Qemu-devel] [PATCH] Add new user mode option -ignore-environment Stefan Weil
2010-07-16  7:04 ` Markus Armbruster
2010-07-16 13:09   ` Stefan Weil
2010-08-01 11:48     ` Stefan Weil
2010-08-11  8:45       ` Stefan Weil
2010-09-09 17:30   ` Stefan Weil
2010-09-09 17:34     ` Anthony Liguori
2010-09-09 19:32       ` [Qemu-devel] [PATCH] MAINTAINERS: Add new maintainer for Linux user Stefan Weil
2010-09-09 19:43         ` Andreas Färber
2010-09-09 19:48           ` Stefan Weil
2010-09-09 19:50             ` Stefan Weil
2010-09-09 19:55               ` Anthony Liguori
2010-09-10  8:26     ` [Qemu-devel] [PATCH] Add new user mode option -ignore-environment Markus Armbruster

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.