]> xenbits.xensource.com Git - pvdrivers/win/xeniface.git/commitdiff
Recreate watch on resume from suspend
authorOwen Smith <owen.smith@citrix.com>
Mon, 18 Jul 2016 11:47:45 +0000 (12:47 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Mon, 18 Jul 2016 12:20:32 +0000 (13:20 +0100)
Watches are flagged as inactive on the resume from suspend,
and will only recieve the initial watch fire after a suspend.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
src/xenagent/service.cpp

index 2633809a27b097bd4e5823886eaca7cc73b4bb9d..55dc8cab9e6d655747be5f51ae8badabf811132d 100644 (file)
@@ -495,6 +495,12 @@ void CXenAgent::OnSuspend()
     CXenAgent::Log("OnSuspend(%ws)\n", m_device->Path());
     EventLog(EVENT_XENUSER_UNSUSPENDED);
 
+    // recreate shutdown watch, as suspending deactivated the watch
+    if (m_ctxt_shutdown)
+        m_device->StoreRemoveWatch(m_ctxt_shutdown);
+    m_ctxt_shutdown = NULL;
+
+    m_device->StoreAddWatch("control/shutdown", m_evt_shutdown, &m_ctxt_shutdown);
     m_device->StoreWrite("control/feature-shutdown", "1");
 
     SetXenTime();