- Timestamp:
- Jan 24, 2023 1:30:40 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r98123 r98260 166 166 * Once created, the task structure adds itself as a Console caller. This means: 167 167 * 168 * 1. The user must check for # rc() before using the created structure169 * (e.g. passing it as a thread function argument). If # rc() returns a168 * 1. The user must check for #hrc() before using the created structure 169 * (e.g. passing it as a thread function argument). If #hrc() returns a 170 170 * failure, the Console object may not be used by the task. 171 171 * 2. On successful initialization, the structure keeps the Console caller … … 211 211 } 212 212 213 HRESULT hrc() const { return mRC; } 213 214 HRESULT rc() const { return mRC; } 214 bool isOk() const { return SUCCEEDED( rc()); }215 bool isOk() const { return SUCCEEDED(hrc()); } 215 216 216 217 /** Releases the VM caller before destruction. Not normally necessary. */ … … 320 321 ComPtr<IMachine> pMachine = mConsole->i_machine(); 321 322 ComPtr<INATRedirectEvent> pNREv = aEvent; 322 HRESULT rc = E_FAIL;323 323 Assert(pNREv); 324 324 325 325 Bstr id; 326 rc = pNREv->COMGETTER(MachineId)(id.asOutParam());327 AssertComRC( rc);326 HRESULT hrc = pNREv->COMGETTER(MachineId)(id.asOutParam()); 327 AssertComRC(hrc); 328 328 if (id != mConsole->i_getId()) 329 329 break; … … 343 343 pNREv->COMGETTER(GuestPort)(&guestPort); 344 344 ULONG ulSlot; 345 rc = pNREv->COMGETTER(Slot)(&ulSlot); 346 AssertComRC(rc); 347 if (FAILED(rc)) 348 break; 345 hrc = pNREv->COMGETTER(Slot)(&ulSlot); 346 AssertComRCBreak(hrc, RT_NOTHING); 349 347 mConsole->i_onNATRedirectRuleChanged(ulSlot, fRemove, proto, hostIp.raw(), hostPort, guestIp.raw(), guestPort); 350 348 break; … … 515 513 LogFlowThisFunc(("aMachine=%p, aControl=%p\n", aMachine, aControl)); 516 514 517 HRESULT rc = E_FAIL;518 519 515 unconst(mMachine) = aMachine; 520 516 unconst(mControl) = aControl; … … 522 518 /* Cache essential properties and objects, and create child objects */ 523 519 524 rc = mMachine->COMGETTER(State)(&mMachineState);525 AssertComRCReturnRC( rc);526 527 rc = mMachine->COMGETTER(Id)(mstrUuid.asOutParam());528 AssertComRCReturnRC( rc);520 HRESULT hrc = mMachine->COMGETTER(State)(&mMachineState); 521 AssertComRCReturnRC(hrc); 522 523 hrc = mMachine->COMGETTER(Id)(mstrUuid.asOutParam()); 524 AssertComRCReturnRC(hrc); 529 525 530 526 #ifdef VBOX_WITH_EXTPACK 531 527 unconst(mptrExtPackManager).createObject(); 532 rc = mptrExtPackManager->initExtPackManager(NULL, VBOXEXTPACKCTX_VM_PROCESS);533 AssertComRCReturnRC(rc);528 hrc = mptrExtPackManager->initExtPackManager(NULL, VBOXEXTPACKCTX_VM_PROCESS); 529 AssertComRCReturnRC(hrc); 534 530 #endif 535 531 536 532 // Event source may be needed by other children 537 533 unconst(mEventSource).createObject(); 538 rc = mEventSource->init();539 AssertComRCReturnRC( rc);534 hrc = mEventSource->init(); 535 AssertComRCReturnRC(hrc); 540 536 541 537 mcAudioRefs = 0; … … 549 545 { 550 546 /* Load the VMM. We won't continue without it being successfully loaded here. */ 551 rc = i_loadVMM();552 AssertComRCReturnRC( rc);553 554 rc = mMachine->COMGETTER(VRDEServer)(unconst(mVRDEServer).asOutParam());555 AssertComRCReturnRC( rc);547 hrc = i_loadVMM(); 548 AssertComRCReturnRC(hrc); 549 550 hrc = mMachine->COMGETTER(VRDEServer)(unconst(mVRDEServer).asOutParam()); 551 AssertComRCReturnRC(hrc); 556 552 557 553 unconst(mGuest).createObject(); 558 rc = mGuest->init(this);559 AssertComRCReturnRC( rc);554 hrc = mGuest->init(this); 555 AssertComRCReturnRC(hrc); 560 556 561 557 ULONG cCpus = 1; 562 rc = mMachine->COMGETTER(CPUCount)(&cCpus);558 hrc = mMachine->COMGETTER(CPUCount)(&cCpus); 563 559 mGuest->i_setCpuCount(cCpus); 564 560 565 561 unconst(mKeyboard).createObject(); 566 rc = mKeyboard->init(this);567 AssertComRCReturnRC( rc);562 hrc = mKeyboard->init(this); 563 AssertComRCReturnRC(hrc); 568 564 569 565 unconst(mMouse).createObject(); 570 rc = mMouse->init(this);571 AssertComRCReturnRC( rc);566 hrc = mMouse->init(this); 567 AssertComRCReturnRC(hrc); 572 568 573 569 unconst(mDisplay).createObject(); 574 rc = mDisplay->init(this);575 AssertComRCReturnRC( rc);570 hrc = mDisplay->init(this); 571 AssertComRCReturnRC(hrc); 576 572 577 573 unconst(mVRDEServerInfo).createObject(); 578 rc = mVRDEServerInfo->init(this);579 AssertComRCReturnRC( rc);574 hrc = mVRDEServerInfo->init(this); 575 AssertComRCReturnRC(hrc); 580 576 581 577 unconst(mEmulatedUSB).createObject(); 582 rc = mEmulatedUSB->init(this);583 AssertComRCReturnRC( rc);578 hrc = mEmulatedUSB->init(this); 579 AssertComRCReturnRC(hrc); 584 580 585 581 /* Init the NVRAM store. */ 586 582 ComPtr<INvramStore> pNvramStore; 587 rc = aMachine->COMGETTER(NonVolatileStore)(pNvramStore.asOutParam());588 AssertComRCReturnRC( rc);583 hrc = aMachine->COMGETTER(NonVolatileStore)(pNvramStore.asOutParam()); 584 AssertComRCReturnRC(hrc); 589 585 590 586 Bstr strNonVolatilePath; … … 592 588 593 589 unconst(mptrNvramStore).createObject(); 594 rc = mptrNvramStore->init(this, strNonVolatilePath);595 AssertComRCReturnRC( rc);590 hrc = mptrNvramStore->init(this, strNonVolatilePath); 591 AssertComRCReturnRC(hrc); 596 592 597 593 #ifdef VBOX_WITH_FULL_VM_ENCRYPTION 598 594 Bstr bstrNvramKeyId; 599 595 Bstr bstrNvramKeyStore; 600 rc = pNvramStore->COMGETTER(KeyId)(bstrNvramKeyId.asOutParam());601 AssertComRCReturnRC( rc);602 rc = pNvramStore->COMGETTER(KeyStore)(bstrNvramKeyStore.asOutParam());603 AssertComRCReturnRC( rc);596 hrc = pNvramStore->COMGETTER(KeyId)(bstrNvramKeyId.asOutParam()); 597 AssertComRCReturnRC(hrc); 598 hrc = pNvramStore->COMGETTER(KeyStore)(bstrNvramKeyStore.asOutParam()); 599 AssertComRCReturnRC(hrc); 604 600 const Utf8Str strNvramKeyId(bstrNvramKeyId); 605 601 const Utf8Str strNvramKeyStore(bstrNvramKeyStore); … … 609 605 /* Grab global and machine shared folder lists */ 610 606 611 rc = i_fetchSharedFolders(true /* aGlobal */);612 AssertComRCReturnRC( rc);613 rc = i_fetchSharedFolders(false /* aGlobal */);614 AssertComRCReturnRC( rc);607 hrc = i_fetchSharedFolders(true /* aGlobal */); 608 AssertComRCReturnRC(hrc); 609 hrc = i_fetchSharedFolders(false /* aGlobal */); 610 AssertComRCReturnRC(hrc); 615 611 616 612 /* Create other child objects */ … … 621 617 /* Figure out size of meAttachmentType vector */ 622 618 ComPtr<IVirtualBox> pVirtualBox; 623 rc = aMachine->COMGETTER(Parent)(pVirtualBox.asOutParam());624 AssertComRC( rc);619 hrc = aMachine->COMGETTER(Parent)(pVirtualBox.asOutParam()); 620 AssertComRC(hrc); 625 621 ComPtr<ISystemProperties> pSystemProperties; 626 622 if (pVirtualBox) … … 658 654 { 659 655 ComPtr<IEventSource> pES; 660 rc = pVirtualBox->COMGETTER(EventSource)(pES.asOutParam());661 AssertComRC( rc);656 hrc = pVirtualBox->COMGETTER(EventSource)(pES.asOutParam()); 657 AssertComRC(hrc); 662 658 ComObjPtr<VmEventListenerImpl> aVmListener; 663 659 aVmListener.createObject(); … … 669 665 eventTypes.push_back(VBoxEventType_OnHostPCIDevicePlug); 670 666 eventTypes.push_back(VBoxEventType_OnExtraDataChanged); 671 rc = pES->RegisterListener(aVmListener, ComSafeArrayAsInParam(eventTypes), true);672 AssertComRC( rc);667 hrc = pES->RegisterListener(aVmListener, ComSafeArrayAsInParam(eventTypes), true); 668 AssertComRC(hrc); 673 669 } 674 670 } … … 679 675 #ifdef VBOX_WITH_EXTPACK 680 676 /* Let the extension packs have a go at things (hold no locks). */ 681 if (SUCCEEDED( rc))677 if (SUCCEEDED(hrc)) 682 678 mptrExtPackManager->i_callAllConsoleReadyHooks(this); 683 679 #endif … … 709 705 ComPtr<IEventSource> pES; 710 706 ComPtr<IVirtualBox> pVirtualBox; 711 HRESULT rc = mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam());712 AssertComRC( rc);713 if (SUCCEEDED( rc) && !pVirtualBox.isNull())714 { 715 rc = pVirtualBox->COMGETTER(EventSource)(pES.asOutParam());716 AssertComRC( rc);707 HRESULT hrc = mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam()); 708 AssertComRC(hrc); 709 if (SUCCEEDED(hrc) && !pVirtualBox.isNull()) 710 { 711 hrc = pVirtualBox->COMGETTER(EventSource)(pES.asOutParam()); 712 AssertComRC(hrc); 717 713 if (!pES.isNull()) 718 714 { 719 rc = pES->UnregisterListener(mVmListener);720 AssertComRC( rc);715 hrc = pES->UnregisterListener(mVmListener); 716 AssertComRC(hrc); 721 717 } 722 718 } … … 909 905 #endif 910 906 911 HRESULT rc = i_unloadCryptoIfModule();912 AssertComRC( rc);907 HRESULT hrc = i_unloadCryptoIfModule(); 908 AssertComRC(hrc); 913 909 914 910 LogFlowThisFuncLeave(); … … 954 950 hrc = mMachine->DeleteGuestProperty(Bstr(names[i]).raw()); 955 951 if (FAILED(hrc)) 956 LogRel(("RESET: Could not delete transient property \"%s\", rc=%Rhrc\n",952 LogRel(("RESET: Could not delete transient property \"%s\", hrc=%Rhrc\n", 957 953 names[i].c_str(), hrc)); 958 954 } … … 960 956 } 961 957 else 962 LogRel(("RESET: Unable to enumerate guest properties, rc=%Rhrc\n", hrc));958 LogRel(("RESET: Unable to enumerate guest properties, hrc=%Rhrc\n", hrc)); 963 959 } 964 960 … … 1256 1252 uint32_t u32GuestFlags = VMMDEV_SETCREDENTIALS_JUDGE; 1257 1253 1258 int rc = pDevPort->pfnSetCredentials(pDevPort, pszUser, pszPassword, pszDomain, u32GuestFlags); 1259 1260 if (RT_SUCCESS(rc)) 1254 int vrc = pDevPort->pfnSetCredentials(pDevPort, pszUser, pszPassword, pszDomain, u32GuestFlags); 1255 if (RT_SUCCESS(vrc)) 1261 1256 { 1262 1257 /* Wait for guest. */ 1263 rc = m_pVMMDev->WaitCredentialsJudgement(authTimeout, &u32GuestFlags); 1264 1265 if (RT_SUCCESS(rc)) 1258 vrc = m_pVMMDev->WaitCredentialsJudgement(authTimeout, &u32GuestFlags); 1259 if (RT_SUCCESS(vrc)) 1266 1260 { 1267 1261 switch (u32GuestFlags & ( VMMDEV_CREDENTIALS_JUDGE_OK … … 1273 1267 case VMMDEV_CREDENTIALS_JUDGE_OK: guestJudgement = AuthGuestAccessGranted; break; 1274 1268 default: 1275 LogFlowFunc(("Invalid guest flags %#08x!!!\n", u32GuestFlags)); break; 1269 LogFlowFunc(("Invalid guest flags %#08x!!!\n", u32GuestFlags)); 1270 break; 1276 1271 } 1277 1272 } 1278 1273 else 1279 { 1280 LogFlowFunc(("Wait for credentials judgement rc = %Rrc!!!\n", rc)); 1281 } 1282 1274 LogFlowFunc(("Wait for credentials judgement vrc = %Rrc!!!\n", vrc)); 1283 1275 LogFlowFunc(("Guest judgement %d\n", guestJudgement)); 1284 1276 } 1285 1277 else 1286 { 1287 LogFlowFunc(("Could not set credentials rc = %Rrc!!!\n", rc)); 1288 } 1278 LogFlowFunc(("Could not set credentials vrc = %Rrc!!!\n", vrc)); 1289 1279 } 1290 1280 … … 1307 1297 } 1308 1298 } 1309 } break; 1299 break; 1300 } 1310 1301 1311 1302 default: … … 1405 1396 if (pDevPort) 1406 1397 { 1407 int rc = pDevPort->pfnSetCredentials(m_pVMMDev->getVMMDevPort(), 1408 pszUser, pszPassword, pszDomain, u32GuestFlags); 1409 AssertRC(rc); 1398 int vrc = pDevPort->pfnSetCredentials(m_pVMMDev->getVMMDevPort(), pszUser, pszPassword, pszDomain, u32GuestFlags); 1399 AssertRC(vrc); 1410 1400 } 1411 1401 } … … 1875 1865 ComObjPtr<SharedFolder> pSharedFolder; 1876 1866 pSharedFolder.createObject(); 1877 HRESULT rc = pSharedFolder->init(this,1878 strName,1879 strHostPath,1880 writable,1881 autoMount,1882 strAutoMountPoint,1883 false /* fFailOnError */);1884 AssertComRCReturn( rc, VERR_INTERNAL_ERROR);1867 HRESULT hrc = pSharedFolder->init(this, 1868 strName, 1869 strHostPath, 1870 writable, 1871 autoMount, 1872 strAutoMountPoint, 1873 false /* fFailOnError */); 1874 AssertComRCReturn(hrc, VERR_INTERNAL_ERROR); 1885 1875 1886 1876 m_mapSharedFolders.insert(std::make_pair(strName, pSharedFolder)); … … 1910 1900 pCBData->pcszName, pCBData->pcszValue, pCBData->pcszFlags)); 1911 1901 1912 int rc;1913 1902 Bstr name(pCBData->pcszName); 1914 1903 Bstr value(pCBData->pcszValue); … … 1925 1914 ::FireGuestPropertyChangedEvent(pConsole->mEventSource, pConsole->i_getId().raw(), name.raw(), value.raw(), flags.raw(), 1926 1915 fWasDeleted); 1927 rc = VINF_SUCCESS; 1928 } 1929 else 1930 { 1931 LogFlow(("Console::doGuestPropNotification: hrc=%Rhrc pCBData={.pcszName=%s, .pcszValue=%s, .pcszFlags=%s}\n", 1932 hrc, pCBData->pcszName, pCBData->pcszValue, pCBData->pcszFlags)); 1933 rc = Global::vboxStatusCodeFromCOM(hrc); 1934 } 1935 return rc; 1916 return VINF_SUCCESS; 1917 } 1918 LogFlow(("Console::doGuestPropNotification: hrc=%Rhrc pCBData={.pcszName=%s, .pcszValue=%s, .pcszFlags=%s}\n", 1919 hrc, pCBData->pcszName, pCBData->pcszValue, pCBData->pcszFlags)); 1920 return Global::vboxStatusCodeFromCOM(hrc); 1936 1921 } 1937 1922 … … 2155 2140 2156 2141 /* Read console data stored in the saved state file (if not yet done) */ 2157 HRESULT rc = i_loadDataFromSavedState(); 2158 if (FAILED(rc)) return rc; 2142 HRESULT hrc = i_loadDataFromSavedState(); 2143 if (FAILED(hrc)) 2144 return hrc; 2159 2145 2160 2146 size_t i = 0; … … 2407 2393 2408 2394 int vrc = pVMM->pfnPDMR3DeviceDetach(pUVM, "acpi", 0, idCpu, 0); 2409 Log(("UnplugCpu: rc=%Rrc\n", vrc));2395 Log(("UnplugCpu: vrc=%Rrc\n", vrc)); 2410 2396 2411 2397 return vrc; … … 2414 2400 HRESULT Console::i_doCPURemove(ULONG aCpu, PUVM pUVM, PCVMMR3VTABLE pVMM) 2415 2401 { 2416 HRESULT rc = S_OK;2417 2418 2402 LogFlowThisFuncEnter(); 2419 2403 2420 2404 AutoCaller autoCaller(this); 2421 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 2405 HRESULT hrc = autoCaller.rc(); 2406 if (FAILED(hrc)) 2407 return hrc; 2422 2408 2423 2409 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 2436 2422 /* Check if the CPU is present */ 2437 2423 BOOL fCpuAttached; 2438 rc = mMachine->GetCPUStatus(aCpu, &fCpuAttached);2439 if (FAILED( rc))2440 return rc;2424 hrc = mMachine->GetCPUStatus(aCpu, &fCpuAttached); 2425 if (FAILED(hrc)) 2426 return hrc; 2441 2427 if (!fCpuAttached) 2442 2428 return setError(E_FAIL, tr("CPU %d is not attached"), aCpu); … … 2506 2492 } 2507 2493 else 2508 rc = setErrorBoth(VBOX_E_VM_ERROR, vrc, tr("Hot-Remove failed (rc=%Rrc)"), vrc);2494 hrc = setErrorBoth(VBOX_E_VM_ERROR, vrc, tr("Hot-Remove failed (vrc=%Rrc)"), vrc); 2509 2495 } 2510 2496 else 2511 rc = setErrorBoth(VBOX_E_VM_ERROR, VERR_RESOURCE_BUSY,2512 tr("Hot-Remove was aborted because the CPU may still be used by the guest"), VERR_RESOURCE_BUSY);2513 2514 LogFlowThisFunc(("mMachineState=%d, rc=%Rhrc\n", mMachineState,rc));2497 hrc = setErrorBoth(VBOX_E_VM_ERROR, VERR_RESOURCE_BUSY, 2498 tr("Hot-Remove was aborted because the CPU may still be used by the guest"), VERR_RESOURCE_BUSY); 2499 2500 LogFlowThisFunc(("mMachineState=%d, hrc=%Rhrc\n", mMachineState, hrc)); 2515 2501 LogFlowThisFuncLeave(); 2516 return rc;2502 return hrc; 2517 2503 } 2518 2504 … … 2522 2508 RT_NOREF(pThis); 2523 2509 2524 int rc = pVMM->pfnVMR3HotPlugCpu(pUVM, idCpu); 2525 AssertRC(rc); 2510 int vrc = pVMM->pfnVMR3HotPlugCpu(pUVM, idCpu); 2511 AssertRC(vrc); 2512 2513 /** @todo r=bird: Error handling here just sucks. */ 2526 2514 2527 2515 PCFGMNODE pInst = pVMM->pfnCFGMR3GetChild(pVMM->pfnCFGMR3GetRootU(pUVM), "Devices/acpi/0/"); … … 2530 2518 pVMM->pfnCFGMR3RemoveNode(pVMM->pfnCFGMR3GetChildF(pInst, "LUN#%u", idCpu)); 2531 2519 2532 #define RC_CHECK() do { if (RT_FAILURE(rc)) { AssertReleaseRC(rc); break; }} while (0)2520 #define RC_CHECK() do { AssertReleaseRC(vrc); } while (0) 2533 2521 2534 2522 PCFGMNODE pLunL0; 2535 2523 PCFGMNODE pCfg; 2536 rc = pVMM->pfnCFGMR3InsertNodeF(pInst, &pLunL0, "LUN#%u", idCpu); RC_CHECK();2537 rc = pVMM->pfnCFGMR3InsertString(pLunL0, "Driver", "ACPICpu"); RC_CHECK();2538 rc = pVMM->pfnCFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK();2524 vrc = pVMM->pfnCFGMR3InsertNodeF(pInst, &pLunL0, "LUN#%u", idCpu); RC_CHECK(); 2525 vrc = pVMM->pfnCFGMR3InsertString(pLunL0, "Driver", "ACPICpu"); RC_CHECK(); 2526 vrc = pVMM->pfnCFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 2539 2527 2540 2528 /* … … 2542 2530 */ 2543 2531 PPDMIBASE pBase; 2544 rc = pVMM->pfnPDMR3DeviceAttach(pUVM, "acpi", 0, idCpu, 0, &pBase); RC_CHECK();2545 2546 Log(("PlugCpu: rc=%Rrc\n",rc));2532 vrc = pVMM->pfnPDMR3DeviceAttach(pUVM, "acpi", 0, idCpu, 0, &pBase); RC_CHECK(); 2533 2534 Log(("PlugCpu: vrc=%Rrc\n", vrc)); 2547 2535 2548 2536 pVMM->pfnCFGMR3Dump(pInst); … … 2555 2543 HRESULT Console::i_doCPUAdd(ULONG aCpu, PUVM pUVM, PCVMMR3VTABLE pVMM) 2556 2544 { 2557 HRESULT rc = S_OK;2558 2559 2545 LogFlowThisFuncEnter(); 2560 2546 2561 2547 AutoCaller autoCaller(this); 2562 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 2548 HRESULT hrc = autoCaller.rc(); 2549 if (FAILED(hrc)) 2550 return hrc; 2563 2551 2564 2552 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 2578 2566 /* Check if the CPU is present */ 2579 2567 BOOL fCpuAttached; 2580 rc = mMachine->GetCPUStatus(aCpu, &fCpuAttached); 2581 if (FAILED(rc)) return rc; 2568 hrc = mMachine->GetCPUStatus(aCpu, &fCpuAttached); 2569 if (FAILED(hrc)) 2570 return hrc; 2582 2571 2583 2572 if (fCpuAttached) 2584 return setError(E_FAIL, 2585 tr("CPU %d is already attached"), aCpu); 2573 return setError(E_FAIL, tr("CPU %d is already attached"), aCpu); 2586 2574 2587 2575 /* … … 2615 2603 } 2616 2604 else 2617 rc = setErrorBoth(VBOX_E_VM_ERROR, vrc, tr("Could not add CPU to the machine (%Rrc)"), vrc);2618 2619 LogFlowThisFunc(("mMachineState=%d, rc=%Rhrc\n", mMachineState,rc));2605 hrc = setErrorBoth(VBOX_E_VM_ERROR, vrc, tr("Could not add CPU to the machine (%Rrc)"), vrc); 2606 2607 LogFlowThisFunc(("mMachineState=%d, hrc=%Rhrc\n", mMachineState, hrc)); 2620 2608 LogFlowThisFuncLeave(); 2621 return rc;2609 return hrc; 2622 2610 } 2623 2611 … … 2626 2614 LogFlowThisFuncEnter(); 2627 2615 2628 HRESULT rc = i_pause(Reason_Unspecified);2629 2630 LogFlowThisFunc((" rc=%Rhrc\n",rc));2616 HRESULT hrc = i_pause(Reason_Unspecified); 2617 2618 LogFlowThisFunc(("hrc=%Rhrc\n", hrc)); 2631 2619 LogFlowThisFuncLeave(); 2632 return rc;2620 return hrc; 2633 2621 } 2634 2622 … … 2644 2632 Global::stringifyMachineState(mMachineState)); 2645 2633 2646 HRESULT rc = i_resume(Reason_Unspecified, alock);2647 2648 LogFlowThisFunc((" rc=%Rhrc\n",rc));2634 HRESULT hrc = i_resume(Reason_Unspecified, alock); 2635 2636 LogFlowThisFunc(("hrc=%Rhrc\n", hrc)); 2649 2637 LogFlowThisFuncLeave(); 2650 return rc;2638 return hrc; 2651 2639 } 2652 2640 … … 3066 3054 { 3067 3055 #ifdef VBOX_WITH_USB 3068 3069 3056 aDevice = NULL; 3070 3057 3071 3058 SafeIfaceArray<IUSBDevice> devsvec; 3072 HRESULT rc = COMGETTER(USBDevices)(ComSafeArrayAsOutParam(devsvec)); 3073 if (FAILED(rc)) return rc; 3059 HRESULT hrc = COMGETTER(USBDevices)(ComSafeArrayAsOutParam(devsvec)); 3060 if (FAILED(hrc)) 3061 return hrc; 3074 3062 3075 3063 for (size_t i = 0; i < devsvec.size(); ++i) 3076 3064 { 3077 3065 Bstr bstrAddress; 3078 rc = devsvec[i]->COMGETTER(Address)(bstrAddress.asOutParam()); 3079 if (FAILED(rc)) return rc; 3066 hrc = devsvec[i]->COMGETTER(Address)(bstrAddress.asOutParam()); 3067 if (FAILED(hrc)) 3068 return hrc; 3080 3069 if (bstrAddress == aName) 3081 3070 { … … 3098 3087 { 3099 3088 #ifdef VBOX_WITH_USB 3100 3101 3089 aDevice = NULL; 3102 3090 3103 3091 SafeIfaceArray<IUSBDevice> devsvec; 3104 HRESULT rc = COMGETTER(USBDevices)(ComSafeArrayAsOutParam(devsvec)); 3105 if (FAILED(rc)) return rc; 3092 HRESULT hrc = COMGETTER(USBDevices)(ComSafeArrayAsOutParam(devsvec)); 3093 if (FAILED(hrc)) 3094 return hrc; 3106 3095 3107 3096 Utf8Str const strId = aId.toString(); … … 3109 3098 { 3110 3099 Bstr id; 3111 rc = devsvec[i]->COMGETTER(Id)(id.asOutParam()); 3112 if (FAILED(rc)) return rc; 3100 hrc = devsvec[i]->COMGETTER(Id)(id.asOutParam()); 3101 if (FAILED(hrc)) 3102 return hrc; 3113 3103 if (id == strId) 3114 3104 { … … 3152 3142 3153 3143 ComObjPtr<SharedFolder> pSharedFolder; 3154 HRESULT rc = i_findSharedFolder(aName, pSharedFolder, false /* aSetError */); 3155 if (SUCCEEDED(rc)) 3156 return setError(VBOX_E_FILE_ERROR, 3157 tr("Shared folder named '%s' already exists"), 3158 aName.c_str()); 3144 HRESULT hrc = i_findSharedFolder(aName, pSharedFolder, false /* aSetError */); 3145 if (SUCCEEDED(hrc)) 3146 return setError(VBOX_E_FILE_ERROR, tr("Shared folder named '%s' already exists"), aName.c_str()); 3159 3147 3160 3148 pSharedFolder.createObject(); 3161 rc = pSharedFolder->init(this, 3162 aName, 3163 aHostPath, 3164 !!aWritable, 3165 !!aAutomount, 3166 aAutoMountPoint, 3167 true /* fFailOnError */); 3168 if (FAILED(rc)) return rc; 3149 hrc = pSharedFolder->init(this, 3150 aName, 3151 aHostPath, 3152 !!aWritable, 3153 !!aAutomount, 3154 aAutoMountPoint, 3155 true /* fFailOnError */); 3156 if (FAILED(hrc)) 3157 return hrc; 3169 3158 3170 3159 /* If the VM is online and supports shared folders, share this folder … … 3180 3169 if (i_findOtherSharedFolder(aName, it)) 3181 3170 { 3182 rc = i_removeSharedFolder(aName);3183 if (FAILED( rc))3184 return rc;3171 hrc = i_removeSharedFolder(aName); 3172 if (FAILED(hrc)) 3173 return hrc; 3185 3174 } 3186 3175 3187 3176 /* second, create the given folder */ 3188 rc = i_createSharedFolder(aName, SharedFolderData(aHostPath, !!aWritable, !!aAutomount, aAutoMountPoint));3189 if (FAILED( rc))3190 return rc;3177 hrc = i_createSharedFolder(aName, SharedFolderData(aHostPath, !!aWritable, !!aAutomount, aAutoMountPoint)); 3178 if (FAILED(hrc)) 3179 return hrc; 3191 3180 } 3192 3181 … … 3199 3188 LogFlowThisFunc(("Leaving for '%s' -> '%s'\n", aName.c_str(), aHostPath.c_str())); 3200 3189 3201 return rc;3190 return hrc; 3202 3191 } 3203 3192 … … 3224 3213 3225 3214 ComObjPtr<SharedFolder> pSharedFolder; 3226 HRESULT rc = i_findSharedFolder(aName, pSharedFolder, true /* aSetError */); 3227 if (FAILED(rc)) return rc; 3215 HRESULT hrc = i_findSharedFolder(aName, pSharedFolder, true /* aSetError */); 3216 if (FAILED(hrc)) 3217 return hrc; 3228 3218 3229 3219 /* protect the VM handle (if not NULL) */ … … 3237 3227 3238 3228 /* first, remove the given folder */ 3239 rc = i_removeSharedFolder(aName); 3240 if (FAILED(rc)) return rc; 3229 hrc = i_removeSharedFolder(aName); 3230 if (FAILED(hrc)) 3231 return hrc; 3241 3232 3242 3233 /* first, remove the machine or the global folder if there is any */ … … 3244 3235 if (i_findOtherSharedFolder(aName, it)) 3245 3236 { 3246 rc = i_createSharedFolder(aName, it->second);3247 /* don't check rc here because we need to remove the console3237 hrc = i_createSharedFolder(aName, it->second); 3238 /* don't check hrc here because we need to remove the console 3248 3239 * folder from the collection even on failure */ 3249 3240 } … … 3258 3249 LogFlowThisFunc(("Leaving for '%s'\n", aName.c_str())); 3259 3250 3260 return rc;3251 return hrc; 3261 3252 } 3262 3253 … … 3453 3444 va_list args; 3454 3445 va_start(args, pcsz); 3455 HRESULT rc = setErrorInternalV(aResultCode,3456 getStaticClassIID(),3457 getStaticComponentName(),3458 pcsz, args,3459 false /* aWarning */,3460 true /* aLogIt */);3446 HRESULT hrc = setErrorInternalV(aResultCode, 3447 getStaticClassIID(), 3448 getStaticComponentName(), 3449 pcsz, args, 3450 false /* aWarning */, 3451 true /* aLogIt */); 3461 3452 va_end(args); 3462 return rc;3453 return hrc; 3463 3454 } 3464 3455 … … 3468 3459 va_list args; 3469 3460 va_start(args, pcsz); 3470 HRESULT rc = setErrorInternalV(aResultCode,3471 getStaticClassIID(),3472 getStaticComponentName(),3473 pcsz, args,3474 false /* aWarning */,3475 true /* aLogIt */,3476 vrc);3461 HRESULT hrc = setErrorInternalV(aResultCode, 3462 getStaticClassIID(), 3463 getStaticComponentName(), 3464 pcsz, args, 3465 false /* aWarning */, 3466 true /* aLogIt */, 3467 vrc); 3477 3468 va_end(args); 3478 return rc;3469 return hrc; 3479 3470 } 3480 3471 … … 3628 3619 /* disable the callback to prevent Console-level state change */ 3629 3620 mVMStateChangeCallbackDisabled = true; 3630 int rc = pVMM->pfnVMR3Resume(pUVM, VMRESUMEREASON_RECONFIG);3621 int vrc = pVMM->pfnVMR3Resume(pUVM, VMRESUMEREASON_RECONFIG); 3631 3622 mVMStateChangeCallbackDisabled = false; 3632 AssertRC( rc);3633 if (RT_FAILURE( rc))3623 AssertRC(vrc); 3624 if (RT_FAILURE(vrc)) 3634 3625 { 3635 3626 VMSTATE enmVMState = pVMM->pfnVMR3GetStateU(pUVM); … … 3660 3651 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 3661 3652 3662 HRESULT rc = S_OK;3663 3653 const char *pszDevice = NULL; 3664 3654 3665 3655 SafeIfaceArray<IStorageController> ctrls; 3666 rc = mMachine->COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(ctrls)); 3667 AssertComRC(rc); 3668 IMedium *pMedium; 3669 rc = aMediumAttachment->COMGETTER(Medium)(&pMedium); 3670 AssertComRC(rc); 3656 HRESULT hrc = mMachine->COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(ctrls)); 3657 AssertComRC(hrc); 3658 3659 IMedium *pMedium = NULL; 3660 hrc = aMediumAttachment->COMGETTER(Medium)(&pMedium); 3661 AssertComRC(hrc); 3662 3671 3663 Bstr mediumLocation; 3672 3664 if (pMedium) 3673 3665 { 3674 rc = pMedium->COMGETTER(Location)(mediumLocation.asOutParam());3675 AssertComRC( rc);3666 hrc = pMedium->COMGETTER(Location)(mediumLocation.asOutParam()); 3667 AssertComRC(hrc); 3676 3668 } 3677 3669 3678 3670 Bstr attCtrlName; 3679 rc = aMediumAttachment->COMGETTER(Controller)(attCtrlName.asOutParam());3680 AssertComRC( rc);3671 hrc = aMediumAttachment->COMGETTER(Controller)(attCtrlName.asOutParam()); 3672 AssertComRC(hrc); 3681 3673 ComPtr<IStorageController> pStorageController; 3682 3674 for (size_t i = 0; i < ctrls.size(); ++i) 3683 3675 { 3684 3676 Bstr ctrlName; 3685 rc = ctrls[i]->COMGETTER(Name)(ctrlName.asOutParam());3686 AssertComRC( rc);3677 hrc = ctrls[i]->COMGETTER(Name)(ctrlName.asOutParam()); 3678 AssertComRC(hrc); 3687 3679 if (attCtrlName == ctrlName) 3688 3680 { … … 3692 3684 } 3693 3685 if (pStorageController.isNull()) 3694 return setError(E_FAIL, 3695 tr("Could not find storage controller '%ls'"), attCtrlName.raw()); 3686 return setError(E_FAIL, tr("Could not find storage controller '%ls'"), attCtrlName.raw()); 3696 3687 3697 3688 StorageControllerType_T enmCtrlType; 3698 rc = pStorageController->COMGETTER(ControllerType)(&enmCtrlType);3699 AssertComRC( rc);3689 hrc = pStorageController->COMGETTER(ControllerType)(&enmCtrlType); 3690 AssertComRC(hrc); 3700 3691 pszDevice = i_storageControllerTypeToStr(enmCtrlType); 3701 3692 3702 3693 StorageBus_T enmBus; 3703 rc = pStorageController->COMGETTER(Bus)(&enmBus); 3704 AssertComRC(rc); 3694 hrc = pStorageController->COMGETTER(Bus)(&enmBus); 3695 AssertComRC(hrc); 3696 3705 3697 ULONG uInstance; 3706 rc = pStorageController->COMGETTER(Instance)(&uInstance); 3707 AssertComRC(rc); 3698 hrc = pStorageController->COMGETTER(Instance)(&uInstance); 3699 AssertComRC(hrc); 3700 3708 3701 BOOL fUseHostIOCache; 3709 rc = pStorageController->COMGETTER(UseHostIOCache)(&fUseHostIOCache);3710 AssertComRC( rc);3702 hrc = pStorageController->COMGETTER(UseHostIOCache)(&fUseHostIOCache); 3703 AssertComRC(hrc); 3711 3704 3712 3705 /* … … 3715 3708 */ 3716 3709 bool fResume = false; 3717 rc = i_suspendBeforeConfigChange(pUVM, pVMM, &alock, &fResume);3718 if (FAILED( rc))3719 return rc;3710 hrc = i_suspendBeforeConfigChange(pUVM, pVMM, &alock, &fResume); 3711 if (FAILED(hrc)) 3712 return hrc; 3720 3713 3721 3714 /* … … 3795 3788 AssertReturn(enmVMState == VMSTATE_SUSPENDED, VERR_INVALID_STATE); 3796 3789 3797 int rc = pThis->i_configMediumAttachment(pcszDevice,3798 uInstance,3799 enmBus,3800 fUseHostIOCache,3801 false /* fSetupMerge */,3802 false /* fBuiltinIOCache */,3803 false /* fInsertDiskIntegrityDrv. */,3804 0 /* uMergeSource */,3805 0 /* uMergeTarget */,3806 aMediumAtt,3807 pThis->mMachineState,3808 NULL /* phrc */,3809 true /* fAttachDetach */,3810 fForce /* fForceUnmount */,3811 false /* fHotplug */,3812 pUVM,3813 pVMM,3814 NULL /* paLedDevType */,3815 NULL /* ppLunL0 */);3816 LogFlowFunc(("Returning %Rrc\n", rc));3817 return rc;3790 int hrc = pThis->i_configMediumAttachment(pcszDevice, 3791 uInstance, 3792 enmBus, 3793 fUseHostIOCache, 3794 false /* fSetupMerge */, 3795 false /* fBuiltinIOCache */, 3796 false /* fInsertDiskIntegrityDrv. */, 3797 0 /* uMergeSource */, 3798 0 /* uMergeTarget */, 3799 aMediumAtt, 3800 pThis->mMachineState, 3801 NULL /* phrc */, 3802 true /* fAttachDetach */, 3803 fForce /* fForceUnmount */, 3804 false /* fHotplug */, 3805 pUVM, 3806 pVMM, 3807 NULL /* paLedDevType */, 3808 NULL /* ppLunL0 */); 3809 LogFlowFunc(("Returning %Rrc\n", hrc)); 3810 return hrc; 3818 3811 } 3819 3812 … … 3837 3830 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 3838 3831 3839 HRESULT rc = S_OK;3840 3832 const char *pszDevice = NULL; 3841 3833 3842 3834 SafeIfaceArray<IStorageController> ctrls; 3843 rc = mMachine->COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(ctrls)); 3844 AssertComRC(rc); 3845 IMedium *pMedium; 3846 rc = aMediumAttachment->COMGETTER(Medium)(&pMedium); 3847 AssertComRC(rc); 3835 HRESULT hrc = mMachine->COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(ctrls)); 3836 AssertComRC(hrc); 3837 3838 IMedium *pMedium = NULL; 3839 hrc = aMediumAttachment->COMGETTER(Medium)(&pMedium); 3840 AssertComRC(hrc); 3841 3848 3842 Bstr mediumLocation; 3849 3843 if (pMedium) 3850 3844 { 3851 rc = pMedium->COMGETTER(Location)(mediumLocation.asOutParam());3852 AssertComRC( rc);3845 hrc = pMedium->COMGETTER(Location)(mediumLocation.asOutParam()); 3846 AssertComRC(hrc); 3853 3847 } 3854 3848 3855 3849 Bstr attCtrlName; 3856 rc = aMediumAttachment->COMGETTER(Controller)(attCtrlName.asOutParam());3857 AssertComRC( rc);3850 hrc = aMediumAttachment->COMGETTER(Controller)(attCtrlName.asOutParam()); 3851 AssertComRC(hrc); 3858 3852 ComPtr<IStorageController> pStorageController; 3859 3853 for (size_t i = 0; i < ctrls.size(); ++i) 3860 3854 { 3861 3855 Bstr ctrlName; 3862 rc = ctrls[i]->COMGETTER(Name)(ctrlName.asOutParam());3863 AssertComRC( rc);3856 hrc = ctrls[i]->COMGETTER(Name)(ctrlName.asOutParam()); 3857 AssertComRC(hrc); 3864 3858 if (attCtrlName == ctrlName) 3865 3859 { … … 3872 3866 3873 3867 StorageControllerType_T enmCtrlType; 3874 rc = pStorageController->COMGETTER(ControllerType)(&enmCtrlType);3875 AssertComRC( rc);3868 hrc = pStorageController->COMGETTER(ControllerType)(&enmCtrlType); 3869 AssertComRC(hrc); 3876 3870 pszDevice = i_storageControllerTypeToStr(enmCtrlType); 3877 3871 3878 3872 StorageBus_T enmBus; 3879 rc = pStorageController->COMGETTER(Bus)(&enmBus); 3880 AssertComRC(rc); 3873 hrc = pStorageController->COMGETTER(Bus)(&enmBus); 3874 AssertComRC(hrc); 3875 3881 3876 ULONG uInstance; 3882 rc = pStorageController->COMGETTER(Instance)(&uInstance); 3883 AssertComRC(rc); 3877 hrc = pStorageController->COMGETTER(Instance)(&uInstance); 3878 AssertComRC(hrc); 3879 3884 3880 BOOL fUseHostIOCache; 3885 rc = pStorageController->COMGETTER(UseHostIOCache)(&fUseHostIOCache);3886 AssertComRC( rc);3881 hrc = pStorageController->COMGETTER(UseHostIOCache)(&fUseHostIOCache); 3882 AssertComRC(hrc); 3887 3883 3888 3884 /* … … 3891 3887 */ 3892 3888 bool fResume = false; 3893 rc = i_suspendBeforeConfigChange(pUVM, pVMM, &alock, &fResume);3894 if (FAILED( rc))3895 return rc;3889 hrc = i_suspendBeforeConfigChange(pUVM, pVMM, &alock, &fResume); 3890 if (FAILED(hrc)) 3891 return hrc; 3896 3892 3897 3893 /* … … 3972 3968 AssertReturn(enmVMState == VMSTATE_SUSPENDED, VERR_INVALID_STATE); 3973 3969 3974 int rc = pThis->i_configMediumAttachment(pcszDevice,3975 uInstance,3976 enmBus,3977 fUseHostIOCache,3978 false /* fSetupMerge */,3979 false /* fBuiltinIOCache */,3980 false /* fInsertDiskIntegrityDrv. */,3981 0 /* uMergeSource */,3982 0 /* uMergeTarget */,3983 aMediumAtt,3984 pThis->mMachineState,3985 NULL /* phrc */,3986 true /* fAttachDetach */,3987 false /* fForceUnmount */,3988 !fSilent /* fHotplug */,3989 pUVM,3990 pVMM,3991 NULL /* paLedDevType */,3992 NULL);3993 LogFlowFunc(("Returning %Rrc\n", rc));3994 return rc;3970 int hrc = pThis->i_configMediumAttachment(pcszDevice, 3971 uInstance, 3972 enmBus, 3973 fUseHostIOCache, 3974 false /* fSetupMerge */, 3975 false /* fBuiltinIOCache */, 3976 false /* fInsertDiskIntegrityDrv. */, 3977 0 /* uMergeSource */, 3978 0 /* uMergeTarget */, 3979 aMediumAtt, 3980 pThis->mMachineState, 3981 NULL /* phrc */, 3982 true /* fAttachDetach */, 3983 false /* fForceUnmount */, 3984 !fSilent /* fHotplug */, 3985 pUVM, 3986 pVMM, 3987 NULL /* paLedDevType */, 3988 NULL); 3989 LogFlowFunc(("Returning %Rrc\n", hrc)); 3990 return hrc; 3995 3991 } 3996 3992 … … 4013 4009 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 4014 4010 4015 HRESULT rc = S_OK;4016 4011 const char *pszDevice = NULL; 4017 4012 4018 4013 SafeIfaceArray<IStorageController> ctrls; 4019 rc = mMachine->COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(ctrls)); 4020 AssertComRC(rc); 4021 IMedium *pMedium; 4022 rc = aMediumAttachment->COMGETTER(Medium)(&pMedium); 4023 AssertComRC(rc); 4014 HRESULT hrc = mMachine->COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(ctrls)); 4015 AssertComRC(hrc); 4016 4017 IMedium *pMedium = NULL; 4018 hrc = aMediumAttachment->COMGETTER(Medium)(&pMedium); 4019 AssertComRC(hrc); 4020 4024 4021 Bstr mediumLocation; 4025 4022 if (pMedium) 4026 4023 { 4027 rc = pMedium->COMGETTER(Location)(mediumLocation.asOutParam());4028 AssertComRC( rc);4024 hrc = pMedium->COMGETTER(Location)(mediumLocation.asOutParam()); 4025 AssertComRC(hrc); 4029 4026 } 4030 4027 4031 4028 Bstr attCtrlName; 4032 rc = aMediumAttachment->COMGETTER(Controller)(attCtrlName.asOutParam());4033 AssertComRC( rc);4029 hrc = aMediumAttachment->COMGETTER(Controller)(attCtrlName.asOutParam()); 4030 AssertComRC(hrc); 4034 4031 ComPtr<IStorageController> pStorageController; 4035 4032 for (size_t i = 0; i < ctrls.size(); ++i) 4036 4033 { 4037 4034 Bstr ctrlName; 4038 rc = ctrls[i]->COMGETTER(Name)(ctrlName.asOutParam());4039 AssertComRC( rc);4035 hrc = ctrls[i]->COMGETTER(Name)(ctrlName.asOutParam()); 4036 AssertComRC(hrc); 4040 4037 if (attCtrlName == ctrlName) 4041 4038 { … … 4048 4045 4049 4046 StorageControllerType_T enmCtrlType; 4050 rc = pStorageController->COMGETTER(ControllerType)(&enmCtrlType);4051 AssertComRC( rc);4047 hrc = pStorageController->COMGETTER(ControllerType)(&enmCtrlType); 4048 AssertComRC(hrc); 4052 4049 pszDevice = i_storageControllerTypeToStr(enmCtrlType); 4053 4050 4054 StorageBus_T enmBus; 4055 rc = pStorageController->COMGETTER(Bus)(&enmBus); 4056 AssertComRC(rc); 4057 ULONG uInstance; 4058 rc = pStorageController->COMGETTER(Instance)(&uInstance); 4059 AssertComRC(rc); 4051 StorageBus_T enmBus = (StorageBus_T)0; 4052 hrc = pStorageController->COMGETTER(Bus)(&enmBus); 4053 AssertComRC(hrc); 4054 4055 ULONG uInstance = 0; 4056 hrc = pStorageController->COMGETTER(Instance)(&uInstance); 4057 AssertComRC(hrc); 4060 4058 4061 4059 /* … … 4064 4062 */ 4065 4063 bool fResume = false; 4066 rc = i_suspendBeforeConfigChange(pUVM, pVMM, &alock, &fResume);4067 if (FAILED( rc))4068 return rc;4064 hrc = i_suspendBeforeConfigChange(pUVM, pVMM, &alock, &fResume); 4065 if (FAILED(hrc)) 4066 return hrc; 4069 4067 4070 4068 /* … … 4220 4218 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 4221 4219 4222 HRESULT rc = S_OK;4220 HRESULT hrc = S_OK; 4223 4221 4224 4222 /* don't trigger network changes if the VM isn't running */ … … 4228 4226 /* Get the properties we need from the adapter */ 4229 4227 BOOL fCableConnected, fTraceEnabled; 4230 rc = aNetworkAdapter->COMGETTER(CableConnected)(&fCableConnected);4231 AssertComRC( rc);4232 if (SUCCEEDED( rc))4233 { 4234 rc = aNetworkAdapter->COMGETTER(TraceEnabled)(&fTraceEnabled);4235 AssertComRC( rc);4236 if (SUCCEEDED( rc))4228 hrc = aNetworkAdapter->COMGETTER(CableConnected)(&fCableConnected); 4229 AssertComRC(hrc); 4230 if (SUCCEEDED(hrc)) 4231 { 4232 hrc = aNetworkAdapter->COMGETTER(TraceEnabled)(&fTraceEnabled); 4233 AssertComRC(hrc); 4234 if (SUCCEEDED(hrc)) 4237 4235 { 4238 4236 ULONG ulInstance; 4239 rc = aNetworkAdapter->COMGETTER(Slot)(&ulInstance);4240 AssertComRC( rc);4241 if (SUCCEEDED( rc))4237 hrc = aNetworkAdapter->COMGETTER(Slot)(&ulInstance); 4238 AssertComRC(hrc); 4239 if (SUCCEEDED(hrc)) 4242 4240 { 4243 4241 /* … … 4246 4244 */ 4247 4245 NetworkAdapterType_T adapterType; 4248 rc = aNetworkAdapter->COMGETTER(AdapterType)(&adapterType);4249 AssertComRC( rc);4246 hrc = aNetworkAdapter->COMGETTER(AdapterType)(&adapterType); 4247 AssertComRC(hrc); 4250 4248 const char *pszAdapterName = networkAdapterTypeToName(adapterType); 4251 4249 … … 4282 4280 } 4283 4281 4284 rc = i_doNetworkAdapterChange(ptrVM.rawUVM(), ptrVM.vtable(), pszAdapterName,4285 ulInstance, 0, aNetworkAdapter);4282 hrc = i_doNetworkAdapterChange(ptrVM.rawUVM(), ptrVM.vtable(), pszAdapterName, 4283 ulInstance, 0, aNetworkAdapter); 4286 4284 4287 4285 if (fTraceEnabled && fCableConnected && pINetCfg) … … 4299 4297 4300 4298 if (RT_FAILURE(vrc)) 4301 rc = E_FAIL;4299 hrc = E_FAIL; 4302 4300 4303 4301 alock.acquire(); … … 4312 4310 4313 4311 /* notify console callbacks on success */ 4314 if (SUCCEEDED( rc))4312 if (SUCCEEDED(hrc)) 4315 4313 ::FireNetworkAdapterChangedEvent(mEventSource, aNetworkAdapter); 4316 4314 4317 LogFlowThisFunc(("Leaving rc=%#x\n",rc));4318 return rc;4315 LogFlowThisFunc(("Leaving hrc=%#x\n", hrc)); 4316 return hrc; 4319 4317 } 4320 4318 … … 4334 4332 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 4335 4333 4336 HRESULT rc = S_OK;4334 HRESULT hrc = S_OK; 4337 4335 4338 4336 /* don't trigger NAT engine changes if the VM isn't running */ … … 4343 4341 { 4344 4342 ComPtr<INetworkAdapter> pNetworkAdapter; 4345 rc = i_machine()->GetNetworkAdapter(ulInstance, pNetworkAdapter.asOutParam());4346 if ( FAILED( rc)4343 hrc = i_machine()->GetNetworkAdapter(ulInstance, pNetworkAdapter.asOutParam()); 4344 if ( FAILED(hrc) 4347 4345 || pNetworkAdapter.isNull()) 4348 4346 break; … … 4353 4351 */ 4354 4352 NetworkAdapterType_T adapterType; 4355 rc = pNetworkAdapter->COMGETTER(AdapterType)(&adapterType);4356 if (FAILED( rc))4353 hrc = pNetworkAdapter->COMGETTER(AdapterType)(&adapterType); 4354 if (FAILED(hrc)) 4357 4355 { 4358 AssertComRC( rc);4359 rc = E_FAIL;4356 AssertComRC(hrc); 4357 hrc = E_FAIL; 4360 4358 break; 4361 4359 } … … 4371 4369 break; 4372 4370 ComAssertRC(vrc); 4373 rc = E_FAIL;4371 hrc = E_FAIL; 4374 4372 break; 4375 4373 } 4376 4374 4377 4375 NetworkAttachmentType_T attachmentType; 4378 rc = pNetworkAdapter->COMGETTER(AttachmentType)(&attachmentType);4379 if ( FAILED( rc)4376 hrc = pNetworkAdapter->COMGETTER(AttachmentType)(&attachmentType); 4377 if ( FAILED(hrc) 4380 4378 || attachmentType != NetworkAttachmentType_NAT) 4381 4379 { 4382 rc = E_FAIL;4380 hrc = E_FAIL; 4383 4381 break; 4384 4382 } … … 4403 4401 (uint16_t)aGuestPort); 4404 4402 if (RT_FAILURE(vrc)) 4405 rc = E_FAIL;4403 hrc = E_FAIL; 4406 4404 } while (0); /* break loop */ 4407 4405 ptrVM.release(); 4408 4406 } 4409 4407 4410 LogFlowThisFunc(("Leaving rc=%#x\n",rc));4411 return rc;4408 LogFlowThisFunc(("Leaving hrc=%#x\n", hrc)); 4409 return hrc; 4412 4410 } 4413 4411 … … 4488 4486 { 4489 4487 PPDMIBASE pBase; 4490 int rc = pVMM->pfnPDMR3QueryDriverOnLun(pUVM, pszDevice, ulInstance, 0 /* iLun */, "NAT", &pBase);4491 if (RT_FAILURE( rc))4488 int vrc = pVMM->pfnPDMR3QueryDriverOnLun(pUVM, pszDevice, ulInstance, 0 /* iLun */, "NAT", &pBase); 4489 if (RT_FAILURE(vrc)) 4492 4490 continue; 4493 4491 … … 4523 4521 * @param ppszVal Where to store the value on success. 4524 4522 */ 4525 int Console::i_consoleParseKeyValue(const char *psz, const char **ppszEnd, 4526 char **ppszKey, char **ppszVal) 4527 { 4528 int rc = VINF_SUCCESS; 4523 int Console::i_consoleParseKeyValue(const char *psz, const char **ppszEnd, char **ppszKey, char **ppszVal) 4524 { 4529 4525 const char *pszKeyStart = psz; 4530 const char *pszValStart = NULL;4531 size_t cchKey = 0;4532 size_t cchVal = 0;4533 4534 4526 while ( *psz != '=' 4535 4527 && *psz) … … 4540 4532 return VERR_INVALID_PARAMETER; 4541 4533 4542 cchKey = psz - pszKeyStart; 4543 psz++; /* Skip = character */ 4544 pszValStart = psz; 4534 size_t const cchKey = psz - pszKeyStart; 4535 4536 psz++; /* Skip '=' character */ 4537 const char *pszValStart = psz; 4545 4538 4546 4539 while ( *psz != ',' … … 4549 4542 && *psz) 4550 4543 psz++; 4551 4552 cchVal = psz - pszValStart; 4553 4544 size_t const cchVal = psz - pszValStart; 4545 4546 int vrc = VINF_SUCCESS; 4554 4547 if (cchKey && cchVal) 4555 4548 { … … 4558 4551 { 4559 4552 *ppszVal = RTStrDupN(pszValStart, cchVal); 4560 if (!*ppszVal) 4553 if (*ppszVal) 4554 *ppszEnd = psz; 4555 else 4561 4556 { 4562 4557 RTStrFree(*ppszKey); 4563 rc = VERR_NO_MEMORY;4558 vrc = VERR_NO_STR_MEMORY; 4564 4559 } 4565 4560 } 4566 4561 else 4567 rc = VERR_NO_MEMORY;4562 vrc = VERR_NO_STR_MEMORY; 4568 4563 } 4569 4564 else 4570 rc = VERR_INVALID_PARAMETER; 4571 4572 if (RT_SUCCESS(rc)) 4573 *ppszEnd = psz; 4574 4575 return rc; 4565 vrc = VERR_INVALID_PARAMETER; 4566 4567 return vrc; 4576 4568 } 4577 4569 … … 4678 4670 PPDMIBASE pIBase = NULL; 4679 4671 PPDMIMEDIA pIMedium = NULL; 4680 int rc = ptrVM.vtable()->pfnPDMR3QueryDriverOnLun(ptrVM.rawUVM(), pcszDevice, ulStorageCtrlInst, uLUN, "VD", &pIBase);4681 if (RT_SUCCESS( rc))4672 int vrc = ptrVM.vtable()->pfnPDMR3QueryDriverOnLun(ptrVM.rawUVM(), pcszDevice, ulStorageCtrlInst, uLUN, "VD", &pIBase); 4673 if (RT_SUCCESS(vrc)) 4682 4674 { 4683 4675 if (pIBase) … … 4687 4679 { 4688 4680 #ifdef VBOX_WITH_FULL_VM_ENCRYPTION 4689 rc = pIMedium->pfnSetSecKeyIf(pIMedium, fKeepSecIf ? mpIfSecKey : NULL, mpIfSecKeyHlp);4690 Assert(RT_SUCCESS( rc) ||rc == VERR_NOT_SUPPORTED);4681 vrc = pIMedium->pfnSetSecKeyIf(pIMedium, fKeepSecIf ? mpIfSecKey : NULL, mpIfSecKeyHlp); 4682 Assert(RT_SUCCESS(vrc) || vrc == VERR_NOT_SUPPORTED); 4691 4683 if (fKeepSecIf) 4692 4684 m_cDisksPwProvided++; 4693 4685 #else 4694 rc = pIMedium->pfnSetSecKeyIf(pIMedium, NULL, mpIfSecKeyHlp);4695 Assert(RT_SUCCESS( rc) ||rc == VERR_NOT_SUPPORTED);4686 vrc = pIMedium->pfnSetSecKeyIf(pIMedium, NULL, mpIfSecKeyHlp); 4687 Assert(RT_SUCCESS(vrc) || vrc == VERR_NOT_SUPPORTED); 4696 4688 #endif 4697 4689 } … … 4797 4789 PPDMIBASE pIBase = NULL; 4798 4790 PPDMIMEDIA pIMedium = NULL; 4799 int rc = ptrVM.vtable()->pfnPDMR3QueryDriverOnLun(ptrVM.rawUVM(), pcszDevice, ulStorageCtrlInst, uLUN, "VD", &pIBase);4800 if (RT_SUCCESS( rc))4791 int vrc = ptrVM.vtable()->pfnPDMR3QueryDriverOnLun(ptrVM.rawUVM(), pcszDevice, ulStorageCtrlInst, uLUN, "VD", &pIBase); 4792 if (RT_SUCCESS(vrc)) 4801 4793 { 4802 4794 if (pIBase) … … 4805 4797 if (pIMedium) 4806 4798 { 4807 rc = pIMedium->pfnSetSecKeyIf(pIMedium, NULL, mpIfSecKeyHlp);4808 Assert(RT_SUCCESS( rc) ||rc == VERR_NOT_SUPPORTED);4799 vrc = pIMedium->pfnSetSecKeyIf(pIMedium, NULL, mpIfSecKeyHlp); 4800 Assert(RT_SUCCESS(vrc) || vrc == VERR_NOT_SUPPORTED); 4809 4801 } 4810 4802 } … … 4975 4967 char *pszUuid = NULL; 4976 4968 char *pszKeyEnc = NULL; 4977 int rc = VINF_SUCCESS;4969 int vrc = VINF_SUCCESS; 4978 4970 HRESULT hrc = S_OK; 4979 4971 4980 4972 while ( *psz 4981 && RT_SUCCESS( rc))4973 && RT_SUCCESS(vrc)) 4982 4974 { 4983 4975 char *pszKey = NULL; … … 4985 4977 const char *pszEnd = NULL; 4986 4978 4987 rc = i_consoleParseKeyValue(psz, &pszEnd, &pszKey, &pszVal);4988 if (RT_SUCCESS( rc))4979 vrc = i_consoleParseKeyValue(psz, &pszEnd, &pszKey, &pszVal); 4980 if (RT_SUCCESS(vrc)) 4989 4981 { 4990 4982 if (!RTStrCmp(pszKey, "uuid")) … … 4993 4985 pszKeyEnc = pszVal; 4994 4986 else 4995 rc = VERR_INVALID_PARAMETER;4987 vrc = VERR_INVALID_PARAMETER; 4996 4988 4997 4989 RTStrFree(pszKey); … … 5016 5008 } 5017 5009 5018 if ( RT_SUCCESS( rc)5010 if ( RT_SUCCESS(vrc) 5019 5011 && pszUuid 5020 5012 && pszKeyEnc) … … 5027 5019 { 5028 5020 uint8_t *pbKey; 5029 rc = RTMemSaferAllocZEx((void **)&pbKey, cbKey, RTMEMSAFER_F_REQUIRE_NOT_PAGABLE);5030 if (RT_SUCCESS( rc))5021 vrc = RTMemSaferAllocZEx((void **)&pbKey, cbKey, RTMEMSAFER_F_REQUIRE_NOT_PAGABLE); 5022 if (RT_SUCCESS(vrc)) 5031 5023 { 5032 rc = RTBase64Decode(pszKeyEnc, pbKey, cbKey, NULL, NULL);5033 if (RT_SUCCESS( rc))5024 vrc = RTBase64Decode(pszKeyEnc, pbKey, cbKey, NULL, NULL); 5025 if (RT_SUCCESS(vrc)) 5034 5026 { 5035 rc = m_pKeyStore->addSecretKey(Utf8Str(pszUuid), pbKey, cbKey);5036 if (RT_SUCCESS( rc))5027 vrc = m_pKeyStore->addSecretKey(Utf8Str(pszUuid), pbKey, cbKey); 5028 if (RT_SUCCESS(vrc)) 5037 5029 { 5038 5030 hrc = i_configureEncryptionForDisk(Utf8Str(pszUuid), NULL); … … 5040 5032 { 5041 5033 /* Delete the key from the map. */ 5042 rc = m_pKeyStore->deleteSecretKey(Utf8Str(pszUuid));5043 AssertRC( rc);5034 vrc = m_pKeyStore->deleteSecretKey(Utf8Str(pszUuid)); 5035 AssertRC(vrc); 5044 5036 } 5045 5037 } 5046 5038 } 5047 5039 else 5048 hrc = setErrorBoth(E_FAIL, rc, tr("Failed to decode the key (%Rrc)"),rc);5040 hrc = setErrorBoth(E_FAIL, vrc, tr("Failed to decode the key (%Rrc)"), vrc); 5049 5041 5050 5042 RTMemSaferFree(pbKey, cbKey); 5051 5043 } 5052 5044 else 5053 hrc = setErrorBoth(E_FAIL, rc, tr("Failed to allocate secure memory for the key (%Rrc)"),rc);5045 hrc = setErrorBoth(E_FAIL, vrc, tr("Failed to allocate secure memory for the key (%Rrc)"), vrc); 5054 5046 } 5055 5047 else 5056 hrc = setError(E_FAIL, 5057 tr("The base64 encoding of the passed key is incorrect")); 5058 } 5059 else if (RT_SUCCESS(rc)) 5060 hrc = setError(E_FAIL, 5061 tr("The encryption configuration is incomplete")); 5048 hrc = setError(E_FAIL, tr("The base64 encoding of the passed key is incorrect")); 5049 } 5050 else if (RT_SUCCESS(vrc)) 5051 hrc = setError(E_FAIL, tr("The encryption configuration is incomplete")); 5062 5052 5063 5053 if (pszUuid) … … 5094 5084 { 5095 5085 /* Remove keys which are supposed to be removed on a suspend. */ 5096 int rc = m_pKeyStore->deleteAllSecretKeys(true /* fSuspend */, true /* fForce */);5097 AssertRC( rc); NOREF(rc);5086 int vrc = m_pKeyStore->deleteAllSecretKeys(true /* fSuspend */, true /* fForce */); 5087 AssertRC(vrc); 5098 5088 } 5099 5089 … … 5132 5122 * here to make requests from under the lock in order to serialize them. 5133 5123 */ 5134 int rc = pVMM->pfnVMR3ReqCallWaitU(pUVM, 0 /*idDstCpu*/,5135 (PFNRT)i_changeNetworkAttachment, 7,5136 this, pUVM, pVMM, pszDevice, uInstance, uLun, aNetworkAdapter);5124 int vrc = pVMM->pfnVMR3ReqCallWaitU(pUVM, 0 /*idDstCpu*/, 5125 (PFNRT)i_changeNetworkAttachment, 7, 5126 this, pUVM, pVMM, pszDevice, uInstance, uLun, aNetworkAdapter); 5137 5127 5138 5128 if (fResume) 5139 5129 i_resumeAfterConfigChange(pUVM, pVMM); 5140 5130 5141 if (RT_SUCCESS( rc))5131 if (RT_SUCCESS(vrc)) 5142 5132 return S_OK; 5143 5133 5144 return setErrorBoth(E_FAIL, rc, tr("Could not change the network adaptor attachement type (%Rrc)"),rc);5134 return setErrorBoth(E_FAIL, vrc, tr("Could not change the network adaptor attachement type (%Rrc)"), vrc); 5145 5135 } 5146 5136 … … 5205 5195 AssertRelease(pInst); 5206 5196 5207 int rc = pThis->i_configNetwork(pszDevice, uInstance, uLun, aNetworkAdapter, pCfg, pLunL0, pInst,5208 true /*fAttachDetach*/, false /*fIgnoreConnectFailure*/, pUVM, pVMM);5209 5210 LogFlowFunc(("Returning %Rrc\n", rc));5211 return rc;5197 int vrc = pThis->i_configNetwork(pszDevice, uInstance, uLun, aNetworkAdapter, pCfg, pLunL0, pInst, 5198 true /*fAttachDetach*/, false /*fIgnoreConnectFailure*/, pUVM, pVMM); 5199 5200 LogFlowFunc(("Returning %Rrc\n", vrc)); 5201 return vrc; 5212 5202 } 5213 5203 … … 5266 5256 if (SUCCEEDED(hrc)) 5267 5257 { 5268 int rc = VINF_SUCCESS;5258 int vrc = VINF_SUCCESS; 5269 5259 5270 5260 for (ULONG ulLUN = 0; ulLUN < 16 /** @todo Use a define */; ulLUN++) … … 5284 5274 && pAudioCon->pfnEnable) 5285 5275 { 5286 int rcIn = pAudioCon->pfnEnable(pAudioCon, PDMAUDIODIR_IN, RT_BOOL(fEnabledIn));5287 if (RT_FAILURE( rcIn))5288 LogRel(("Audio: Failed to %s input of LUN#%RU32, rc=%Rrc\n",5289 fEnabledIn ? "enable" : "disable", ulLUN, rcIn));5290 5291 if (RT_SUCCESS( rc))5292 rc =rcIn;5293 5294 int rcOut = pAudioCon->pfnEnable(pAudioCon, PDMAUDIODIR_OUT, RT_BOOL(fEnabledOut));5295 if (RT_FAILURE( rcOut))5296 LogRel(("Audio: Failed to %s output of LUN#%RU32, rc=%Rrc\n",5297 fEnabledIn ? "enable" : "disable", ulLUN, rcOut));5298 5299 if (RT_SUCCESS( rc))5300 rc =rcOut;5276 int vrcIn = pAudioCon->pfnEnable(pAudioCon, PDMAUDIODIR_IN, RT_BOOL(fEnabledIn)); 5277 if (RT_FAILURE(vrcIn)) 5278 LogRel(("Audio: Failed to %s input of LUN#%RU32, vrcIn=%Rrc\n", 5279 fEnabledIn ? "enable" : "disable", ulLUN, vrcIn)); 5280 5281 if (RT_SUCCESS(vrc)) 5282 vrc = vrcIn; 5283 5284 int vrcOut = pAudioCon->pfnEnable(pAudioCon, PDMAUDIODIR_OUT, RT_BOOL(fEnabledOut)); 5285 if (RT_FAILURE(vrcOut)) 5286 LogRel(("Audio: Failed to %s output of LUN#%RU32, vrcOut=%Rrc\n", 5287 fEnabledIn ? "enable" : "disable", ulLUN, vrcOut)); 5288 5289 if (RT_SUCCESS(vrc)) 5290 vrc = vrcOut; 5301 5291 } 5302 5292 } 5303 5293 } 5304 5294 5305 if (RT_SUCCESS( rc))5295 if (RT_SUCCESS(vrc)) 5306 5296 LogRel(("Audio: Status has changed (input is %s, output is %s)\n", 5307 5297 fEnabledIn ? "enabled" : "disabled", fEnabledOut ? "enabled" : "disabled")); … … 5318 5308 ::FireAudioAdapterChangedEvent(mEventSource, aAudioAdapter); 5319 5309 5320 LogFlowThisFunc(("Leaving rc=%#x\n", S_OK));5310 LogFlowThisFunc(("Leaving S_OKn")); 5321 5311 return S_OK; 5322 5312 } … … 5381 5371 5382 5372 HRESULT hrc = S_OK; 5383 int rc = VINF_SUCCESS;5373 int vrc = VINF_SUCCESS; 5384 5374 ULONG ulSlot; 5385 5375 hrc = pSerialPort->COMGETTER(Slot)(&ulSlot); … … 5399 5389 if (pThis->m_aeSerialPortMode[ulSlot] != PortMode_Disconnected) 5400 5390 { 5401 rc = pVMM->pfnPDMR3DeviceDetach(pUVM, "serial", ulSlot, 0, 0);5391 vrc = pVMM->pfnPDMR3DeviceDetach(pUVM, "serial", ulSlot, 0, 0); 5402 5392 PCFGMNODE pLunL0 = pVMM->pfnCFGMR3GetChildF(pInst, "LUN#0"); 5403 5393 pVMM->pfnCFGMR3RemoveNode(pLunL0); 5404 5394 } 5405 5395 5406 if (RT_SUCCESS( rc))5396 if (RT_SUCCESS(vrc)) 5407 5397 { 5408 5398 BOOL fServer; … … 5416 5406 && eHostMode != PortMode_Disconnected) 5417 5407 { 5418 rc = pThis->i_configSerialPort(pInst, eHostMode, Utf8Str(bstrPath).c_str(), RT_BOOL(fServer));5419 if (RT_SUCCESS( rc))5408 vrc = pThis->i_configSerialPort(pInst, eHostMode, Utf8Str(bstrPath).c_str(), RT_BOOL(fServer)); 5409 if (RT_SUCCESS(vrc)) 5420 5410 { 5421 5411 /* … … 5423 5413 */ 5424 5414 PPDMIBASE pBase; 5425 rc = pVMM->pfnPDMR3DeviceAttach(pUVM, "serial", ulSlot, 0, 0, &pBase);5415 vrc = pVMM->pfnPDMR3DeviceAttach(pUVM, "serial", ulSlot, 0, 0, &pBase); 5426 5416 5427 5417 pVMM->pfnCFGMR3Dump(pInst); … … 5432 5422 } 5433 5423 5434 if (RT_SUCCESS( rc) && FAILED(hrc))5435 rc = VERR_INTERNAL_ERROR;5436 5437 LogFlowFunc(("Returning %Rrc\n", rc));5438 return rc;5424 if (RT_SUCCESS(vrc) && FAILED(hrc)) 5425 vrc = VERR_INTERNAL_ERROR; 5426 5427 LogFlowFunc(("Returning %Rrc\n", vrc)); 5428 return vrc; 5439 5429 } 5440 5430 … … 5468 5458 PortMode_T eHostMode; 5469 5459 hrc = aSerialPort->COMGETTER(HostMode)(&eHostMode); 5470 if ( m_aeSerialPortMode[ulSlot] != eHostMode)5460 if (SUCCEEDED(hrc) && m_aeSerialPortMode[ulSlot] != eHostMode) 5471 5461 { 5472 5462 /* … … 5474 5464 */ 5475 5465 bool fResume = false; 5476 HRESULT hr= i_suspendBeforeConfigChange(ptrVM.rawUVM(), ptrVM.vtable(), NULL, &fResume);5477 if (FAILED(hr ))5478 return hr ;5466 hrc = i_suspendBeforeConfigChange(ptrVM.rawUVM(), ptrVM.vtable(), NULL, &fResume); 5467 if (FAILED(hrc)) 5468 return hrc; 5479 5469 5480 5470 /* … … 5482 5472 * using VM3ReqCallWait. 5483 5473 */ 5484 int rc = ptrVM.vtable()->pfnVMR3ReqCallWaitU(ptrVM.rawUVM(), 0 /*idDstCpu*/,5485 (PFNRT)i_changeSerialPortAttachment, 4,5486 this, ptrVM.rawUVM(), ptrVM.vtable(), aSerialPort);5474 int vrc = ptrVM.vtable()->pfnVMR3ReqCallWaitU(ptrVM.rawUVM(), 0 /*idDstCpu*/, 5475 (PFNRT)i_changeSerialPortAttachment, 4, 5476 this, ptrVM.rawUVM(), ptrVM.vtable(), aSerialPort); 5487 5477 5488 5478 if (fResume) 5489 5479 i_resumeAfterConfigChange(ptrVM.rawUVM(), ptrVM.vtable()); 5490 if (RT_SUCCESS( rc))5480 if (RT_SUCCESS(vrc)) 5491 5481 m_aeSerialPortMode[ulSlot] = eHostMode; 5492 5482 else 5493 hrc = setErrorBoth(E_FAIL, rc, tr("Failed to change the serial port attachment (%Rrc)"),rc);5483 hrc = setErrorBoth(E_FAIL, vrc, tr("Failed to change the serial port attachment (%Rrc)"), vrc); 5494 5484 } 5495 5485 } … … 5499 5489 ::FireSerialPortChangedEvent(mEventSource, aSerialPort); 5500 5490 5501 LogFlowThisFunc(("Leaving rc=%#x\n", S_OK));5491 LogFlowThisFunc(("Leaving hrc=%#x\n", hrc)); 5502 5492 return hrc; 5503 5493 } … … 5515 5505 ::FireParallelPortChangedEvent(mEventSource, aParallelPort); 5516 5506 5517 LogFlowThisFunc(("Leaving rc=%#x\n", S_OK));5507 LogFlowThisFunc(("Leaving S_OK\n")); 5518 5508 return S_OK; 5519 5509 } … … 5531 5521 ::FireStorageControllerChangedEvent(mEventSource, aMachineId.toString(), aControllerName); 5532 5522 5533 LogFlowThisFunc(("Leaving rc=%#x\n", S_OK));5523 LogFlowThisFunc(("Leaving S_OK\n")); 5534 5524 return S_OK; 5535 5525 } … … 5545 5535 AssertComRCReturnRC(autoCaller.rc()); 5546 5536 5547 HRESULT rc = S_OK;5537 HRESULT hrc = S_OK; 5548 5538 5549 5539 /* don't trigger medium changes if the VM isn't running */ … … 5551 5541 if (ptrVM.isOk()) 5552 5542 { 5553 rc = i_doMediumChange(aMediumAttachment, !!aForce, ptrVM.rawUVM(), ptrVM.vtable());5543 hrc = i_doMediumChange(aMediumAttachment, !!aForce, ptrVM.rawUVM(), ptrVM.vtable()); 5554 5544 ptrVM.release(); 5555 5545 } 5556 5546 5557 5547 /* notify console callbacks on success */ 5558 if (SUCCEEDED( rc))5548 if (SUCCEEDED(hrc)) 5559 5549 ::FireMediumChangedEvent(mEventSource, aMediumAttachment); 5560 5550 5561 LogFlowThisFunc(("Leaving rc=%#x\n",rc));5562 return rc;5551 LogFlowThisFunc(("Leaving hrc=%#x\n", hrc)); 5552 return hrc; 5563 5553 } 5564 5554 … … 5575 5565 AssertComRCReturnRC(autoCaller.rc()); 5576 5566 5577 HRESULT rc = S_OK;5567 HRESULT hrc = S_OK; 5578 5568 5579 5569 /* don't trigger CPU changes if the VM isn't running */ … … 5582 5572 { 5583 5573 if (aRemove) 5584 rc = i_doCPURemove(aCPU, ptrVM.rawUVM(), ptrVM.vtable());5574 hrc = i_doCPURemove(aCPU, ptrVM.rawUVM(), ptrVM.vtable()); 5585 5575 else 5586 rc = i_doCPUAdd(aCPU, ptrVM.rawUVM(), ptrVM.vtable());5576 hrc = i_doCPUAdd(aCPU, ptrVM.rawUVM(), ptrVM.vtable()); 5587 5577 ptrVM.release(); 5588 5578 } 5589 5579 5590 5580 /* notify console callbacks on success */ 5591 if (SUCCEEDED( rc))5581 if (SUCCEEDED(hrc)) 5592 5582 ::FireCPUChangedEvent(mEventSource, aCPU, aRemove); 5593 5583 5594 LogFlowThisFunc(("Leaving rc=%#x\n",rc));5595 return rc;5584 LogFlowThisFunc(("Leaving hrc=%#x\n", hrc)); 5585 return hrc; 5596 5586 } 5597 5587 … … 5610 5600 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 5611 5601 5612 HRESULT rc = S_OK;5602 HRESULT hrc = S_OK; 5613 5603 5614 5604 /* don't trigger the CPU priority change if the VM isn't running */ … … 5622 5612 { 5623 5613 /* No need to call in the EMT thread. */ 5624 rc = ptrVM.vtable()->pfnVMR3SetCpuExecutionCap(ptrVM.rawUVM(), aExecutionCap);5614 hrc = ptrVM.vtable()->pfnVMR3SetCpuExecutionCap(ptrVM.rawUVM(), aExecutionCap); 5625 5615 } 5626 5616 else 5627 rc = i_setInvalidMachineStateError();5617 hrc = i_setInvalidMachineStateError(); 5628 5618 ptrVM.release(); 5629 5619 } 5630 5620 5631 5621 /* notify console callbacks on success */ 5632 if (SUCCEEDED( rc))5622 if (SUCCEEDED(hrc)) 5633 5623 { 5634 5624 alock.release(); … … 5636 5626 } 5637 5627 5638 LogFlowThisFunc(("Leaving rc=%#x\n",rc));5639 return rc;5628 LogFlowThisFunc(("Leaving hrc=%#x\n", hrc)); 5629 return hrc; 5640 5630 } 5641 5631 … … 5654 5644 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 5655 5645 5656 HRESULT rc = S_OK;5646 HRESULT hrc = S_OK; 5657 5647 5658 5648 /* don't trigger the clipboard mode change if the VM isn't running */ … … 5666 5656 int vrc = i_changeClipboardMode(aClipboardMode); 5667 5657 if (RT_FAILURE(vrc)) 5668 rc = E_FAIL; /** @todo r=andy Set error info here?*/5658 hrc = E_FAIL; /** @todo r=andy Set error info here! */ 5669 5659 } 5670 5660 else 5671 rc = i_setInvalidMachineStateError();5661 hrc = i_setInvalidMachineStateError(); 5672 5662 ptrVM.release(); 5673 5663 } 5674 5664 5675 5665 /* notify console callbacks on success */ 5676 if (SUCCEEDED( rc))5666 if (SUCCEEDED(hrc)) 5677 5667 { 5678 5668 alock.release(); … … 5680 5670 } 5681 5671 5682 LogFlowThisFunc(("Leaving rc=%#x\n",rc));5683 return rc;5672 LogFlowThisFunc(("Leaving hrc=%#x\n", hrc)); 5673 return hrc; 5684 5674 } 5685 5675 … … 5698 5688 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 5699 5689 5700 HRESULT rc = S_OK;5690 HRESULT hrc = S_OK; 5701 5691 5702 5692 /* don't trigger the change if the VM isn't running */ … … 5710 5700 int vrc = i_changeClipboardFileTransferMode(aEnabled); 5711 5701 if (RT_FAILURE(vrc)) 5712 rc = E_FAIL; /** @todo r=andy Set error info here?*/5702 hrc = E_FAIL; /** @todo r=andy Set error info here! */ 5713 5703 } 5714 5704 else 5715 rc = i_setInvalidMachineStateError();5705 hrc = i_setInvalidMachineStateError(); 5716 5706 ptrVM.release(); 5717 5707 } 5718 5708 5719 5709 /* notify console callbacks on success */ 5720 if (SUCCEEDED( rc))5710 if (SUCCEEDED(hrc)) 5721 5711 { 5722 5712 alock.release(); … … 5724 5714 } 5725 5715 5726 LogFlowThisFunc(("Leaving rc=%#x\n",rc));5727 return rc;5716 LogFlowThisFunc(("Leaving hrc=%#x\n", hrc)); 5717 return hrc; 5728 5718 } 5729 5719 … … 5742 5732 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 5743 5733 5744 HRESULT rc = S_OK;5734 HRESULT hrc = S_OK; 5745 5735 5746 5736 /* don't trigger the drag and drop mode change if the VM isn't running */ … … 5753 5743 i_changeDnDMode(aDnDMode); 5754 5744 else 5755 rc = i_setInvalidMachineStateError();5745 hrc = i_setInvalidMachineStateError(); 5756 5746 ptrVM.release(); 5757 5747 } 5758 5748 5759 5749 /* notify console callbacks on success */ 5760 if (SUCCEEDED( rc))5750 if (SUCCEEDED(hrc)) 5761 5751 { 5762 5752 alock.release(); … … 5764 5754 } 5765 5755 5766 LogFlowThisFunc(("Leaving rc=%#x\n",rc));5767 return rc;5756 LogFlowThisFunc(("Leaving hrc=%#x\n", hrc)); 5757 return hrc; 5768 5758 } 5769 5759 … … 5821 5811 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 5822 5812 5823 HRESULT rc = S_OK;5813 HRESULT hrc = S_OK; 5824 5814 5825 5815 /* don't trigger VRDE server changes if the VM isn't running */ … … 5846 5836 BOOL vrdpEnabled = FALSE; 5847 5837 5848 rc = mVRDEServer->COMGETTER(Enabled)(&vrdpEnabled);5849 ComAssertComRCRetRC( rc);5838 hrc = mVRDEServer->COMGETTER(Enabled)(&vrdpEnabled); 5839 ComAssertComRCRetRC(hrc); 5850 5840 5851 5841 if (aRestart) … … 5865 5855 { 5866 5856 Utf8Str errMsg = VRDPServerErrorToMsg(vrc); 5867 rc = setErrorBoth(E_FAIL, vrc, errMsg.c_str());5857 hrc = setErrorBoth(E_FAIL, vrc, "%s", errMsg.c_str()); 5868 5858 } 5869 5859 else … … 5887 5877 } 5888 5878 else 5889 rc = i_setInvalidMachineStateError();5879 hrc = i_setInvalidMachineStateError(); 5890 5880 5891 5881 mfVRDEChangeInProcess = false; 5892 } while (mfVRDEChangePending && SUCCEEDED( rc));5882 } while (mfVRDEChangePending && SUCCEEDED(hrc)); 5893 5883 } 5894 5884 … … 5897 5887 5898 5888 /* notify console callbacks on success */ 5899 if (SUCCEEDED( rc))5889 if (SUCCEEDED(hrc)) 5900 5890 { 5901 5891 alock.release(); … … 5903 5893 } 5904 5894 5905 return rc;5895 return hrc; 5906 5896 } 5907 5897 … … 5945 5935 } 5946 5936 5947 HRESULT rc = RT_SUCCESS(vrc) ? S_OK5948 : setErrorBoth(VBOX_E_PDM_ERROR, vrc, tr("Sending monitor hot-plug event failed (%Rrc)"), vrc);5949 5950 LogFlowThisFunc((" rc=%Rhrc\n",rc));5937 HRESULT hrc = RT_SUCCESS(vrc) ? S_OK 5938 : setErrorBoth(VBOX_E_PDM_ERROR, vrc, tr("Sending monitor hot-plug event failed (%Rrc)"), vrc); 5939 5940 LogFlowThisFunc(("hrc=%Rhrc\n", hrc)); 5951 5941 LogFlowThisFuncLeave(); 5952 return rc;5942 return hrc; 5953 5943 } 5954 5944 … … 6058 6048 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 6059 6049 6060 HRESULT rc = S_OK;6050 HRESULT hrc = S_OK; 6061 6051 #ifdef VBOX_WITH_RECORDING 6062 6052 /* Don't trigger recording changes if the VM isn't running. */ … … 6073 6063 } 6074 6064 else /* Error set via ErrorInfo within i_recordingEnable() already. */ 6075 rc = VBOX_E_IPRT_ERROR;6065 hrc = VBOX_E_IPRT_ERROR; 6076 6066 ptrVM.release(); 6077 6067 } … … 6079 6069 RT_NOREF(fEnabled); 6080 6070 #endif /* VBOX_WITH_RECORDING */ 6081 return rc;6071 return hrc; 6082 6072 } 6083 6073 … … 6111 6101 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 6112 6102 6113 HRESULT rc = i_fetchSharedFolders(aGlobal);6103 HRESULT hrc = i_fetchSharedFolders(aGlobal); 6114 6104 6115 6105 /* notify console callbacks on success */ 6116 if (SUCCEEDED( rc))6106 if (SUCCEEDED(hrc)) 6117 6107 { 6118 6108 alock.release(); … … 6120 6110 } 6121 6111 6122 return rc;6112 return hrc; 6123 6113 } 6124 6114 … … 6145 6135 ::FireGuestDebugControlChangedEvent(mEventSource, aGuestDebugControl); 6146 6136 6147 LogFlowThisFunc(("Leaving rc=%#x\n", S_OK));6137 LogFlowThisFunc(("Leaving hrc=%#x\n", hrc)); 6148 6138 return hrc; 6149 6139 } … … 6203 6193 6204 6194 alock.release(); 6205 HRESULT rc = i_attachUSBDevice(aDevice, aMaskedIfs, aCaptureFilename);6206 if (FAILED( rc))6195 HRESULT hrc = i_attachUSBDevice(aDevice, aMaskedIfs, aCaptureFilename); 6196 if (FAILED(hrc)) 6207 6197 { 6208 6198 /* take the current error info */ … … 6218 6208 } 6219 6209 6220 return rc;6210 return hrc; 6221 6211 6222 6212 #else /* !VBOX_WITH_USB */ … … 6292 6282 6293 6283 alock.release(); 6294 HRESULT rc = i_detachUSBDevice(pUSBDevice);6295 if (FAILED( rc))6284 HRESULT hrc = i_detachUSBDevice(pUSBDevice); 6285 if (FAILED(hrc)) 6296 6286 { 6297 6287 /* Re-add the device to the collection */ … … 6311 6301 } 6312 6302 6313 return rc;6303 return hrc; 6314 6304 6315 6305 #else /* !VBOX_WITH_USB */ … … 6333 6323 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 6334 6324 6335 HRESULT rc = S_OK;6325 HRESULT hrc = S_OK; 6336 6326 6337 6327 /* don't trigger bandwidth group changes if the VM isn't running */ … … 6346 6336 /* No need to call in the EMT thread. */ 6347 6337 Bstr bstrName; 6348 rc = aBandwidthGroup->COMGETTER(Name)(bstrName.asOutParam());6349 if (SUCCEEDED( rc))6338 hrc = aBandwidthGroup->COMGETTER(Name)(bstrName.asOutParam()); 6339 if (SUCCEEDED(hrc)) 6350 6340 { 6351 6341 Utf8Str const strName(bstrName); 6352 6342 LONG64 cMax; 6353 rc = aBandwidthGroup->COMGETTER(MaxBytesPerSec)(&cMax);6354 if (SUCCEEDED( rc))6343 hrc = aBandwidthGroup->COMGETTER(MaxBytesPerSec)(&cMax); 6344 if (SUCCEEDED(hrc)) 6355 6345 { 6356 6346 BandwidthGroupType_T enmType; 6357 rc = aBandwidthGroup->COMGETTER(Type)(&enmType);6358 if (SUCCEEDED( rc))6347 hrc = aBandwidthGroup->COMGETTER(Type)(&enmType); 6348 if (SUCCEEDED(hrc)) 6359 6349 { 6360 6350 int vrc = VINF_SUCCESS; … … 6366 6356 vrc = ptrVM.vtable()->pfnPDMR3NsBwGroupSetLimit(ptrVM.rawUVM(), strName.c_str(), cMax); 6367 6357 else 6368 rc = E_NOTIMPL;6358 hrc = E_NOTIMPL; 6369 6359 #endif 6370 6360 AssertRC(vrc); … … 6374 6364 } 6375 6365 else 6376 rc = i_setInvalidMachineStateError();6366 hrc = i_setInvalidMachineStateError(); 6377 6367 ptrVM.release(); 6378 6368 } 6379 6369 6380 6370 /* notify console callbacks on success */ 6381 if (SUCCEEDED( rc))6371 if (SUCCEEDED(hrc)) 6382 6372 { 6383 6373 alock.release(); … … 6385 6375 } 6386 6376 6387 LogFlowThisFunc(("Leaving rc=%#x\n",rc));6388 return rc;6377 LogFlowThisFunc(("Leaving hrc=%#x\n", hrc)); 6378 return hrc; 6389 6379 } 6390 6380 … … 6401 6391 AssertComRCReturnRC(autoCaller.rc()); 6402 6392 6403 HRESULT rc = S_OK;6393 HRESULT hrc = S_OK; 6404 6394 6405 6395 /* don't trigger medium changes if the VM isn't running */ … … 6408 6398 { 6409 6399 if (aRemove) 6410 rc = i_doStorageDeviceDetach(aMediumAttachment, ptrVM.rawUVM(), ptrVM.vtable(), RT_BOOL(aSilent));6400 hrc = i_doStorageDeviceDetach(aMediumAttachment, ptrVM.rawUVM(), ptrVM.vtable(), RT_BOOL(aSilent)); 6411 6401 else 6412 rc = i_doStorageDeviceAttach(aMediumAttachment, ptrVM.rawUVM(), ptrVM.vtable(), RT_BOOL(aSilent));6402 hrc = i_doStorageDeviceAttach(aMediumAttachment, ptrVM.rawUVM(), ptrVM.vtable(), RT_BOOL(aSilent)); 6413 6403 ptrVM.release(); 6414 6404 } 6415 6405 6416 6406 /* notify console callbacks on success */ 6417 if (SUCCEEDED( rc))6407 if (SUCCEEDED(hrc)) 6418 6408 ::FireStorageDeviceChangedEvent(mEventSource, aMediumAttachment, aRemove, aSilent); 6419 6409 6420 LogFlowThisFunc(("Leaving rc=%#x\n",rc));6421 return rc;6410 LogFlowThisFunc(("Leaving hrc=%#x\n", hrc)); 6411 return hrc; 6422 6412 } 6423 6413 … … 6480 6470 * ptrVM, so there is no need to hold a lock of this */ 6481 6471 6482 HRESULT rc = E_UNEXPECTED;6472 HRESULT hrc = E_UNEXPECTED; 6483 6473 try 6484 6474 { … … 6515 6505 *aFlags = &szBuffer[strlen(szBuffer) + 1]; 6516 6506 6517 rc = S_OK;6507 hrc = S_OK; 6518 6508 } 6519 6509 else if (vrc == VERR_NOT_FOUND) 6520 6510 { 6521 6511 *aValue = ""; 6522 rc = S_OK;6512 hrc = S_OK; 6523 6513 } 6524 6514 else 6525 rc = setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("The VBoxGuestPropSvc service call failed with the error %Rrc"), vrc);6515 hrc = setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("The VBoxGuestPropSvc service call failed with the error %Rrc"), vrc); 6526 6516 } 6527 6517 catch(std::bad_alloc & /*e*/) 6528 6518 { 6529 rc = E_OUTOFMEMORY;6530 } 6531 6532 return rc;6519 hrc = E_OUTOFMEMORY; 6520 } 6521 6522 return hrc; 6533 6523 #endif /* VBOX_WITH_GUEST_PROPS */ 6534 6524 } … … 6650 6640 static DECLCALLBACK(int) onlineMergeMediumProgress(void *pvUser, unsigned uPercentage) 6651 6641 { 6652 HRESULT rc = S_OK;6642 HRESULT hrc = S_OK; 6653 6643 IProgress *pProgress = static_cast<IProgress *>(pvUser); 6654 6644 if (pProgress) … … 6656 6646 ComPtr<IInternalProgressControl> pProgressControl(pProgress); 6657 6647 AssertReturn(!!pProgressControl, VERR_INVALID_PARAMETER); 6658 rc = pProgressControl->SetCurrentOperationProgress(uPercentage);6659 } 6660 return SUCCEEDED( rc) ? VINF_SUCCESS : VERR_GENERAL_FAILURE;6648 hrc = pProgressControl->SetCurrentOperationProgress(uPercentage); 6649 } 6650 return SUCCEEDED(hrc) ? VINF_SUCCESS : VERR_GENERAL_FAILURE; 6661 6651 } 6662 6652 … … 6671 6661 AssertComRCReturnRC(autoCaller.rc()); 6672 6662 6673 HRESULT rc = S_OK;6663 HRESULT hrc = S_OK; 6674 6664 int vrc = VINF_SUCCESS; 6675 6665 … … 6695 6685 /** @todo AssertComRC -> AssertComRCReturn! Could potentially end up 6696 6686 * using uninitialized variables here. */ 6697 BOOL fBuiltinIOCache ;6698 rc = mMachine->COMGETTER(IOCacheEnabled)(&fBuiltinIOCache);6699 AssertComRC( rc);6687 BOOL fBuiltinIOCache = FALSE; 6688 hrc = mMachine->COMGETTER(IOCacheEnabled)(&fBuiltinIOCache); 6689 AssertComRC(hrc); 6700 6690 SafeIfaceArray<IStorageController> ctrls; 6701 rc = mMachine->COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(ctrls));6702 AssertComRC( rc);6703 LONG lDev ;6704 rc = aMediumAttachment->COMGETTER(Device)(&lDev);6705 AssertComRC( rc);6706 LONG lPort ;6707 rc = aMediumAttachment->COMGETTER(Port)(&lPort);6708 AssertComRC( rc);6709 IMedium *pMedium ;6710 rc = aMediumAttachment->COMGETTER(Medium)(&pMedium);6711 AssertComRC( rc);6691 hrc = mMachine->COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(ctrls)); 6692 AssertComRC(hrc); 6693 LONG lDev = -1; 6694 hrc = aMediumAttachment->COMGETTER(Device)(&lDev); 6695 AssertComRC(hrc); 6696 LONG lPort = -1; 6697 hrc = aMediumAttachment->COMGETTER(Port)(&lPort); 6698 AssertComRC(hrc); 6699 IMedium *pMedium = NULL; 6700 hrc = aMediumAttachment->COMGETTER(Medium)(&pMedium); 6701 AssertComRC(hrc); 6712 6702 Bstr mediumLocation; 6713 6703 if (pMedium) 6714 6704 { 6715 rc = pMedium->COMGETTER(Location)(mediumLocation.asOutParam());6716 AssertComRC( rc);6705 hrc = pMedium->COMGETTER(Location)(mediumLocation.asOutParam()); 6706 AssertComRC(hrc); 6717 6707 } 6718 6708 6719 6709 Bstr attCtrlName; 6720 rc = aMediumAttachment->COMGETTER(Controller)(attCtrlName.asOutParam());6721 AssertComRC( rc);6710 hrc = aMediumAttachment->COMGETTER(Controller)(attCtrlName.asOutParam()); 6711 AssertComRC(hrc); 6722 6712 ComPtr<IStorageController> pStorageController; 6723 6713 for (size_t i = 0; i < ctrls.size(); ++i) 6724 6714 { 6725 6715 Bstr ctrlName; 6726 rc = ctrls[i]->COMGETTER(Name)(ctrlName.asOutParam());6727 AssertComRC( rc);6716 hrc = ctrls[i]->COMGETTER(Name)(ctrlName.asOutParam()); 6717 AssertComRC(hrc); 6728 6718 if (attCtrlName == ctrlName) 6729 6719 { … … 6738 6728 6739 6729 StorageControllerType_T enmCtrlType; 6740 rc = pStorageController->COMGETTER(ControllerType)(&enmCtrlType);6741 AssertComRC( rc);6730 hrc = pStorageController->COMGETTER(ControllerType)(&enmCtrlType); 6731 AssertComRC(hrc); 6742 6732 const char *pcszDevice = i_storageControllerTypeToStr(enmCtrlType); 6743 6733 6744 6734 StorageBus_T enmBus; 6745 rc = pStorageController->COMGETTER(Bus)(&enmBus); 6746 AssertComRC(rc); 6747 ULONG uInstance; 6748 rc = pStorageController->COMGETTER(Instance)(&uInstance); 6749 AssertComRC(rc); 6750 BOOL fUseHostIOCache; 6751 rc = pStorageController->COMGETTER(UseHostIOCache)(&fUseHostIOCache); 6752 AssertComRC(rc); 6735 hrc = pStorageController->COMGETTER(Bus)(&enmBus); 6736 AssertComRC(hrc); 6737 6738 ULONG uInstance = 0; 6739 hrc = pStorageController->COMGETTER(Instance)(&uInstance); 6740 AssertComRC(hrc); 6741 6742 BOOL fUseHostIOCache = TRUE; 6743 hrc = pStorageController->COMGETTER(UseHostIOCache)(&fUseHostIOCache); 6744 AssertComRC(hrc); 6753 6745 6754 6746 unsigned uLUN; 6755 rc = Console::i_storageBusPortDeviceToLun(enmBus, lPort, lDev, uLUN);6756 AssertComRCReturnRC( rc);6747 hrc = Console::i_storageBusPortDeviceToLun(enmBus, lPort, lDev, uLUN); 6748 AssertComRCReturnRC(hrc); 6757 6749 6758 6750 Assert(mMachineState == MachineState_DeletingSnapshotOnline); … … 6760 6752 /* Pause the VM, as it might have pending IO on this drive */ 6761 6753 bool fResume = false; 6762 rc = i_suspendBeforeConfigChange(ptrVM.rawUVM(), ptrVM.vtable(), &alock, &fResume);6763 if (FAILED( rc))6764 return rc;6754 hrc = i_suspendBeforeConfigChange(ptrVM.rawUVM(), ptrVM.vtable(), &alock, &fResume); 6755 if (FAILED(hrc)) 6756 return hrc; 6765 6757 6766 6758 bool fInsertDiskIntegrityDrv = false; 6767 6759 Bstr strDiskIntegrityFlag; 6768 rc = mMachine->GetExtraData(Bstr("VBoxInternal2/EnableDiskIntegrityDriver").raw(), 6769 strDiskIntegrityFlag.asOutParam()); 6770 if ( rc == S_OK 6760 hrc = mMachine->GetExtraData(Bstr("VBoxInternal2/EnableDiskIntegrityDriver").raw(), strDiskIntegrityFlag.asOutParam()); 6761 if ( hrc == S_OK 6771 6762 && strDiskIntegrityFlag == "1") 6772 6763 fInsertDiskIntegrityDrv = true; … … 6777 6768 this, ptrVM.rawUVM(), ptrVM.vtable(), pcszDevice, uInstance, enmBus, 6778 6769 fUseHostIOCache, fBuiltinIOCache, fInsertDiskIntegrityDrv, true /* fSetupMerge */, 6779 aSourceIdx, aTargetIdx, aMediumAttachment, mMachineState, & rc);6770 aSourceIdx, aTargetIdx, aMediumAttachment, mMachineState, &hrc); 6780 6771 /* error handling is after resuming the VM */ 6781 6772 … … 6785 6776 if (RT_FAILURE(vrc)) 6786 6777 return setErrorBoth(E_FAIL, vrc, "%Rrc", vrc); 6787 if (FAILED( rc))6788 return rc;6778 if (FAILED(hrc)) 6779 return hrc; 6789 6780 6790 6781 PPDMIBASE pIBase = NULL; … … 6810 6801 alock.acquire(); 6811 6802 /* Pause the VM, as it might have pending IO on this drive */ 6812 rc = i_suspendBeforeConfigChange(ptrVM.rawUVM(), ptrVM.vtable(), &alock, &fResume);6813 if (FAILED( rc))6814 return rc;6803 hrc = i_suspendBeforeConfigChange(ptrVM.rawUVM(), ptrVM.vtable(), &alock, &fResume); 6804 if (FAILED(hrc)) 6805 return hrc; 6815 6806 alock.release(); 6816 6807 6817 6808 /* Update medium chain and state now, so that the VM can continue. */ 6818 rc = mControl->FinishOnlineMergeMedium();6809 hrc = mControl->FinishOnlineMergeMedium(); 6819 6810 6820 6811 vrc = ptrVM.vtable()->pfnVMR3ReqCallWaitU(ptrVM.rawUVM(), VMCPUID_ANY, … … 6822 6813 this, ptrVM.rawUVM(), ptrVM.vtable(), pcszDevice, uInstance, enmBus, 6823 6814 fUseHostIOCache, fBuiltinIOCache, fInsertDiskIntegrityDrv, false /* fSetupMerge */, 6824 0 /* uMergeSource */, 0 /* uMergeTarget */, aMediumAttachment, mMachineState, & rc);6815 0 /* uMergeSource */, 0 /* uMergeTarget */, aMediumAttachment, mMachineState, &hrc); 6825 6816 /* error handling is after resuming the VM */ 6826 6817 … … 6830 6821 if (RT_FAILURE(vrc)) 6831 6822 return setErrorBoth(E_FAIL, vrc, "%Rrc", vrc); 6832 if (FAILED( rc))6833 return rc;6834 6835 return rc;6823 if (FAILED(hrc)) 6824 return hrc; 6825 6826 return hrc; 6836 6827 } 6837 6828
Note:
See TracChangeset
for help on using the changeset viewer.