[libvirt] [PATCH v1 2/2] command: Change virCommandAddEnv so it replaces existing environment variables.

Eric Blake eblake at redhat.com
Mon Sep 24 22:55:58 UTC 2012


On 09/24/2012 12:54 PM, Richard W.M. Jones wrote:
> From: "Richard W.M. Jones" <rjones at redhat.com>
> 
> ---
>  src/util/command.c |   17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 

Any new feature deserves tests; I'm pushing this under the trivial rule.


diff --git c/tests/commandtest.c w/tests/commandtest.c
index 930df5c..cba6cb6 100644
--- c/tests/commandtest.c
+++ w/tests/commandtest.c
@@ -331,7 +331,9 @@ static int test8(const void *unused ATTRIBUTE_UNUSED)
 {
     virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper");

+    virCommandAddEnvString(cmd, "USER=bogus");
     virCommandAddEnvString(cmd, "LANG=C");
+    virCommandAddEnvPair(cmd, "USER", "also bogus");
     virCommandAddEnvPair(cmd, "USER", "test");

     if (virCommandRun(cmd, NULL) < 0) {

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120924/0d6dd0f7/attachment-0001.sig>


More information about the libvir-list mailing list