[Spice-devel] [PATCH spice-xpi] Add SPICE_XPI_DEBUG to not follow childs die and easier debugging

Hans de Goede hdegoede at redhat.com
Tue Jan 31 23:44:59 PST 2012


ACK.

On 01/31/2012 11:29 PM, Marc-André Lureau wrote:
> Spice XPI assumes that the client is the child PID, however for
> debugging reasons, it's useful to spawn the client as a sub process
> of the launched program. This allows clients such as:
>
>   #!/bin/sh
> exec gnome-terminal -e "gdb --args spicec --controller $@"
> ---
>   SpiceXPI/src/plugin/plugin.cpp |   10 ++++++----
>   1 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp
> index 816ac63..e982b17 100644
> --- a/SpiceXPI/src/plugin/plugin.cpp
> +++ b/SpiceXPI/src/plugin/plugin.cpp
> @@ -747,13 +747,15 @@ void nsPluginInstance::CallOnDisconnected(int code)
>   void nsPluginInstance::SigchldRoutine(int sig, siginfo_t *info, void *uap)
>   {
>       LOG_DEBUG("child finished, pid: "<<  info->si_pid);
> -
>       int exit_code;
>       waitpid(info->si_pid,&exit_code, 0);
>
> -    nsPluginInstance *fake_this = s_children[info->si_pid];
> -    fake_this->CallOnDisconnected(exit_code);
> -    fake_this->m_external_controller.Disconnect();
> +    if (!getenv("SPICE_XPI_DEBUG")) {
> +        nsPluginInstance *fake_this = s_children[info->si_pid];
> +        fake_this->CallOnDisconnected(exit_code);
> +        fake_this->m_external_controller.Disconnect();
> +    }
> +
>       s_children.erase(info->si_pid);
>   }
>


More information about the Spice-devel mailing list