[Spice-devel] [vdagent-win PATCH 1/2] vdagent: add support for VD_AGENT_CLIENT_DISCONNECTED

Arnon Gilboa agilboa at redhat.com
Wed May 8 08:01:33 PDT 2013


vdagent is stopped, so a new instance is to be launched by vdservice.
imho, this seems simpler than cleaning agent in/out msg state and
reseting the vio-serial device to cleanup pending msgs.

rhbz #956133
---
 vdagent/vdagent.cpp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
index 118cafd..1fad0e6 100644
--- a/vdagent/vdagent.cpp
+++ b/vdagent/vdagent.cpp
@@ -1226,6 +1226,10 @@ void VDAgent::dispatch_message(VDAgentMessage* msg, uint32_t port)
     case VD_AGENT_ANNOUNCE_CAPABILITIES:
         res = a->handle_announce_capabilities((VDAgentAnnounceCapabilities*)msg->data, msg->size);
         break;
+    case VD_AGENT_CLIENT_DISCONNECTED:
+        vd_printf("Client disconnected, agent to be restarted");
+        a->set_control_event(CONTROL_STOP);
+        break;
     default:
         vd_printf("Unsupported message type %u size %u", msg->type, msg->size);
     }
-- 
1.7.7.6



More information about the Spice-devel mailing list