aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-11-18 12:47:29 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-11-18 12:47:29 +0000
commitab9b872ab3147faf3c04e91d525815b9139dd996 (patch)
tree3a3cdfc02fb73263b85a62d2e9035872214831f7
parent6b79f253a37708f21e8d1cd2831b8d8c03f58989 (diff)
parentab59e3ecb2c12fafa89f7bedca7d329a078f3870 (diff)
Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2015-11-13-v2-tag' into staging
qemu-ga patch queue for 2.5 * fixes for guest-exec gspawn() usage: - inherit default lookup path by default instead of explicitly defining it as being empty. - don't inherit default PATH when PATH/ENV are explicit v2: * added fix for w32 'make install' target * added version check for new g_spawn() flag # gpg: Signature made Tue 17 Nov 2015 22:33:03 GMT using RSA key ID F108B584 # gpg: Good signature from "Michael Roth <flukshun@gmail.com>" # gpg: aka "Michael Roth <mdroth@utexas.edu>" # gpg: aka "Michael Roth <mdroth@linux.vnet.ibm.com>" * remotes/mdroth/tags/qga-pull-2015-11-13-v2-tag: makefile: fix w32 install target for qemu-ga qga: allow to lookup in PATH from the passed envp for guest-exec qga: fix for default env processing for guest-exec Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--Makefile5
-rw-r--r--qga/commands.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index fc1f8bb934..c7fa427e9e 100644
--- a/Makefile
+++ b/Makefile
@@ -440,7 +440,10 @@ endif
install: all $(if $(BUILD_DOCS),install-doc) \
install-datadir install-localstatedir
ifneq ($(TOOLS),)
- $(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
+ $(call install-prog,$(filter-out qemu-ga,$(TOOLS)),$(DESTDIR)$(bindir))
+ifneq (,$(findstring qemu-ga,$(TOOLS)))
+ $(call install-prog,qemu-ga$(EXESUF),$(DESTDIR)$(bindir))
+endif
endif
ifneq ($(CONFIG_MODULES),)
$(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
diff --git a/qga/commands.c b/qga/commands.c
index 0f80ce65a4..bb73e7dfbf 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -398,9 +398,12 @@ GuestExec *qmp_guest_exec(const char *path,
arglist.next = has_arg ? arg : NULL;
argv = guest_exec_get_args(&arglist, true);
- envp = guest_exec_get_args(has_env ? env : NULL, false);
+ envp = has_env ? guest_exec_get_args(env, false) : NULL;
flags = G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD;
+#if GLIB_CHECK_VERSION(2, 33, 2)
+ flags |= G_SPAWN_SEARCH_PATH_FROM_ENVP;
+#endif
if (!has_output) {
flags |= G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL;
}