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

[win-pv-devel] [PATCH] Dont force a WMI event when reregistering a watch



When a watch is registered, the watch gets triggered. This will result
in a WMI event being fired. There is no need to manually fire a WMI
event in this case, as it can lead to the WMI event being discarded.

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/xeniface/wmi.c | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/src/xeniface/wmi.c b/src/xeniface/wmi.c
index c73e990..b3e4c55 100644
--- a/src/xeniface/wmi.c
+++ b/src/xeniface/wmi.c
@@ -875,19 +875,15 @@ VOID WatchCallbackThread(__in PVOID StartContext) {
                 ExFreePool(watch);
                 session->mapchanged = TRUE;
                 session->watchcount --;
-            }
-            else
-            {
-                if (!session->suspended) {
-                    if (watch->suspendcount !=XENBUS_SUSPEND(GetCount, 
&watch->fdoData->SuspendInterface)) {
-                        watch->suspendcount = XENBUS_SUSPEND(GetCount, 
&watch->fdoData->SuspendInterface);
-                        
XenIfaceDebugPrint(WARNING,"SessionSuspendResumeUnwatch %p\n", 
watch->watchhandle);
-
-                        XENBUS_STORE(WatchRemove, 
&watch->fdoData->StoreInterface, watch->watchhandle);
-                        watch->watchhandle = NULL;
-                        StartWatch(watch->fdoData, watch);
-                    }
-                }
+            } else if (!session->suspended &&
+                       watch->suspendcount != XENBUS_SUSPEND(GetCount, 
&watch->fdoData->SuspendInterface)) {
+                watch->suspendcount = XENBUS_SUSPEND(GetCount, 
&watch->fdoData->SuspendInterface);
+                XenIfaceDebugPrint(WARNING,"SessionSuspendResumeUnwatch %p\n", 
watch->watchhandle);
+
+                XENBUS_STORE(WatchRemove, &watch->fdoData->StoreInterface, 
watch->watchhandle);
+                watch->watchhandle = NULL;
+                StartWatch(watch->fdoData, watch);
+            } else {
                 FireWatch(watch);
             }
             ExReleaseFastMutex(&session->WatchMapLock);
-- 
1.9.4.msysgit.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


 


Rackspace

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