Changeset 94947 in vbox
- Timestamp:
- May 9, 2022 10:43:47 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r94893 r94947 223 223 */ 224 224 *pfGetKeyFromRealSMC = true; 225 int rc = VINF_SUCCESS;225 int vrc = VINF_SUCCESS; 226 226 227 227 #else … … 256 256 } 257 257 258 int rc = VINF_SUCCESS;258 int vrc = VINF_SUCCESS; 259 259 #endif 260 260 261 return rc;261 return vrc; 262 262 } 263 263 … … 784 784 ComPtr<IMachine> pMachine = i_machine(); 785 785 786 int rc;786 int vrc; 787 787 HRESULT hrc; 788 788 Utf8Str strTmp; … … 811 811 hrc = pMachine->COMGETTER(HardwareUUID)(bstr.asOutParam()); H(); 812 812 RTUUID HardwareUuid; 813 rc = RTUuidFromUtf16(&HardwareUuid, bstr.raw());814 AssertRCReturn( rc,rc);813 vrc = RTUuidFromUtf16(&HardwareUuid, bstr.raw()); 814 AssertRCReturn(vrc, vrc); 815 815 816 816 ULONG cRamMBs; … … 1449 1449 // VBoxC is located in the components subdirectory 1450 1450 char szPathVBoxC[RTPATH_MAX]; 1451 rc = RTPathAppPrivateArch(szPathVBoxC, RTPATH_MAX - sizeof("/components/VBoxC")); AssertRC(rc);1451 vrc = RTPathAppPrivateArch(szPathVBoxC, RTPATH_MAX - sizeof("/components/VBoxC")); AssertRC(vrc); 1452 1452 strcat(szPathVBoxC, "/components/VBoxC"); 1453 1453 InsertConfigString(pMod, "Path", szPathVBoxC); … … 1697 1697 bool fGetKeyFromRealSMC; 1698 1698 Utf8Str strKey; 1699 rc = getSmcDeviceKey(virtualBox, pMachine, &strKey, &fGetKeyFromRealSMC);1700 AssertRCReturn( rc,rc);1699 vrc = getSmcDeviceKey(virtualBox, pMachine, &strKey, &fGetKeyFromRealSMC); 1700 AssertRCReturn(vrc, vrc); 1701 1701 1702 1702 if (!fGetKeyFromRealSMC) … … 1843 1843 #endif 1844 1844 case GraphicsControllerType_VBoxVGA: 1845 rc = i_configGraphicsController(pDevices, enmGraphicsController, pBusMgr, pMachine, pGraphicsAdapter, biosSettings,1846 RT_BOOL(fHMEnabled));1847 if (FAILED( rc))1848 return rc;1845 vrc = i_configGraphicsController(pDevices, enmGraphicsController, pBusMgr, pMachine, pGraphicsAdapter, biosSettings, 1846 RT_BOOL(fHMEnabled)); 1847 if (FAILED(vrc)) 1848 return vrc; 1849 1849 break; 1850 1850 default: … … 1946 1946 #else 1947 1947 Utf8Str efiRomFile; 1948 rc = findEfiRom(virtualBox, eFwType, &efiRomFile);1949 AssertRCReturn( rc,rc);1948 vrc = findEfiRom(virtualBox, eFwType, &efiRomFile); 1949 AssertRCReturn(vrc, vrc); 1950 1950 const char *pszEfiRomFile = efiRomFile.c_str(); 1951 1951 #endif … … 2060 2060 { 2061 2061 USBControllerType_T enmCtrlType; 2062 rc = usbCtrls[i]->COMGETTER(Type)(&enmCtrlType);H();2062 vrc = usbCtrls[i]->COMGETTER(Type)(&enmCtrlType); H(); 2063 2063 if (enmCtrlType == USBControllerType_OHCI) 2064 2064 { … … 2090 2090 { 2091 2091 USBControllerType_T enmCtrlType; 2092 rc = usbCtrls[i]->COMGETTER(Type)(&enmCtrlType);H();2092 vrc = usbCtrls[i]->COMGETTER(Type)(&enmCtrlType); H(); 2093 2093 2094 2094 if (enmCtrlType == USBControllerType_OHCI) … … 2592 2592 { 2593 2593 IMediumAttachment *pMediumAtt = atts[j]; 2594 rc = i_configMediumAttachment(pszCtrlDev,2595 ulInstance,2596 enmBus,2597 !!fUseHostIOCache,2598 enmCtrlType == StorageControllerType_NVMe ? false : !!fBuiltinIOCache,2599 fInsertDiskIntegrityDrv,2600 false /* fSetupMerge */,2601 0 /* uMergeSource */,2602 0 /* uMergeTarget */,2603 pMediumAtt,2604 mMachineState,2605 NULL /* phrc */,2606 false /* fAttachDetach */,2607 false /* fForceUnmount */,2608 false /* fHotplug */,2609 pUVM,2610 pVMM,2611 paLedDevType,2612 NULL /* ppLunL0 */);2613 if (RT_FAILURE( rc))2614 return rc;2594 vrc = i_configMediumAttachment(pszCtrlDev, 2595 ulInstance, 2596 enmBus, 2597 !!fUseHostIOCache, 2598 enmCtrlType == StorageControllerType_NVMe ? false : !!fBuiltinIOCache, 2599 fInsertDiskIntegrityDrv, 2600 false /* fSetupMerge */, 2601 0 /* uMergeSource */, 2602 0 /* uMergeTarget */, 2603 pMediumAtt, 2604 mMachineState, 2605 NULL /* phrc */, 2606 false /* fAttachDetach */, 2607 false /* fForceUnmount */, 2608 false /* fHotplug */, 2609 pUVM, 2610 pVMM, 2611 paLedDevType, 2612 NULL /* ppLunL0 */); 2613 if (RT_FAILURE(vrc)) 2614 return vrc; 2615 2615 } 2616 2616 H(); … … 2856 2856 */ 2857 2857 bool fIgnoreConnectFailure = mMachineState == MachineState_Restoring; 2858 rc = i_configNetwork(pszAdapterName,2859 uInstance,2860 0,2861 networkAdapter,2862 pCfg,2863 pLunL0,2864 pInst,2865 false /*fAttachDetach*/,2866 fIgnoreConnectFailure,2867 pUVM,2868 pVMM);2869 if (RT_FAILURE( rc))2870 return rc;2858 vrc = i_configNetwork(pszAdapterName, 2859 uInstance, 2860 0, 2861 networkAdapter, 2862 pCfg, 2863 pLunL0, 2864 pInst, 2865 false /*fAttachDetach*/, 2866 fIgnoreConnectFailure, 2867 pUVM, 2868 pVMM); 2869 if (RT_FAILURE(vrc)) 2870 return vrc; 2871 2871 } 2872 2872 … … 2954 2954 if (eHostMode != PortMode_Disconnected) 2955 2955 { 2956 rc = i_configSerialPort(pInst, eHostMode, Utf8Str(bstr).c_str(), RT_BOOL(fServer));2957 if (RT_FAILURE( rc))2958 return rc;2956 vrc = i_configSerialPort(pInst, eHostMode, Utf8Str(bstr).c_str(), RT_BOOL(fServer)); 2957 if (RT_FAILURE(vrc)) 2958 return vrc; 2959 2959 } 2960 2960 } … … 3273 3273 AudioDriverCfg DrvCfgVRDE(pszAudioDevice, 0 /* Instance */, idxAudioLun, "AudioVRDE", 3274 3274 !!fAudioEnabledIn, !!fAudioEnabledOut); 3275 rc = mAudioVRDE->InitializeConfig(&DrvCfgVRDE);3276 AssertRCStmt( rc, throw ConfigError(__FUNCTION__,rc, "mAudioVRDE->InitializeConfig failed"));3275 vrc = mAudioVRDE->InitializeConfig(&DrvCfgVRDE); 3276 AssertRCStmt(vrc, throw ConfigError(__FUNCTION__, vrc, "mAudioVRDE->InitializeConfig failed")); 3277 3277 idxAudioLun++; 3278 3278 #endif … … 3284 3284 AudioDriverCfg DrvCfgVideoRec(pszAudioDevice, 0 /* Instance */, idxAudioLun, "AudioVideoRec", 3285 3285 false /*a_fEnabledIn*/, true /*a_fEnabledOut*/); 3286 rc = mRecording.mAudioRec->InitializeConfig(&DrvCfgVideoRec);3287 AssertRCStmt( rc, throw ConfigError(__FUNCTION__,rc, "Recording.mAudioRec->InitializeConfig failed"));3286 vrc = mRecording.mAudioRec->InitializeConfig(&DrvCfgVideoRec); 3287 AssertRCStmt(vrc, throw ConfigError(__FUNCTION__, vrc, "Recording.mAudioRec->InitializeConfig failed")); 3288 3288 idxAudioLun++; 3289 3289 #endif … … 3359 3359 } 3360 3360 3361 rc = RTLogGroupSettings(RTLogRelGetDefaultInstance(), strGroups.c_str());3362 if (RT_FAILURE( rc))3363 LogRel(("Audio: Setting debug logging failed, rc=%Rrc\n",rc));3361 vrc = RTLogGroupSettings(RTLogRelGetDefaultInstance(), strGroups.c_str()); 3362 if (RT_FAILURE(vrc)) 3363 LogRel(("Audio: Setting debug logging failed, vrc=%Rrc\n", vrc)); 3364 3364 } 3365 3365 } … … 3378 3378 3379 3379 /* Load the service */ 3380 rc = pVMMDev->hgcmLoadService("VBoxSharedClipboard", "VBoxSharedClipboard");3381 if (RT_SUCCESS( rc))3380 vrc = pVMMDev->hgcmLoadService("VBoxSharedClipboard", "VBoxSharedClipboard"); 3381 if (RT_SUCCESS(vrc)) 3382 3382 { 3383 3383 LogRel(("Shared Clipboard: Service loaded\n")); 3384 3384 3385 3385 /* Set initial clipboard mode. */ 3386 rc = i_changeClipboardMode(enmClipboardMode);3387 AssertLogRelMsg(RT_SUCCESS( rc), ("Shared Clipboard: Failed to set initial clipboard mode (%d):rc=%Rrc\n",3388 enmClipboardMode, rc));3386 vrc = i_changeClipboardMode(enmClipboardMode); 3387 AssertLogRelMsg(RT_SUCCESS(vrc), ("Shared Clipboard: Failed to set initial clipboard mode (%d): vrc=%Rrc\n", 3388 enmClipboardMode, vrc)); 3389 3389 3390 3390 /* Setup the service. */ 3391 3391 VBOXHGCMSVCPARM parm; 3392 3392 HGCMSvcSetU32(&parm, !i_useHostClipboard()); 3393 rc = pVMMDev->hgcmHostCall("VBoxSharedClipboard", VBOX_SHCL_HOST_FN_SET_HEADLESS, 1, &parm);3394 AssertLogRelMsg(RT_SUCCESS( rc), ("Shared Clipboard: Failed to set initial headless mode (%RTbool):rc=%Rrc\n",3395 !i_useHostClipboard(), rc));3393 vrc = pVMMDev->hgcmHostCall("VBoxSharedClipboard", VBOX_SHCL_HOST_FN_SET_HEADLESS, 1, &parm); 3394 AssertLogRelMsg(RT_SUCCESS(vrc), ("Shared Clipboard: Failed to set initial headless mode (%RTbool): vrc=%Rrc\n", 3395 !i_useHostClipboard(), vrc)); 3396 3396 3397 3397 # ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 3398 rc = i_changeClipboardFileTransferMode(RT_BOOL(fFileTransfersEnabled));3399 AssertLogRelMsg(RT_SUCCESS( rc), ("Shared Clipboard: Failed to set initial file transfers mode (%u):rc=%Rrc\n",3400 fFileTransfersEnabled, rc));3398 vrc = i_changeClipboardFileTransferMode(RT_BOOL(fFileTransfersEnabled)); 3399 AssertLogRelMsg(RT_SUCCESS(vrc), ("Shared Clipboard: Failed to set initial file transfers mode (%u): vrc=%Rrc\n", 3400 fFileTransfersEnabled, vrc)); 3401 3401 3402 3402 /** @todo Register area callbacks? (See also deregistration todo in Console::i_powerDown.) */ … … 3404 3404 } 3405 3405 else 3406 LogRel(("Shared Clipboard: Not available, rc=%Rrc\n",rc));3407 rc = VINF_SUCCESS; /* None of the potential failures above are fatal. */3406 LogRel(("Shared Clipboard: Not available, vrc=%Rrc\n", vrc)); 3407 vrc = VINF_SUCCESS; /* None of the potential failures above are fatal. */ 3408 3408 } 3409 3409 #endif /* VBOX_WITH_SHARED_CLIPBOARD */ … … 3420 3420 && value == "1") 3421 3421 { 3422 rc = pVMMDev->hgcmLoadService("VBoxHostChannel", "VBoxHostChannel");3423 if (RT_FAILURE( rc))3424 { 3425 LogRel(("VBoxHostChannel is not available, rc=%Rrc\n",rc));3422 vrc = pVMMDev->hgcmLoadService("VBoxHostChannel", "VBoxHostChannel"); 3423 if (RT_FAILURE(vrc)) 3424 { 3425 LogRel(("VBoxHostChannel is not available, vrc=%Rrc\n", vrc)); 3426 3426 /* That is not a fatal failure. */ 3427 rc = VINF_SUCCESS;3427 vrc = VINF_SUCCESS; 3428 3428 } 3429 3429 } … … 3439 3439 3440 3440 /* Load the service */ 3441 rc = pVMMDev->hgcmLoadService("VBoxDragAndDropSvc", "VBoxDragAndDropSvc");3442 if (RT_FAILURE( rc))3443 { 3444 LogRel(("Drag and drop service is not available, rc=%Rrc\n",rc));3441 vrc = pVMMDev->hgcmLoadService("VBoxDragAndDropSvc", "VBoxDragAndDropSvc"); 3442 if (RT_FAILURE(vrc)) 3443 { 3444 LogRel(("Drag and drop service is not available, vrc=%Rrc\n", vrc)); 3445 3445 /* That is not a fatal failure. */ 3446 rc = VINF_SUCCESS;3446 vrc = VINF_SUCCESS; 3447 3447 } 3448 3448 else 3449 3449 { 3450 rc = HGCMHostRegisterServiceExtension(&m_hHgcmSvcExtDragAndDrop, "VBoxDragAndDropSvc",3451 &GuestDnD::notifyDnDDispatcher,3452 GuestDnDInst());3453 if (RT_FAILURE( rc))3454 Log(("Cannot register VBoxDragAndDropSvc extension, rc=%Rrc\n",rc));3450 vrc = HGCMHostRegisterServiceExtension(&m_hHgcmSvcExtDragAndDrop, "VBoxDragAndDropSvc", 3451 &GuestDnD::notifyDnDDispatcher, 3452 GuestDnDInst()); 3453 if (RT_FAILURE(vrc)) 3454 Log(("Cannot register VBoxDragAndDropSvc extension, vrc=%Rrc\n", vrc)); 3455 3455 else 3456 3456 { 3457 3457 LogRel(("Drag and drop service loaded\n")); 3458 rc = i_changeDnDMode(enmMode);3458 vrc = i_changeDnDMode(enmMode); 3459 3459 } 3460 3460 } … … 3702 3702 3703 3703 char szHomeDir[RTPATH_MAX + 1]; 3704 int rc2 = RTPathUserHome(szHomeDir, sizeof(szHomeDir) - 1);3705 if (RT_FAILURE( rc2))3704 int vrc2 = RTPathUserHome(szHomeDir, sizeof(szHomeDir) - 1); 3705 if (RT_FAILURE(vrc2)) 3706 3706 szHomeDir[0] = '\0'; 3707 3707 RTPathEnsureTrailingSeparator(szHomeDir, sizeof(szHomeDir)); … … 3774 3774 * Call the extension pack hooks if everything went well thus far. 3775 3775 */ 3776 if (RT_SUCCESS( rc))3776 if (RT_SUCCESS(vrc)) 3777 3777 { 3778 3778 pAlock->release(); 3779 rc = mptrExtPackManager->i_callAllVmConfigureVmmHooks(this, pVM, pVMM);3779 vrc = mptrExtPackManager->i_callAllVmConfigureVmmHooks(this, pVM, pVMM); 3780 3780 pAlock->acquire(); 3781 3781 } … … 3785 3785 * Apply the CFGM overlay. 3786 3786 */ 3787 if (RT_SUCCESS( rc))3788 rc = i_configCfgmOverlay(pRoot, virtualBox, pMachine);3787 if (RT_SUCCESS(vrc)) 3788 vrc = i_configCfgmOverlay(pRoot, virtualBox, pMachine); 3789 3789 3790 3790 /* 3791 3791 * Dump all extradata API settings tweaks, both global and per VM. 3792 3792 */ 3793 if (RT_SUCCESS( rc))3794 rc = i_configDumpAPISettingsTweaks(virtualBox, pMachine);3793 if (RT_SUCCESS(vrc)) 3794 vrc = i_configDumpAPISettingsTweaks(virtualBox, pMachine); 3795 3795 3796 3796 #undef H … … 3801 3801 * Register VM state change handler. 3802 3802 */ 3803 int rc2 = pVMM->pfnVMR3AtStateRegister(pUVM, Console::i_vmstateChangeCallback, this);3804 AssertRC( rc2);3805 if (RT_SUCCESS( rc))3806 rc =rc2;3803 int vrc2 = pVMM->pfnVMR3AtStateRegister(pUVM, Console::i_vmstateChangeCallback, this); 3804 AssertRC(vrc2); 3805 if (RT_SUCCESS(vrc)) 3806 vrc = vrc2; 3807 3807 3808 3808 /* 3809 3809 * Register VM runtime error handler. 3810 3810 */ 3811 rc2 = pVMM->pfnVMR3AtRuntimeErrorRegister(pUVM, Console::i_atVMRuntimeErrorCallback, this);3812 AssertRC( rc2);3813 if (RT_SUCCESS( rc))3814 rc =rc2;3811 vrc2 = pVMM->pfnVMR3AtRuntimeErrorRegister(pUVM, Console::i_atVMRuntimeErrorCallback, this); 3812 AssertRC(vrc2); 3813 if (RT_SUCCESS(vrc)) 3814 vrc = vrc2; 3815 3815 3816 3816 pAlock->acquire(); 3817 3817 3818 LogFlowFunc(("vrc = %Rrc\n", rc));3818 LogFlowFunc(("vrc = %Rrc\n", vrc)); 3819 3819 LogFlowFuncLeave(); 3820 3820 3821 return rc;3821 return vrc; 3822 3822 } 3823 3823 … … 3966 3966 * extra data to support global settings with local overrides. 3967 3967 */ 3968 int rc = VINF_SUCCESS;3968 int vrc = VINF_SUCCESS; 3969 3969 bool fFirst = true; 3970 3970 try … … 4047 4047 { 4048 4048 /* create the node */ 4049 rc = mpVMM->pfnCFGMR3InsertNode(pRoot, pszExtraDataKey, &pNode);4050 if (RT_FAILURE( rc))4049 vrc = mpVMM->pfnCFGMR3InsertNode(pRoot, pszExtraDataKey, &pNode); 4050 if (RT_FAILURE(vrc)) 4051 4051 { 4052 AssertLogRelMsgRC( rc, ("failed to insert node '%s'\n", pszExtraDataKey));4052 AssertLogRelMsgRC(vrc, ("failed to insert node '%s'\n", pszExtraDataKey)); 4053 4053 continue; 4054 4054 } … … 4077 4077 /* check for type prefix first. */ 4078 4078 if (!strncmp(strCFGMValueUtf8.c_str(), RT_STR_TUPLE("string:"))) 4079 rc = mpVMM->pfnCFGMR3InsertString(pNode, pszCFGMValueName, strCFGMValueUtf8.c_str() + sizeof("string:") - 1);4079 vrc = mpVMM->pfnCFGMR3InsertString(pNode, pszCFGMValueName, strCFGMValueUtf8.c_str() + sizeof("string:") - 1); 4080 4080 else if (!strncmp(strCFGMValueUtf8.c_str(), RT_STR_TUPLE("integer:"))) 4081 4081 { 4082 rc = RTStrToUInt64Full(strCFGMValueUtf8.c_str() + sizeof("integer:") - 1, 0, &u64Value);4083 if (RT_SUCCESS( rc))4084 rc = mpVMM->pfnCFGMR3InsertInteger(pNode, pszCFGMValueName, u64Value);4082 vrc = RTStrToUInt64Full(strCFGMValueUtf8.c_str() + sizeof("integer:") - 1, 0, &u64Value); 4083 if (RT_SUCCESS(vrc)) 4084 vrc = mpVMM->pfnCFGMR3InsertInteger(pNode, pszCFGMValueName, u64Value); 4085 4085 } 4086 4086 else if (!strncmp(strCFGMValueUtf8.c_str(), RT_STR_TUPLE("bytes:"))) … … 4093 4093 if (pvBytes) 4094 4094 { 4095 rc = RTBase64Decode(pszBase64, pvBytes, cbValue, NULL, NULL);4096 if (RT_SUCCESS( rc))4097 rc = mpVMM->pfnCFGMR3InsertBytes(pNode, pszCFGMValueName, pvBytes, cbValue);4095 vrc = RTBase64Decode(pszBase64, pvBytes, cbValue, NULL, NULL); 4096 if (RT_SUCCESS(vrc)) 4097 vrc = mpVMM->pfnCFGMR3InsertBytes(pNode, pszCFGMValueName, pvBytes, cbValue); 4098 4098 RTMemTmpFree(pvBytes); 4099 4099 } 4100 4100 else 4101 rc = VERR_NO_TMP_MEMORY;4101 vrc = VERR_NO_TMP_MEMORY; 4102 4102 } 4103 4103 else if (cbValue == 0) 4104 rc = mpVMM->pfnCFGMR3InsertBytes(pNode, pszCFGMValueName, NULL, 0);4104 vrc = mpVMM->pfnCFGMR3InsertBytes(pNode, pszCFGMValueName, NULL, 0); 4105 4105 else 4106 rc = VERR_INVALID_BASE64_ENCODING;4106 vrc = VERR_INVALID_BASE64_ENCODING; 4107 4107 } 4108 4108 /* auto detect type. */ 4109 4109 else if (RT_SUCCESS(RTStrToUInt64Full(strCFGMValueUtf8.c_str(), 0, &u64Value))) 4110 rc = mpVMM->pfnCFGMR3InsertInteger(pNode, pszCFGMValueName, u64Value);4110 vrc = mpVMM->pfnCFGMR3InsertInteger(pNode, pszCFGMValueName, u64Value); 4111 4111 else 4112 rc = mpVMM->pfnCFGMR3InsertString(pNode, pszCFGMValueName, strCFGMValueUtf8.c_str());4113 AssertLogRelMsgRCBreak( rc, ("failed to insert CFGM value '%s' to key '%s'\n",4114 strCFGMValueUtf8.c_str(), pszExtraDataKey));4112 vrc = mpVMM->pfnCFGMR3InsertString(pNode, pszCFGMValueName, strCFGMValueUtf8.c_str()); 4113 AssertLogRelMsgRCBreak(vrc, ("failed to insert CFGM value '%s' to key '%s'\n", 4114 strCFGMValueUtf8.c_str(), pszExtraDataKey)); 4115 4115 } 4116 4116 } … … 4121 4121 return x.m_vrc; 4122 4122 } 4123 return rc;4123 return vrc; 4124 4124 } 4125 4125 … … 4389 4389 4390 4390 RTFSTYPE enmFsTypeFile = RTFSTYPE_UNKNOWN; 4391 int rc2 = RTFsQueryType(strFile.c_str(), &enmFsTypeFile);4392 AssertMsgRCReturn( rc2, ("Querying the file type of '%s' failed!\n", strFile.c_str()),rc2);4391 int vrc2 = RTFsQueryType(strFile.c_str(), &enmFsTypeFile); 4392 AssertMsgRCReturn(vrc2, ("Querying the file type of '%s' failed!\n", strFile.c_str()), vrc2); 4393 4393 4394 4394 /* Ignore the error code. On error, the file system type is still 'unknown' so … … 4427 4427 { 4428 4428 RTFILE file; 4429 int rc = RTFileOpen(&file, strFile.c_str(), RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE);4430 if (RT_SUCCESS( rc))4429 int vrc = RTFileOpen(&file, strFile.c_str(), RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE); 4430 if (RT_SUCCESS(vrc)) 4431 4431 { 4432 4432 RTFOFF maxSize; 4433 4433 /* Careful: This function will work only on selected local file systems! */ 4434 rc = RTFileQueryMaxSizeEx(file, &maxSize);4434 vrc = RTFileQueryMaxSizeEx(file, &maxSize); 4435 4435 RTFileClose(file); 4436 if ( RT_SUCCESS( rc)4436 if ( RT_SUCCESS(vrc) 4437 4437 && maxSize > 0 4438 4438 && i64Size > (LONG64)maxSize) … … 4587 4587 { 4588 4588 /* Unmount existing media only for floppy and DVD drives. */ 4589 int rc = VINF_SUCCESS;4589 int vrc = VINF_SUCCESS; 4590 4590 PPDMIBASE pBase; 4591 4591 if (enmBus == StorageBus_USB) 4592 rc = pVMM->pfnPDMR3UsbQueryDriverOnLun(pUVM, pcszDevice, uInstance, uLUN, "SCSI", &pBase);4592 vrc = pVMM->pfnPDMR3UsbQueryDriverOnLun(pUVM, pcszDevice, uInstance, uLUN, "SCSI", &pBase); 4593 4593 else if ( (enmBus == StorageBus_SAS || enmBus == StorageBus_SCSI || enmBus == StorageBus_VirtioSCSI) 4594 4594 || (enmBus == StorageBus_SATA && enmDevType == DeviceType_DVD)) 4595 rc = pVMM->pfnPDMR3QueryDriverOnLun(pUVM, pcszDevice, uInstance, uLUN, "SCSI", &pBase);4595 vrc = pVMM->pfnPDMR3QueryDriverOnLun(pUVM, pcszDevice, uInstance, uLUN, "SCSI", &pBase); 4596 4596 else /* IDE or Floppy */ 4597 rc = pVMM->pfnPDMR3QueryLun(pUVM, pcszDevice, uInstance, uLUN, &pBase);4598 4599 if (RT_FAILURE( rc))4597 vrc = pVMM->pfnPDMR3QueryLun(pUVM, pcszDevice, uInstance, uLUN, &pBase); 4598 4599 if (RT_FAILURE(vrc)) 4600 4600 { 4601 if ( rc == VERR_PDM_LUN_NOT_FOUND ||rc == VERR_PDM_NO_DRIVER_ATTACHED_TO_LUN)4602 rc = VINF_SUCCESS;4603 AssertRC( rc);4601 if (vrc == VERR_PDM_LUN_NOT_FOUND || vrc == VERR_PDM_NO_DRIVER_ATTACHED_TO_LUN) 4602 vrc = VINF_SUCCESS; 4603 AssertRC(vrc); 4604 4604 } 4605 4605 else … … 4609 4609 4610 4610 /* Unmount the media (but do not eject the medium!) */ 4611 rc = pIMount->pfnUnmount(pIMount, fForceUnmount, false /*=fEject*/);4612 if ( rc == VERR_PDM_MEDIA_NOT_MOUNTED)4613 rc = VINF_SUCCESS;4611 vrc = pIMount->pfnUnmount(pIMount, fForceUnmount, false /*=fEject*/); 4612 if (vrc == VERR_PDM_MEDIA_NOT_MOUNTED) 4613 vrc = VINF_SUCCESS; 4614 4614 /* for example if the medium is locked */ 4615 else if (RT_FAILURE( rc))4616 return rc;4615 else if (RT_FAILURE(vrc)) 4616 return vrc; 4617 4617 } 4618 4618 4619 return rc;4619 return vrc; 4620 4620 } 4621 4621 … … 4651 4651 PCFGMNODE *ppLunL0) 4652 4652 { 4653 int rc = VINF_SUCCESS;4653 int vrc = VINF_SUCCESS; 4654 4654 bool fAddLun = false; 4655 4655 … … 4667 4667 && !fHotplug) 4668 4668 { 4669 rc = i_unmountMediumFromGuest(pUVM, pVMM, enmBus, enmDevType, pcszDevice, uInstance, uLUN, fForceUnmount);4670 if (RT_FAILURE( rc))4671 return rc;4669 vrc = i_unmountMediumFromGuest(pUVM, pVMM, enmBus, enmDevType, pcszDevice, uInstance, uLUN, fForceUnmount); 4670 if (RT_FAILURE(vrc)) 4671 return vrc; 4672 4672 } 4673 4673 … … 4690 4690 char szDriver[128]; 4691 4691 RT_ZERO(szDriver); 4692 rc = pVMM->pfnCFGMR3QueryString(pDrvLun, "Driver", &szDriver[0], sizeof(szDriver));4693 if (RT_SUCCESS( rc))4692 vrc = pVMM->pfnCFGMR3QueryString(pDrvLun, "Driver", &szDriver[0], sizeof(szDriver)); 4693 if (RT_SUCCESS(vrc)) 4694 4694 pszDriverDetach = RTStrDup(&szDriver[0]); 4695 4695 … … 4699 4699 4700 4700 if (enmBus == StorageBus_USB) 4701 rc = pVMM->pfnPDMR3UsbDriverDetach(pUVM, pcszDevice, uInstance, uLUN, pszDriverDetach,4702 0 /* iOccurence */, fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG);4701 vrc = pVMM->pfnPDMR3UsbDriverDetach(pUVM, pcszDevice, uInstance, uLUN, pszDriverDetach, 4702 0 /* iOccurence */, fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG); 4703 4703 else 4704 rc = pVMM->pfnPDMR3DriverDetach(pUVM, pcszDevice, uInstance, uLUN, pszDriverDetach,4705 0 /* iOccurence */, fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG);4704 vrc = pVMM->pfnPDMR3DriverDetach(pUVM, pcszDevice, uInstance, uLUN, pszDriverDetach, 4705 0 /* iOccurence */, fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG); 4706 4706 4707 4707 if (pszDriverDetach) … … 4724 4724 } 4725 4725 } 4726 if ( rc == VERR_PDM_NO_DRIVER_ATTACHED_TO_LUN)4727 rc = VINF_SUCCESS;4728 AssertRCReturn( rc,rc);4726 if (vrc == VERR_PDM_NO_DRIVER_ATTACHED_TO_LUN) 4727 vrc = VINF_SUCCESS; 4728 AssertRCReturn(vrc, vrc); 4729 4729 4730 4730 /* … … 4759 4759 *ppLunL0 = pLunL0; 4760 4760 4761 return rc;4761 return vrc; 4762 4762 } 4763 4763 … … 4785 4785 try 4786 4786 { 4787 int rc = VINF_SUCCESS;4787 int vrc = VINF_SUCCESS; 4788 4788 HRESULT hrc; 4789 4789 Bstr bstr; … … 4848 4848 4849 4849 memset(aszUuid, 0, sizeof(aszUuid)); 4850 rc = RTUuidCreate(&UsbMsd.mUuid);4851 AssertRCReturn( rc,rc);4852 rc = RTUuidToStr(&UsbMsd.mUuid, aszUuid, sizeof(aszUuid));4853 AssertRCReturn( rc,rc);4850 vrc = RTUuidCreate(&UsbMsd.mUuid); 4851 AssertRCReturn(vrc, vrc); 4852 vrc = RTUuidToStr(&UsbMsd.mUuid, aszUuid, sizeof(aszUuid)); 4853 AssertRCReturn(vrc, vrc); 4854 4854 4855 4855 UsbMsd.iPort = uInstance; … … 4865 4865 } 4866 4866 4867 rc = i_removeMediumDriverFromVm(pCtlInst, pcszDevice, uInstance, uLUN, enmBus, fAttachDetach,4868 fHotplug, fForceUnmount, pUVM, pVMM, lType, &pLunL0);4869 if (RT_FAILURE( rc))4870 return rc;4867 vrc = i_removeMediumDriverFromVm(pCtlInst, pcszDevice, uInstance, uLUN, enmBus, fAttachDetach, 4868 fHotplug, fForceUnmount, pUVM, pVMM, lType, &pLunL0); 4869 if (RT_FAILURE(vrc)) 4870 return vrc; 4871 4871 if (ppLunL0) 4872 4872 *ppLunL0 = pLunL0; … … 4887 4887 || aMachineState == MachineState_Restoring)) 4888 4888 { 4889 rc = i_checkMediumLocation(ptrMedium, &fUseHostIOCache);4890 if (RT_FAILURE( rc))4891 return rc;4889 vrc = i_checkMediumLocation(ptrMedium, &fUseHostIOCache); 4890 if (RT_FAILURE(vrc)) 4891 return vrc; 4892 4892 } 4893 4893 … … 4940 4940 } 4941 4941 4942 rc = i_configMedium(pLunL0,4943 !!fPassthrough,4944 lType,4945 fUseHostIOCache,4946 fBuiltinIOCache,4947 fInsertDiskIntegrityDrv,4948 fSetupMerge,4949 uMergeSource,4950 uMergeTarget,4951 bstrBwGroup.isEmpty() ? NULL : Utf8Str(bstrBwGroup).c_str(),4952 !!fDiscard,4953 !!fNonRotational,4954 ptrMedium,4955 aMachineState,4956 phrc);4957 if (RT_FAILURE( rc))4958 return rc;4942 vrc = i_configMedium(pLunL0, 4943 !!fPassthrough, 4944 lType, 4945 fUseHostIOCache, 4946 fBuiltinIOCache, 4947 fInsertDiskIntegrityDrv, 4948 fSetupMerge, 4949 uMergeSource, 4950 uMergeTarget, 4951 bstrBwGroup.isEmpty() ? NULL : Utf8Str(bstrBwGroup).c_str(), 4952 !!fDiscard, 4953 !!fNonRotational, 4954 ptrMedium, 4955 aMachineState, 4956 phrc); 4957 if (RT_FAILURE(vrc)) 4958 return vrc; 4959 4959 4960 4960 if (fAttachDetach) … … 4968 4968 RTUuidCreate(&UsbMsd.mUuid); 4969 4969 UsbMsd.iPort = uInstance; 4970 rc = pVMM->pfnPDMR3UsbCreateEmulatedDevice(pUVM, pcszDevice, pCtlInst, &UsbMsd.mUuid, NULL);4971 if (RT_SUCCESS( rc))4970 vrc = pVMM->pfnPDMR3UsbCreateEmulatedDevice(pUVM, pcszDevice, pCtlInst, &UsbMsd.mUuid, NULL); 4971 if (RT_SUCCESS(vrc)) 4972 4972 mUSBStorageDevices.push_back(UsbMsd); 4973 4973 } 4974 4974 else 4975 rc = pVMM->pfnPDMR3UsbDriverAttach(pUVM, pcszDevice, uInstance, uLUN,4976 fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG, NULL /*ppBase*/);4975 vrc = pVMM->pfnPDMR3UsbDriverAttach(pUVM, pcszDevice, uInstance, uLUN, 4976 fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG, NULL /*ppBase*/); 4977 4977 } 4978 4978 else if ( !fHotplug 4979 4979 && ( (enmBus == StorageBus_SAS || enmBus == StorageBus_SCSI || enmBus == StorageBus_VirtioSCSI) 4980 4980 || (enmBus == StorageBus_SATA && lType == DeviceType_DVD))) 4981 rc = pVMM->pfnPDMR3DriverAttach(pUVM, pcszDevice, uInstance, uLUN,4982 fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG, NULL /*ppBase*/);4981 vrc = pVMM->pfnPDMR3DriverAttach(pUVM, pcszDevice, uInstance, uLUN, 4982 fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG, NULL /*ppBase*/); 4983 4983 else 4984 rc = pVMM->pfnPDMR3DeviceAttach(pUVM, pcszDevice, uInstance, uLUN,4985 fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG, NULL /*ppBase*/);4986 AssertRCReturn( rc,rc);4984 vrc = pVMM->pfnPDMR3DeviceAttach(pUVM, pcszDevice, uInstance, uLUN, 4985 fHotplug ? 0 : PDM_TACH_FLAGS_NOT_HOT_PLUG, NULL /*ppBase*/); 4986 AssertRCReturn(vrc, vrc); 4987 4987 4988 4988 /* … … 4991 4991 */ 4992 4992 PPDMIBASE pIBase = NULL; 4993 rc = pVMM->pfnPDMR3QueryDriverOnLun(pUVM, pcszDevice, uInstance, uLUN, "VD", &pIBase);4994 if (RT_SUCCESS( rc) && pIBase)4993 vrc = pVMM->pfnPDMR3QueryDriverOnLun(pUVM, pcszDevice, uInstance, uLUN, "VD", &pIBase); 4994 if (RT_SUCCESS(vrc) && pIBase) 4995 4995 { 4996 4996 PPDMIMEDIA pIMedium = (PPDMIMEDIA)pIBase->pfnQueryInterface(pIBase, PDMIMEDIA_IID); 4997 4997 if (pIMedium) 4998 4998 { 4999 rc = pIMedium->pfnSetSecKeyIf(pIMedium, mpIfSecKey, mpIfSecKeyHlp);5000 Assert(RT_SUCCESS( rc) ||rc == VERR_NOT_SUPPORTED);4999 vrc = pIMedium->pfnSetSecKeyIf(pIMedium, mpIfSecKey, mpIfSecKeyHlp); 5000 Assert(RT_SUCCESS(vrc) || vrc == VERR_NOT_SUPPORTED); 5001 5001 } 5002 5002 } … … 5401 5401 5402 5402 RTHTTP hHttp; 5403 int rc = RTHttpCreate(&hHttp);5404 if (RT_FAILURE( rc))5403 int vrc = RTHttpCreate(&hHttp); 5404 if (RT_FAILURE(vrc)) 5405 5405 { 5406 LogRel(("CLOUD-NET: Failed to create HTTP context (rc=%Rrc)\n", rc));5407 return rc;5406 LogRel(("CLOUD-NET: Failed to create HTTP context (rc=%Rrc)\n", vrc)); 5407 return vrc; 5408 5408 } 5409 5409 … … 5431 5431 const char *pcszProxyUrl = strProxyUrl.c_str(); 5432 5432 RTURIPARSED Parsed; 5433 rc = RTUriParse(pcszProxyUrl, &Parsed);5434 if (RT_FAILURE( rc))5435 { 5436 LogRel(("CLOUD-NET: Failed to parse proxy URL: %ls ( rc=%d)\n", proxyUrl.raw(),rc));5433 vrc = RTUriParse(pcszProxyUrl, &Parsed); 5434 if (RT_FAILURE(vrc)) 5435 { 5436 LogRel(("CLOUD-NET: Failed to parse proxy URL: %ls (vrc=%Rrc)\n", proxyUrl.raw(), vrc)); 5437 5437 return false; 5438 5438 } … … 5463 5463 else if (enmProxyMode == ProxyMode_System) 5464 5464 { 5465 rc = RTHttpUseSystemProxySettings(hHttp);5466 if (RT_FAILURE( rc))5467 { 5468 LogRel(("%s: RTHttpUseSystemProxySettings() failed: %Rrc", __FUNCTION__, rc));5465 vrc = RTHttpUseSystemProxySettings(hHttp); 5466 if (RT_FAILURE(vrc)) 5467 { 5468 LogRel(("%s: RTHttpUseSystemProxySettings() failed: %Rrc", __FUNCTION__, vrc)); 5469 5469 RTHttpDestroy(hHttp); 5470 return rc;5471 } 5472 rc = RTHttpQueryProxyInfoForUrl(hHttp, ("http://" + strIpAddr).c_str(), &ProxyInfo);5470 return vrc; 5471 } 5472 vrc = RTHttpQueryProxyInfoForUrl(hHttp, ("http://" + strIpAddr).c_str(), &ProxyInfo); 5473 5473 RTHttpDestroy(hHttp); 5474 if (RT_FAILURE( rc))5475 { 5476 LogRel(("CLOUD-NET: Failed to get proxy for %s (rc=%Rrc)\n", strIpAddr.c_str(), rc));5477 return rc;5474 if (RT_FAILURE(vrc)) 5475 { 5476 LogRel(("CLOUD-NET: Failed to get proxy for %s (rc=%Rrc)\n", strIpAddr.c_str(), vrc)); 5477 return vrc; 5478 5478 } 5479 5479 … … 5526 5526 RTHttpFreeProxyInfo(&ProxyInfo); 5527 5527 RTStrFree(pszProxyType); 5528 return rc;5528 return vrc; 5529 5529 } 5530 5530 … … 5573 5573 try 5574 5574 { 5575 int rc = VINF_SUCCESS;5575 int vrc = VINF_SUCCESS; 5576 5576 HRESULT hrc; 5577 5577 Bstr bstr; … … 5615 5615 if (fAttachDetach) 5616 5616 { 5617 rc = pVMM->pfnPDMR3DeviceDetach(pUVM, pszDevice, uInstance, uLun, 0 /*fFlags*/);5618 if ( rc == VINF_PDM_NO_DRIVER_ATTACHED_TO_LUN)5619 rc = VINF_SUCCESS;5620 AssertLogRelRCReturn( rc,rc);5617 vrc = pVMM->pfnPDMR3DeviceDetach(pUVM, pszDevice, uInstance, uLun, 0 /*fFlags*/); 5618 if (vrc == VINF_PDM_NO_DRIVER_ATTACHED_TO_LUN) 5619 vrc = VINF_SUCCESS; 5620 AssertLogRelRCReturn(vrc, vrc); 5621 5621 5622 5622 /* Nuke anything which might have been left behind. */ … … 6235 6235 } 6236 6236 RTNETADDRIPV4 ipAddr, ipMask; 6237 rc = bstrLowerIP.isEmpty() ? VERR_MISSING : RTNetStrToIPv4Addr(Utf8Str(bstrLowerIP).c_str(), &ipAddr);6238 if (RT_FAILURE( rc))6237 vrc = bstrLowerIP.isEmpty() ? VERR_MISSING : RTNetStrToIPv4Addr(Utf8Str(bstrLowerIP).c_str(), &ipAddr); 6238 if (RT_FAILURE(vrc)) 6239 6239 { 6240 6240 /* We failed to locate any valid config of this vboxnetX interface, assume defaults. */ … … 6244 6244 bstrNetworkMask.setNull(); 6245 6245 bstrUpperIP.setNull(); 6246 rc = RTNetStrToIPv4Addr(Utf8Str(bstrLowerIP).c_str(), &ipAddr);6247 AssertLogRelMsgReturn(RT_SUCCESS( rc), ("RTNetStrToIPv4Addr(%ls) failed, rc=%Rrc\n", bstrLowerIP.raw(),rc),6246 vrc = RTNetStrToIPv4Addr(Utf8Str(bstrLowerIP).c_str(), &ipAddr); 6247 AssertLogRelMsgReturn(RT_SUCCESS(vrc), ("RTNetStrToIPv4Addr(%ls) failed, vrc=%Rrc\n", bstrLowerIP.raw(), vrc), 6248 6248 VERR_MAIN_CONFIG_CONSTRUCTOR_COM_ERROR); 6249 6249 } 6250 rc = bstrNetworkMask.isEmpty() ? VERR_MISSING : RTNetStrToIPv4Addr(Utf8Str(bstrNetworkMask).c_str(), &ipMask);6251 if (RT_FAILURE( rc))6250 vrc = bstrNetworkMask.isEmpty() ? VERR_MISSING : RTNetStrToIPv4Addr(Utf8Str(bstrNetworkMask).c_str(), &ipMask); 6251 if (RT_FAILURE(vrc)) 6252 6252 { 6253 6253 LogRel(("NetworkAttachmentType_HostOnly: Invalid or missing network mask '%ls', using '%s' instead.\n", 6254 6254 bstrNetworkMask.raw(), VBOXNET_IPV4MASK_DEFAULT)); 6255 6255 bstrNetworkMask = VBOXNET_IPV4MASK_DEFAULT; 6256 rc = RTNetStrToIPv4Addr(Utf8Str(bstrNetworkMask).c_str(), &ipMask);6257 AssertLogRelMsgReturn(RT_SUCCESS( rc), ("RTNetStrToIPv4Addr(%ls) failed, rc=%Rrc\n", bstrNetworkMask.raw(),rc),6256 vrc = RTNetStrToIPv4Addr(Utf8Str(bstrNetworkMask).c_str(), &ipMask); 6257 AssertLogRelMsgReturn(RT_SUCCESS(vrc), ("RTNetStrToIPv4Addr(%ls) failed, vrc=%Rrc\n", bstrNetworkMask.raw(), vrc), 6258 6258 VERR_MAIN_CONFIG_CONSTRUCTOR_COM_ERROR); 6259 6259 } 6260 rc = bstrUpperIP.isEmpty() ? VERR_MISSING : RTNetStrToIPv4Addr(Utf8Str(bstrUpperIP).c_str(), &ipAddr);6261 if (RT_FAILURE( rc))6260 vrc = bstrUpperIP.isEmpty() ? VERR_MISSING : RTNetStrToIPv4Addr(Utf8Str(bstrUpperIP).c_str(), &ipAddr); 6261 if (RT_FAILURE(vrc)) 6262 6262 { 6263 6263 ipAddr.au32[0] = RT_H2N_U32((RT_N2H_U32(ipAddr.au32[0]) | ~RT_N2H_U32(ipMask.au32[0])) - 1); /* Do we need to exlude the last IP? */ … … 6331 6331 if (!SUCCEEDED(hrc)) 6332 6332 { 6333 LogRel(("NetworkAttachmentType_HostOnly: FindByName failed, rc (0x%x)\n",rc));6333 LogRel(("NetworkAttachmentType_HostOnly: FindByName failed, vrc=%Rrc\n", vrc)); 6334 6334 return pVMM->pfnVMR3SetError(pUVM, VERR_INTERNAL_ERROR, RT_SRC_POS, 6335 6335 N_("Nonexistent host networking interface, name '%ls'"), HostOnlyName.raw()); … … 6708 6708 #endif /* VBOX_WITH_CLOUD_NET */ 6709 6709 { 6710 if (SUCCEEDED(hrc) && RT_SUCCESS( rc))6710 if (SUCCEEDED(hrc) && RT_SUCCESS(vrc)) 6711 6711 { 6712 6712 if (fAttachDetach) 6713 6713 { 6714 rc = pVMM->pfnPDMR3DriverAttach(mpUVM, pszDevice, uInstance, uLun, 0 /*fFlags*/, NULL /* ppBase */);6715 //AssertRC( rc);6714 vrc = pVMM->pfnPDMR3DriverAttach(mpUVM, pszDevice, uInstance, uLun, 0 /*fFlags*/, NULL /* ppBase */); 6715 //AssertRC(vrc); 6716 6716 } 6717 6717
Note:
See TracChangeset
for help on using the changeset viewer.