From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1angFs-0001OK-9V for qemu-devel@nongnu.org; Wed, 06 Apr 2016 01:43:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1angFp-0002HR-UJ for qemu-devel@nongnu.org; Wed, 06 Apr 2016 01:43:52 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:37263 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1angFp-0002FQ-HM for qemu-devel@nongnu.org; Wed, 06 Apr 2016 01:43:49 -0400 From: "Denis V. Lunev" Date: Wed, 6 Apr 2016 08:43:31 +0300 Message-Id: <1459921411-20723-3-git-send-email-den@openvz.org> In-Reply-To: <1459921411-20723-1-git-send-email-den@openvz.org> References: <1459921411-20723-1-git-send-email-den@openvz.org> Subject: [Qemu-devel] [PATCH 2/2] qga: Workaround for console redirection from non-interactive qemu-ga service List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: den@openvz.org, Yuri Pudgorodskiy , Michael Roth From: Yuri Pudgorodskiy 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 Signed-off-by: Denis V. Lunev CC: Michael Roth --- qga/installer/qemu-ga.wxs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs index 7f92891..fa2260c 100644 --- a/qga/installer/qemu-ga.wxs +++ b/qga/installer/qemu-ga.wxs @@ -96,7 +96,7 @@ - + @@ -104,7 +104,7 @@ - + -- 2.1.4