From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIsWa-0001rZ-9o for qemu-devel@nongnu.org; Tue, 12 Jan 2016 01:33:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIsWX-0003i6-3T for qemu-devel@nongnu.org; Tue, 12 Jan 2016 01:33:48 -0500 Received: from relay.parallels.com ([195.214.232.42]:38386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIsWW-0003hy-SX for qemu-devel@nongnu.org; Tue, 12 Jan 2016 01:33:45 -0500 References: <1452081699-11894-1-git-send-email-den@openvz.org> <1452081699-11894-2-git-send-email-den@openvz.org> <568D1B95.3080702@openvz.org> <56939B4F.8050407@virtuozzo.com> From: "Denis V. Lunev" Message-ID: <56949E3B.4030706@openvz.org> Date: Tue, 12 Jan 2016 09:33:31 +0300 MIME-Version: 1.0 In-Reply-To: <56939B4F.8050407@virtuozzo.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] create ga_run_program() helper for guest-set-user-password List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yuriy Pudgorodskiy Cc: qemu-devel@nongnu.org, Michael Roth On 01/11/2016 03:08 PM, Yuriy Pudgorodskiy wrote: > On 1/6/2016 4:50 PM, Denis V. Lunev wrote: >> hmmm.... >> >> Yur, >> >> it seems that you have re-invented the wheel with >> >> gboolean >> >> g_spawn_sync (/|const gchar >> >> *working_directory|/, >> /|gchar >> >> **argv|/, >> /|gchar >> >> **envp|/, >> /|GSpawnFlags >> >> flags|/, >> /|GSpawnChildSetupFunc >> >> child_setup|/, >> /|gpointer >> >> user_data|/, >> /|gchar >> >> **standard_output|/, >> /|gchar >> >> **standard_error|/, >> /|gint >> >> *exit_status|/, >> /|GError >> >> **error|/); >> >> > > Not exactly. > > g_spawn_sync() wrapper cannot be used directly instead of my wrapper, > because it does not support redirected stdin which is required to send > data to chpasswd. > g_spawn_async_with_pipes() can be used (with stdin), but it will not > make code simpler. > > Most of command-posix.c calls fork/execv directly, and so does the > wrapper I wrote. > > this seems that you are right :) Then nothing needs to be changed and patches are OK. Den