Changeset 44970 in vbox
- Timestamp:
- Mar 11, 2013 9:59:05 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 84190
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/ErrorInfo.h
r44528 r44970 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 445 445 446 446 /** 447 * Constructs a new instance from an ErrorInfo object, to inject a full 448 * error info created elsewhere. 449 * 450 * @param aInfo @c true to prevent fetching error info and leave 451 * the instance uninitialized. 452 */ 453 ErrorInfoKeeper(const ErrorInfo &aInfo) 454 : ErrorInfo(false), mForgot(false) 455 { 456 copyFrom(aInfo); 457 } 458 459 /** 447 460 * Destroys this instance and automatically calls #restore() which will 448 461 * either restore error info fetched by the constructor or do nothing -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r44528 r44970 5 5 6 6 /* 7 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 1446 1446 else 1447 1447 { 1448 RTPrintf("Error: machine with the given ID not found!\n"); 1448 RTPrintf("Error: machine with the given name not found!\n"); 1449 RTPrintf("Check if this VM has been corrupted and is now inaccessible."); 1449 1450 goto leave; 1450 1451 } … … 1454 1455 vrc = RTSemEventCreate(&g_EventSemSDLEvents); 1455 1456 AssertReleaseRC(vrc); 1457 1458 rc = pVirtualBoxClient->CheckMachineError(pMachine); 1459 if (FAILED(rc)) 1460 { 1461 com::ErrorInfo info; 1462 if (info.isFullAvailable()) 1463 PrintError("The VM has errors", 1464 info.getText().raw(), info.getComponent().raw()); 1465 else 1466 RTPrintf("Failed to check for VM errors! No error information available (rc=%Rhrc).\n", rc); 1467 goto leave; 1468 } 1456 1469 1457 1470 rc = pMachine->LockMachine(pSession, LockType_VM); -
trunk/src/VBox/Main/glue/ErrorInfo.cpp
r44528 r44970 7 7 8 8 /* 9 * Copyright (C) 2006-201 1Oracle Corporation9 * Copyright (C) 2006-2013 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 266 266 mIsBasicAvailable = gotSomething; 267 267 mIsFullAvailable = gotAll; 268 269 mErrorInfo = info; 268 270 269 271 AssertMsg(gotSomething, ("Nothing to fetch!\n")); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r44948 r44970 18285 18285 <interface 18286 18286 name="IVirtualBoxClient" extends="$unknown" 18287 uuid=" 5fe0bd48-1181-40d1-991f-3b02f269a823"18287 uuid="d191281f-b0cb-4d83-a8fa-0d9fd6ba234c" 18288 18288 wsmap="suppress" 18289 18289 > … … 18315 18315 </attribute> 18316 18316 18317 <method name="checkMachineError"> 18318 <desc> 18319 Perform error checking before using an <link to="IMachine"/> object. 18320 Generally useful before starting a VM and all other uses. If anything 18321 is not as it should be then this method will return an appropriate 18322 error. 18323 </desc> 18324 18325 <param name="machine" type="IMachine" dir="in"> 18326 <desc>The machine object to check.</desc> 18327 </param> 18328 </method> 18317 18329 </interface> 18318 18330 -
trunk/src/VBox/Main/include/VirtualBoxClientImpl.h
r44529 r44970 6 6 7 7 /* 8 * Copyright (C) 2010-201 1Oracle Corporation8 * Copyright (C) 2010-2013 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 60 60 STDMETHOD(COMGETTER(Session))(ISession **aSession); 61 61 STDMETHOD(COMGETTER(EventSource))(IEventSource **aEventSource); 62 STDMETHOD(CheckMachineError)(IMachine *aMachine); 62 63 63 64 private: -
trunk/src/VBox/Main/src-client/VirtualBoxClientImpl.cpp
r44529 r44970 5 5 6 6 /* 7 * Copyright (C) 2010-201 1Oracle Corporation7 * Copyright (C) 2010-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 21 #include "VBoxEvents.h" 22 22 #include "Logging.h" 23 #include "VBox/com/ErrorInfo.h" 23 24 24 25 #include <iprt/asm.h> … … 199 200 200 201 return mData.m_pEventSource.isNull() ? E_FAIL : S_OK; 202 } 203 204 /** 205 * Checks a Machine object for any pending errors. 206 * 207 * @returns COM status code 208 * @param aMachine Machine object to check. 209 */ 210 STDMETHODIMP VirtualBoxClient::CheckMachineError(IMachine *aMachine) 211 { 212 HRESULT rc; 213 CheckComArgNotNull(aMachine); 214 215 BOOL fAccessible = FALSE; 216 rc = aMachine->COMGETTER(Accessible)(&fAccessible); 217 if (FAILED(rc)) 218 return setError(rc, tr("Could not check the accessibility status of the VM")); 219 else if (!fAccessible) 220 { 221 ComPtr<IVirtualBoxErrorInfo> pAccessError; 222 rc = aMachine->COMGETTER(AccessError)(pAccessError.asOutParam()); 223 if (FAILED(rc)) 224 return setError(rc, tr("Could not get the access error message of the VM")); 225 else 226 { 227 ErrorInfo info(pAccessError); 228 ErrorInfoKeeper eik(info); 229 return info.getResultCode(); 230 } 231 } 232 return S_OK; 201 233 } 202 234
Note:
See TracChangeset
for help on using the changeset viewer.