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>
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();