Changeset 28343 in vbox for trunk/src/VBox/Main
- Timestamp:
- Apr 15, 2010 2:47:36 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60102
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r28304 r28343 4968 4968 } 4969 4969 4970 STDMETHODIMP Machine::QueryLogFilename(ULONG aIdx, BSTR *aName) 4971 { 4972 CheckComArgOutPointerValid(aName); 4973 4974 AutoCaller autoCaller(this); 4975 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 4976 4977 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 4978 4979 Utf8Str log = queryLogFilename(aIdx); 4980 if (RTFileExists(log.c_str())) 4981 log.cloneTo(aName); 4982 4983 return S_OK; 4984 } 4985 4970 4986 STDMETHODIMP Machine::ReadLog(ULONG aIdx, ULONG64 aOffset, ULONG64 aSize, ComSafeArrayOut(BYTE, aData)) 4971 4987 { … … 4979 4995 4980 4996 HRESULT rc = S_OK; 4981 Utf8Str logFolder; 4982 getLogFolder(logFolder); 4983 Assert(logFolder.length()); 4984 ULONG uLogHistoryCount = 3; 4985 ComPtr<ISystemProperties> systemProperties; 4986 mParent->COMGETTER(SystemProperties)(systemProperties.asOutParam()); 4987 if (!systemProperties.isNull()) 4988 systemProperties->COMGETTER(LogHistoryCount)(&uLogHistoryCount); 4989 Utf8Str log; 4990 if (aIdx == 0) 4991 log = Utf8StrFmt("%s%cVBox.log", 4992 logFolder.raw(), RTPATH_DELIMITER); 4993 else 4994 log = Utf8StrFmt("%s%cVBox.log.%d", 4995 logFolder.raw(), RTPATH_DELIMITER, aIdx); 4997 Utf8Str log = queryLogFilename(aIdx); 4996 4998 4997 4999 /* do not unnecessarily hold the lock while doing something which does … … 5150 5152 RTPATH_DELIMITER); 5151 5153 } 5154 } 5155 5156 /** 5157 * Returns the full path to the machine's log file for an given index. 5158 */ 5159 Utf8Str Machine::queryLogFilename(ULONG idx) 5160 { 5161 Utf8Str logFolder; 5162 getLogFolder(logFolder); 5163 Assert(logFolder.length()); 5164 Utf8Str log; 5165 if (idx == 0) 5166 log = Utf8StrFmt("%s%cVBox.log", 5167 logFolder.raw(), RTPATH_DELIMITER); 5168 else 5169 log = Utf8StrFmt("%s%cVBox.log.%d", 5170 logFolder.raw(), RTPATH_DELIMITER, idx); 5171 return log; 5152 5172 } 5153 5173 … … 8755 8775 * @note Not thread safe (must be called from this object's lock). 8756 8776 */ 8757 bool Machine::isInOwnDir(Utf8Str *aSettingsDir /* = NULL */) 8777 bool Machine::isInOwnDir(Utf8Str *aSettingsDir /* = NULL */) const 8758 8778 { 8759 8779 Utf8Str settingsDir = mData->m_strConfigFileFull; -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r28290 r28343 4144 4144 <interface 4145 4145 name="IMachine" extends="$unknown" 4146 uuid=" 21f56f5d-d0fc-49e5-9ea7-91639278f424"4146 uuid="fe51e0c8-7e48-4847-95f0-fc8532f3b480" 4147 4147 wsmap="managed" 4148 4148 > … … 6003 6003 </method> 6004 6004 6005 <method name="queryLogFilename"> 6006 <desc> 6007 Queries for the VM log file name of an given index. Returns an empty 6008 string if a log file with that index doesn't exists. 6009 </desc> 6010 <param name="idx" type="unsigned long" dir="in"> 6011 <desc> 6012 Which log file name to query. 0=current log file. 6013 </desc> 6014 </param> 6015 <param name="filename" type="wstring" dir="return"> 6016 <desc> 6017 On return the full path to the log file or an empty string on error. 6018 </desc> 6019 </param> 6020 </method> 6021 6005 6022 <method name="readLog"> 6006 6023 <desc> -
trunk/src/VBox/Main/include/MachineImpl.h
r28149 r28343 518 518 STDMETHOD(HotUnplugCPU(ULONG aCpu)); 519 519 STDMETHOD(GetCPUStatus(ULONG aCpu, BOOL *aCpuAttached)); 520 STDMETHOD(QueryLogFilename(ULONG aIdx, BSTR *aName)); 520 521 STDMETHOD(ReadLog(ULONG aIdx, ULONG64 aOffset, ULONG64 aSize, ComSafeArrayOut(BYTE, aData))); 521 522 … … 628 629 629 630 void getLogFolder(Utf8Str &aLogFolder); 631 Utf8Str queryLogFilename(ULONG idx); 630 632 631 633 HRESULT openSession(IInternalSessionControl *aControl); … … 786 788 void rollbackMedia(); 787 789 788 bool isInOwnDir(Utf8Str *aSettingsDir = NULL) ;790 bool isInOwnDir(Utf8Str *aSettingsDir = NULL) const; 789 791 790 792 void rollback(bool aNotify);
Note:
See TracChangeset
for help on using the changeset viewer.