minor fixes for guest-exec
cover minor fixes for guest-exec
Yuri Pudgorodskiy (2):
[qga] Bugfix of default env processing for guest-exec. [qga] Enable lookup for the PATH from the passed envp for guest-exec.
qga/commands.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
PATCH 2/2 qga: allow to lookup in PATH from the passed envp for guest-exec
From: Yuri Pudgorodskiy <[email protected]>
This was original behaviour before GLIB gspawn() rework and we rely on this behaviour.
--- qga/commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
qga/commands.c +2 -1
@@ -400,7 +400,8 @@ GuestExec *qmp_guest_exec(const char *path, argv =guest_exec_get_args (&arglist, true); envp = has_env ?guest_exec_get_args (env, false) :NULL ; - flags =G_SPAWN_SEARCH_PATH |G_SPAWN_DO_NOT_REAP_CHILD ; + flags =G_SPAWN_SEARCH_PATH |G_SPAWN_SEARCH_PATH_FROM_ENVP | +G_SPAWN_DO_NOT_REAP_CHILD ;if (!has_output) { flags |=G_SPAWN_STDOUT_TO_DEV_NULL |G_SPAWN_STDERR_TO_DEV_NULL ; }
Signature · 1 line
2.1.4
PATCH 1/2 qga: fix for default env processing for guest-exec
In reply to Denis V. LunevFrom: Yuri Pudgorodskiy <[email protected]>
envp == NULL must be passed inside gspawn() if it was not passed with the command line. Original code inherits environment from the QGA, which is wrong.
--- qga/commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
qga/commands.c +1 -1
@@ -398,7 +398,7 @@ 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 (!has_output) {
Signature · 1 line
2.1.4
Michael Roth
AppliedQuoting Denis V. Lunev (2015-11-12 07:36:19)
Quoted 7 lines
Signed-off-by Yuri Pudgorodskiy <[email protected]>Signed-off-by Denis V. Lunev <[email protected]>CC Michael Roth <[email protected]>Yuri Pudgorodskiy (2):
[qga] Bugfix of default env processing for guest-exec. [qga] Enable lookup for the PATH from the passed envp for guest-exec.
Thanks, applied to qga tree and pull sent for 2.5:
https://github.com/mdroth/qemu/commits/qga
Confirmed on posix/w32 that we now properly inherit parent path by default, but don't use it if they're defined via user-specified env param.
Quoted 4 lines
qga/commands.c| 5 +++--1 file changed, 3 insertions(+), 2 deletions(-)