summaryrefslogtreecommitdiff
path: root/vdservice
diff options
context:
space:
mode:
authorArnon Gilboa <agilboa@redhat.com>2012-09-10 10:59:14 +0300
committerArnon Gilboa <agilboa@redhat.com>2012-09-10 10:59:14 +0300
commit18f70a3376a1e4a8c0d0a164a21b0be97f4c355a (patch)
tree6c2777e3c77730d3f48c9b71cb72e2c29e15f60f /vdservice
parent900ef2b4db2cae9a7ee9f159af6d7bc602005be9 (diff)
vdservice: restart vdagent if killed manually
win7-only issue rhbz#845222
Diffstat (limited to 'vdservice')
-rw-r--r--vdservice/vdservice.cpp10
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 &&