Re: [PATCH 1/3] vdservice: restart vdagent if killed manually

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

 



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.
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]