[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/3] Prevent a xenagent timeout on S3/S4 transition.



Prevent a xenagent timeout (and live kernel dump) on S3/S4 transition by
changing CXenIfaceCreator::Log to use TryEnterCriticalSection.
Otherwise, a timeout occurs when the service control handler fails to
return due to attempting to enter a critical section object that the
main service thread already owns while responding to the
control/shutdown xenstore watch.

Signed-off-by: Troy Crosley <troycrosley@xxxxxxxxx>
---
 src/xenagent/service.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/xenagent/service.cpp b/src/xenagent/service.cpp
index 4d62e09..e595093 100644
--- a/src/xenagent/service.cpp
+++ b/src/xenagent/service.cpp
@@ -107,9 +107,9 @@ void CXenIfaceCreator::OnPowerEvent(DWORD evt, LPVOID data)
 void CXenIfaceCreator::Log(const char* message)
 {
     // if possible, send to xeniface to forward to logs
-    CCritSec crit(&m_crit);
-    if (m_device) {
+    if (TryEnterCriticalSection(&m_crit) && m_device) {
         m_device->Log(message);
+        LeaveCriticalSection(&m_crit);
     }
 }
 
-- 
2.20.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.