]> git.proxmox.com Git - mirror_qemu.git/commit
qga: Workaround for console redirection from non-interactive qemu-ga service
authorYuri Pudgorodskiy <yur@virtuozzo.com>
Wed, 6 Apr 2016 05:43:31 +0000 (08:43 +0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 7 Apr 2016 16:43:54 +0000 (11:43 -0500)
commit27559c214d9a16d0ef6164d0c3f6fb45833ba2f9
treedd981ebbc3863ec7ac80b65d08a5c87f5529028f
parent3005c2c2fa2875a3413af97e9db368856d3330fd
qga: Workaround for console redirection from non-interactive qemu-ga service

mingw-glib uses helper process to assist gspawn() api. There are two
versions of helpers, one with main() and another with WinMain() startup
routines.

Whenever gspawn() detects consoleless environment (and qemu-ga is running
in such environment as Win32 service), it chooses helper with main()
instead of WinMain. It is done by name, e.g.
gspawn-win32-helper-console.exe vs gspawn-win32-helper.exe

Running console-aware application like any win32 console apps from main()
crt initalized process results in redirection of stdout to console created
in crt startup instead of parent-provided handle connected to subprocess
pipe. Thus, stdout/stderr redirection do not work correctly.

The patch makes WinMain()'s version of helper be used as the only helper
shipped with qemu-ga package. Using only win32 helper ensures console
is created before any redirection and fixes stdout/stderr redirection
issue.

Signed-off-by: Yuri Pudgorodskiy <yur@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qga/installer/qemu-ga.wxs