qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] create ga_run_program() helper for guest-se


From: Denis V. Lunev
Subject: Re: [Qemu-devel] [PATCH 1/2] create ga_run_program() helper for guest-set-user-password
Date: Tue, 12 Jan 2016 09:33:31 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

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 <https://developer.gnome.org/glib/stable/glib-Basic-Types.html#gboolean> g_spawn_sync (/|const gchar <https://developer.gnome.org/glib/stable/glib-Basic-Types.html#gchar> *working_directory|/, /|gchar <https://developer.gnome.org/glib/stable/glib-Basic-Types.html#gchar> **argv|/, /|gchar <https://developer.gnome.org/glib/stable/glib-Basic-Types.html#gchar> **envp|/, /|GSpawnFlags <https://developer.gnome.org/glib/stable/glib-Spawning-Processes.html#GSpawnFlags> flags|/, /|GSpawnChildSetupFunc <https://developer.gnome.org/glib/stable/glib-Spawning-Processes.html#GSpawnChildSetupFunc> child_setup|/, /|gpointer <https://developer.gnome.org/glib/stable/glib-Basic-Types.html#gpointer> user_data|/, /|gchar <https://developer.gnome.org/glib/stable/glib-Basic-Types.html#gchar> **standard_output|/, /|gchar <https://developer.gnome.org/glib/stable/glib-Basic-Types.html#gchar> **standard_error|/, /|gint <https://developer.gnome.org/glib/stable/glib-Basic-Types.html#gint> *exit_status|/, /|GError <https://developer.gnome.org/glib/stable/glib-Error-Reporting.html#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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]