summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}