From: Paul Durrant Date: Mon, 1 Aug 2016 15:23:11 +0000 (+0100) Subject: xenagent: use new Start/StopShutdownWatch() functions in resume from suspend X-Git-Tag: 8.2.0-rc1~8 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8f18982f5d0ec85da530db2409a0c563c006dacf;p=pvdrivers%2Fwin%2Fxeniface.git xenagent: use new Start/StopShutdownWatch() functions in resume from suspend The patch removes some code duplication by using the StopShutdownwatch() and StartShutdownWatch() functions on resume from suspend rather than duplicating their content. Signed-off-by: Paul Durrant --- diff --git a/src/xenagent/service.cpp b/src/xenagent/service.cpp index d105bc4..170c2dd 100644 --- a/src/xenagent/service.cpp +++ b/src/xenagent/service.cpp @@ -552,17 +552,8 @@ void CXenAgent::OnSuspend() 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-poweroff", "1"); - m_device->StoreWrite("control/feature-reboot", "1"); - m_device->StoreWrite("control/feature-s3", "1"); - m_device->StoreWrite("control/feature-s4", "1"); - - + StopShutdownWatch(); + StartShutdownWatch(); SetXenTime(); }