[Spice-devel] [PATCH 1/3] vdservice: restart vdagent if killed manually

Uri Lublin uril at redhat.com
Sun Sep 23 07:51:20 PDT 2012


On 09/16/2012 11:50 AM, Arnon Gilboa wrote:
> win7-only issue
>
> rhbz#845222
> ---
>   vdservice/vdservice.cpp |   10 ++++++++++
>   1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/vdservice/vdservice.cpp b/vdservice/vdservice.cpp
> index 696f3da..b48cbeb 100644
> --- a/vdservice/vdservice.cpp
> +++ b/vdservice/vdservice.cpp
> @@ -590,6 +590,16 @@ bool VDService::execute()
>                           restart_agent(false);
>                       } else if (_system_version == SYS_VER_WIN_7_CLASS) {
>                           kill_agent();
> +                        // Assume agent was killed due to console disconnect, and wait for agent
> +                        // normal restart due to console connect. If the agent is not alive yet,
> +                        // it was killed manually (or crashed), so let's restart it.
> +                        if (WaitForSingleObject(_control_event, VD_AGENT_RESTART_INTERVAL) ==
> +                                WAIT_OBJECT_0) {
> +                            handle_control_event();
> +                        }
> +                        if (_running&&  !_agent_alive) {
> +                            restart_agent(false);
> +                        }
>                       }
>                   } else {
>                       if (wait_ret>= WAIT_OBJECT_0 + _events_vdi_port_base&&

Ack.


More information about the Spice-devel mailing list