Mark Wu has posted comments on this change. Change subject: Add more detailed memory statistics function to guest agent. ......................................................................
Patch Set 7: After checking the log file rhev-agent.log, I found the following python call trace. I did a little bit research about this problem. According to mdsn document, (http://msdn.microsoft.com/en-us/library/ms678543(VS.85).aspx), CoInitialize() should be called in multi-threading program. That can explain why I can run the separate python script(single thread), but failed to run it as a service(multi-threads). After adding a call pythoncom.CoInitialize(), it works as expected. Dummy-1::ERROR::2012-04-16 06:02:23,953::guestagentwin32::344::root::Error retrieving detailed memory stats Traceback (most recent call last): File "C:\Documents and Settings\Mark\agent\ovirt-guest-agent\GuestAgentWin32.py", line 333, in getMemoryStats objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator") File "C:\Python26\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx) File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 108, in _GetGoodDispatchAndUserName return (_GetGoodDispatch(IDispatch, clsctx), userName) File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 85, in _GetGoodDispatch IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch) com_error: (-2147221008, 'CoInitialize has not been called.', None, None) -- To view, visit http://gerrit.ovirt.org/2272 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic93b8717f99f033caf2b5dc2404a55f903bf4b0a Gerrit-PatchSet: 7 Gerrit-Project: ovirt-guest-agent Gerrit-Branch: master Gerrit-Owner: Mark Wu <wu...@linux.vnet.ibm.com> Gerrit-Reviewer: Adam Litke <a...@us.ibm.com> Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com> Gerrit-Reviewer: Gal Hammer <gham...@redhat.com> Gerrit-Reviewer: Mark Wu <wu...@linux.vnet.ibm.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches