qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: QEMU Developers <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] Add new user mode option -ignore-environment
Date: Thu, 15 Jul 2010 22:28:37 +0200	[thread overview]
Message-ID: <1279225717-7309-1-git-send-email-weil@mail.berlios.de> (raw)

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

             reply	other threads:[~2010-07-15 20:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-15 20:28 Stefan Weil [this message]
2010-07-16  7:04 ` [Qemu-devel] [PATCH] Add new user mode option -ignore-environment 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1279225717-7309-1-git-send-email-weil@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).