]> xenbits.xensource.com Git - pvdrivers/win/xeniface.git/commitdiff
[CA-119964] Do not fail when WMI Remove does not provide a respose object
authorBen Chalmers <Ben.Chalmers@citrix.com>
Thu, 2 Jan 2014 09:27:40 +0000 (09:27 +0000)
committerBen Chalmers <Ben.Chalmers@citrix.com>
Thu, 2 Jan 2014 09:29:54 +0000 (09:29 +0000)
This is the expected behavior - it never provides a response object

(Also add some additional logging to help spot reasons for failure)

Signed-off-by: Ben Chalmers <Ben.Chalmers@citrix.com>
src/win32stubagent/WmiAccessor.cpp
src/win32stubagent/XService.cpp

index 2d5a1037dcd38d5e4f9c9cf892a7b19a98a2c8ae..e69a875cae5f0104770c51793651deb050171723 100644 (file)
@@ -1143,20 +1143,26 @@ int WmiSessionRemoveEntry(WMIAccessor** wmi,  void **sessionhandle,
     if (FAILED(methodExec(wmi,*session, L"RemoveValue", inMethodInst, &outMethodInst)))
         goto methodexecfailed;
 
-    if (outMethodInst==NULL)
-        goto sessionExec;
     outMethodInst->Release();
 
     err=0;
+    inMethodInst->Release();
+    VariantClear(&vpath);
+    return err;
 methodexecfailed:
+    OutputDebugString(__FUNCTION__ " MethodExecFailed");
 methodputfailed:
+    OutputDebugString(__FUNCTION__ " MethodPutFailed");
     inMethodInst->Release();
 
 sessionstart:
+    OutputDebugString(__FUNCTION__ " SessionStartFailed");
     VariantClear(&vpath);
 
 sessionExec:
+    OutputDebugString(__FUNCTION__ " SessionExecFailed");
 setvpath:
+    OutputDebugString(__FUNCTION__ " SetVpathFailed");
     return err; 
 }
 
index 44931a916c5552ae23fbed23d91d4a82bfeae55e..646563d822e93ac7d0141273e1433c27e9cb5ccd 100644 (file)
@@ -85,6 +85,7 @@ void PrintError(const char *func, DWORD err)
         0,
         NULL);
     OutputDebugString((LPTSTR)lpMsgBuf);
+    XsLog("%s failed: %s (%x)", func, lpMsgBuf, err);
     XenstorePrintf("control/error", "%s failed: %s (%x)", func, lpMsgBuf, err);
     LocalFree(lpMsgBuf);
 }
@@ -695,8 +696,8 @@ BOOL Run()
                 }
                 if (fail) {
                     XsLog("Resetting");
-                ReportEvent(eventLog, EVENTLOG_SUCCESS, 0, EVENT_XENUSER_UNEXPECTED, NULL, 0, 0,
-                            NULL, NULL);
+                    ReportEvent(eventLog, EVENTLOG_SUCCESS, 0, EVENT_XENUSER_UNEXPECTED, NULL, 0, 0,
+                                NULL, NULL);
                     break;
                 }
             }