- Timestamp:
- Nov 26, 2009 11:31:46 AM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r24872 r24989 1106 1106 1107 1107 const OVFReader reader = *m->pReader; 1108 1109 1108 // this is safe to access because this thread only gets started 1109 // if pReader != NULL 1110 1110 1111 1111 /* If an manifest file exists, verify the content. Therefor we need all … … 1167 1167 vrc); 1168 1168 /* Cleanup */ 1169 for (size_t i=1; i < filesList.size(); ++i) 1170 RTStrFree(pTestList[i].pszTestDigest); 1169 for (size_t j = 1; 1170 j < filesList.size(); 1171 ++j) 1172 RTStrFree(pTestList[j].pszTestDigest); 1171 1173 RTMemFree(pTestList); 1172 1174 if (FAILED(rc)) … … 1373 1375 /* We search for the first host network interface which 1374 1376 * is usable for bridged networking */ 1375 for (size_t i=0; i < nwInterfaces.size(); ++i) 1377 for (size_t j = 0; 1378 j < nwInterfaces.size(); 1379 ++j) 1376 1380 { 1377 1381 HostNetworkInterfaceType_T itype; 1378 rc = nwInterfaces[ i]->COMGETTER(InterfaceType)(&itype);1382 rc = nwInterfaces[j]->COMGETTER(InterfaceType)(&itype); 1379 1383 if (FAILED(rc)) throw rc; 1380 1384 if (itype == HostNetworkInterfaceType_Bridged) 1381 1385 { 1382 1386 Bstr name; 1383 rc = nwInterfaces[ i]->COMGETTER(Name)(name.asOutParam());1387 rc = nwInterfaces[j]->COMGETTER(Name)(name.asOutParam()); 1384 1388 if (FAILED(rc)) throw rc; 1385 1389 /* Set the interface name to attach to */ … … 1404 1408 /* We search for the first host network interface which 1405 1409 * is usable for host only networking */ 1406 for (size_t i=0; i < nwInterfaces.size(); ++i) 1410 for (size_t j = 0; 1411 j < nwInterfaces.size(); 1412 ++j) 1407 1413 { 1408 1414 HostNetworkInterfaceType_T itype; 1409 rc = nwInterfaces[ i]->COMGETTER(InterfaceType)(&itype);1415 rc = nwInterfaces[j]->COMGETTER(InterfaceType)(&itype); 1410 1416 if (FAILED(rc)) throw rc; 1411 1417 if (itype == HostNetworkInterfaceType_HostOnly) 1412 1418 { 1413 1419 Bstr name; 1414 rc = nwInterfaces[ i]->COMGETTER(Name)(name.asOutParam());1420 rc = nwInterfaces[j]->COMGETTER(Name)(name.asOutParam()); 1415 1421 if (FAILED(rc)) throw rc; 1416 1422 /* Set the interface name to attach to */ … … 1567 1573 1568 1574 // CD-ROMs next 1569 for (std::list<VirtualSystemDescriptionEntry*>::const_iterator it = vsdeCDROM.begin();1570 it != vsdeCDROM.end();1571 ++it)1575 for (std::list<VirtualSystemDescriptionEntry*>::const_iterator jt = vsdeCDROM.begin(); 1576 jt != vsdeCDROM.end(); 1577 ++jt) 1572 1578 { 1573 1579 // for now always attach to secondary master on IDE controller; 1574 1580 // there seems to be no useful information in OVF where else to 1575 // attach it (@todo test with latest versions of OVF software)1581 // attach jt (@todo test with latest versions of OVF software) 1576 1582 1577 1583 // find the IDE controller 1578 1584 const HardDiskController *pController = NULL; 1579 for (ControllersMap::const_iterator it = vsysThis.mapControllers.begin();1580 it != vsysThis.mapControllers.end();1581 ++ it)1585 for (ControllersMap::const_iterator kt = vsysThis.mapControllers.begin(); 1586 kt != vsysThis.mapControllers.end(); 1587 ++kt) 1582 1588 { 1583 if ( it->second.system == HardDiskController::IDE)1589 if (kt->second.system == HardDiskController::IDE) 1584 1590 { 1585 pController = & it->second;1591 pController = &kt->second; 1586 1592 } 1587 1593 } … … 4388 4394 CheckComRCReturnRC(autoCaller.rc()); 4389 4395 4390 AutoReadLock alock (this);4396 AutoReadLock alock1(this); 4391 4397 4392 4398 ComObjPtr<VirtualSystemDescription> pNewDesc; … … 4394 4400 try 4395 4401 { 4396 Bstr bstrName ;4402 Bstr bstrName1; 4397 4403 Bstr bstrDescription; 4398 4404 Bstr bstrGuestOSType; … … 4407 4413 4408 4414 // get name 4409 bstrName = mUserData->mName;4415 bstrName1 = mUserData->mName; 4410 4416 // get description 4411 4417 bstrDescription = mUserData->mDescription; … … 4454 4460 4455 4461 /* VM name */ 4456 Utf8Str strVMName(bstrName );4462 Utf8Str strVMName(bstrName1); 4457 4463 pNewDesc->addEntry(VirtualSystemDescriptionType_Name, 4458 4464 "", -
trunk/src/VBox/Main/ConsoleImpl.cpp
r24955 r24989 1055 1055 // don't lock the folder because methods we access are const 1056 1056 1057 Utf8Str name = folder-> name();1057 Utf8Str name = folder->getName(); 1058 1058 vrc = SSMR3PutU32(pSSM, (uint32_t)name.length() + 1 /* term. 0 */); 1059 1059 AssertRC(vrc); … … 1061 1061 AssertRC(vrc); 1062 1062 1063 Utf8Str hostPath = folder-> hostPath();1063 Utf8Str hostPath = folder->getHostPath(); 1064 1064 vrc = SSMR3PutU32(pSSM, (uint32_t)hostPath.length() + 1 /* term. 0 */); 1065 1065 AssertRC(vrc); … … 1067 1067 AssertRC(vrc); 1068 1068 1069 vrc = SSMR3PutBool(pSSM, !!folder-> writable());1069 vrc = SSMR3PutBool(pSSM, !!folder->isWritable()); 1070 1070 AssertRC(vrc); 1071 1071 } … … 2668 2668 pTask->mProgress.queryInterfaceTo(aProgress); 2669 2669 } 2670 catch (HRESULT rc)2670 catch (HRESULT erc) 2671 2671 { 2672 2672 delete pTask; 2673 NOREF( rc);2673 NOREF(erc); 2674 2674 mptrCancelableProgress.setNull(); 2675 2675 } … … 4792 4792 for (SharedFolderMap::const_iterator it = mSharedFolders.begin(); 4793 4793 it != mSharedFolders.end(); ++ it) 4794 sharedFolders[it->first] = SharedFolderData(it->second-> hostPath(), it->second->writable());4794 sharedFolders[it->first] = SharedFolderData(it->second->getHostPath(), it->second->isWritable()); 4795 4795 } 4796 4796 … … 5194 5194 { 5195 5195 PPDMIBASE pBase; 5196 intvrc = PDMR3QueryLun(mpVM, "usb-ohci", 0, 0, &pBase);5196 vrc = PDMR3QueryLun(mpVM, "usb-ohci", 0, 0, &pBase); 5197 5197 if (RT_SUCCESS(vrc)) 5198 5198 { … … 6061 6061 ComObjPtr<OUSBDevice> device; 6062 6062 device.createObject(); 6063 HRESULThrc = device->init(aHostDevice);6063 hrc = device->init(aHostDevice); 6064 6064 AssertComRC(hrc); 6065 6065 … … 6629 6629 * Mark all existing remote USB devices as dirty. 6630 6630 */ 6631 RemoteUSBDeviceList::iterator it = mRemoteUSBDevices.begin(); 6632 while (it != mRemoteUSBDevices.end()) 6631 for (RemoteUSBDeviceList::iterator it = mRemoteUSBDevices.begin(); 6632 it != mRemoteUSBDevices.end(); 6633 ++it) 6633 6634 { 6634 6635 (*it)->dirty(true); 6635 ++ it;6636 6636 } 6637 6637 … … 6653 6653 bool fNewDevice = true; 6654 6654 6655 it = mRemoteUSBDevices.begin(); 6656 while (it != mRemoteUSBDevices.end()) 6655 for (RemoteUSBDeviceList::iterator it = mRemoteUSBDevices.begin(); 6656 it != mRemoteUSBDevices.end(); 6657 ++it) 6657 6658 { 6658 6659 if ((*it)->devId() == e->id … … 6664 6665 break; 6665 6666 } 6666 6667 ++ it;6668 6667 } 6669 6668 … … 7309 7308 7310 7309 /* Pass all custom parameters. */ 7311 SafeArray<BSTR> names;7312 SafeArray<BSTR> values;7310 SafeArray<BSTR> aNames; 7311 SafeArray<BSTR> aValues; 7313 7312 hrc = medium->GetProperties(NULL, 7314 ComSafeArrayAsOutParam( names),7315 ComSafeArrayAsOutParam( values)); H();7316 7317 if ( names.size() != 0)7313 ComSafeArrayAsOutParam(aNames), 7314 ComSafeArrayAsOutParam(aValues)); H(); 7315 7316 if (aNames.size() != 0) 7318 7317 { 7319 7318 PCFGMNODE pVDC; 7320 7319 rc = CFGMR3InsertNode(pCur, "VDConfig", &pVDC); RC_CHECK(); 7321 for (size_t i = 0; i < names.size(); ++ i)7320 for (size_t i = 0; i < aNames.size(); ++ i) 7322 7321 { 7323 if ( values[i])7322 if (aValues[i]) 7324 7323 { 7325 Utf8Str name = names[i];7326 Utf8Str value = values[i];7324 Utf8Str name = aNames[i]; 7325 Utf8Str value = aValues[i]; 7327 7326 rc = CFGMR3InsertString(pVDC, name.c_str(), value.c_str()); 7328 7327 if ( !(name.compare("HostIPStack")) … … 7508 7507 * to access Console. 7509 7508 */ 7510 intvrc = VMR3ReqCallWait(that->mpVM,7511 7512 7513 7514 7515 7516 7517 7518 7519 7509 vrc = VMR3ReqCallWait(that->mpVM, 7510 VMCPUID_ANY, 7511 (PFNRT)reconfigureMedium, 7512 6, 7513 that->mpVM, 7514 lInstance, 7515 enmController, 7516 enmBus, 7517 atts[i], 7518 &rc); 7520 7519 if (RT_FAILURE(vrc)) 7521 7520 throw setError(E_FAIL, Console::tr("%Rrc"), vrc); -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r24948 r24989 1146 1146 1147 1147 /* Pass all custom parameters. */ 1148 SafeArray<BSTR> names;1149 SafeArray<BSTR> values;1148 SafeArray<BSTR> aNames; 1149 SafeArray<BSTR> aValues; 1150 1150 hrc = medium->GetProperties(NULL, 1151 ComSafeArrayAsOutParam( names),1152 ComSafeArrayAsOutParam( values));H();1153 1154 if ( names.size() != 0)1151 ComSafeArrayAsOutParam(aNames), 1152 ComSafeArrayAsOutParam(aValues)); H(); 1153 1154 if (aNames.size() != 0) 1155 1155 { 1156 1156 PCFGMNODE pVDC; 1157 1157 rc = CFGMR3InsertNode(pCur, "VDConfig", &pVDC); RC_CHECK(); 1158 for (size_t ii = 0; ii < names.size(); ++ii)1158 for (size_t ii = 0; ii < aNames.size(); ++ii) 1159 1159 { 1160 if ( values[ii])1160 if (aValues[ii]) 1161 1161 { 1162 Utf8Str name = names[ii];1163 Utf8Str value = values[ii];1162 Utf8Str name = aNames[ii]; 1163 Utf8Str value = aValues[ii]; 1164 1164 rc = CFGMR3InsertString(pVDC, name.c_str(), value.c_str()); AssertRC(rc); /** @todo r=bird: why not RC_HCECK here? (I added the AssertRC.)*/ 1165 1165 if ( name.compare("HostIPStack") == 0 -
trunk/src/VBox/Main/ConsoleImplTeleporter.cpp
r24917 r24989 1054 1054 * Do the job, when it returns we're done. 1055 1055 */ 1056 TeleporterStateTrg State(this, pVM, pProgress, pMachine, mControl, &hTimerLR, fStartPaused);1057 State.mstrPassword = strPassword;1058 State.mhServer = hServer;1059 1060 void *pvUser = static_cast<void *>(static_cast<TeleporterState *>(& State));1056 TeleporterStateTrg theState(this, pVM, pProgress, pMachine, mControl, &hTimerLR, fStartPaused); 1057 theState.mstrPassword = strPassword; 1058 theState.mhServer = hServer; 1059 1060 void *pvUser = static_cast<void *>(static_cast<TeleporterState *>(&theState)); 1061 1061 if (pProgress->setCancelCallback(teleporterProgressCancelCallback, pvUser)) 1062 1062 { 1063 1063 LogRel(("Teleporter: Waiting for incoming VM...\n")); 1064 vrc = RTTcpServerListen(hServer, Console::teleporterTrgServeConnection, & State);1064 vrc = RTTcpServerListen(hServer, Console::teleporterTrgServeConnection, &theState); 1065 1065 pProgress->setCancelCallback(NULL, NULL); 1066 1066 … … 1068 1068 if (vrc == VERR_TCP_SERVER_STOP) 1069 1069 { 1070 vrc = State.mRc;1070 vrc = theState.mRc; 1071 1071 /* Power off the VM on failure unless the state callback 1072 1072 already did that. */ … … 1252 1252 1253 1253 pState->moffStream = 0; 1254 void *pvUser = static_cast<void *>(static_cast<TeleporterState *>(pState));1255 vrc = VMR3LoadFromStream(pState->mpVM, &g_teleporterTcpOps, pvUser ,1256 teleporterProgressCallback, pvUser );1254 void *pvUser2 = static_cast<void *>(static_cast<TeleporterState *>(pState)); 1255 vrc = VMR3LoadFromStream(pState->mpVM, &g_teleporterTcpOps, pvUser2, 1256 teleporterProgressCallback, pvUser2); 1257 1257 if (RT_FAILURE(vrc)) 1258 1258 { … … 1265 1265 pState->mfStopReading = false; 1266 1266 size_t cbRead; 1267 vrc = teleporterTcpOpRead(pvUser , pState->moffStream, szCmd, 1, &cbRead);1267 vrc = teleporterTcpOpRead(pvUser2, pState->moffStream, szCmd, 1, &cbRead); 1268 1268 if (vrc != VERR_EOF) 1269 1269 { -
trunk/src/VBox/Main/HostImpl.cpp
r24403 r24989 1348 1348 /* notify the proxy (only when the filter is active) */ 1349 1349 if ( m->pUSBProxyService->isActive() 1350 && pFilter-> data().mActive)1351 { 1352 ComAssertRet(pFilter-> id() == NULL, E_FAIL);1353 pFilter-> id() = m->pUSBProxyService->insertFilter(&pFilter->data().mUSBFilter);1350 && pFilter->getData().mActive) 1351 { 1352 ComAssertRet(pFilter->getId() == NULL, E_FAIL); 1353 pFilter->getId() = m->pUSBProxyService->insertFilter(&pFilter->getData().mUSBFilter); 1354 1354 } 1355 1355 … … 1402 1402 1403 1403 /* notify the proxy (only when the filter is active) */ 1404 if (m->pUSBProxyService->isActive() && filter-> data().mActive)1405 { 1406 ComAssertRet (filter->id() != NULL, E_FAIL);1407 m->pUSBProxyService->removeFilter (filter->id());1408 filter-> id() = NULL;1404 if (m->pUSBProxyService->isActive() && filter->getData().mActive) 1405 { 1406 ComAssertRet(filter->getId() != NULL, E_FAIL); 1407 m->pUSBProxyService->removeFilter(filter->getId()); 1408 filter->getId() = NULL; 1409 1409 } 1410 1410 … … 1677 1677 1678 1678 /* notify the proxy (only when the filter is active) */ 1679 if (pFilter-> data().mActive)1679 if (pFilter->getData().mActive) 1680 1680 { 1681 1681 HostUSBDeviceFilter *flt = pFilter; /* resolve ambiguity */ 1682 flt-> id() = m->pUSBProxyService->insertFilter(&pFilter->data().mUSBFilter);1682 flt->getId() = m->pUSBProxyService->insertFilter(&pFilter->getData().mUSBFilter); 1683 1683 } 1684 1684 } … … 1775 1775 { 1776 1776 // insert/remove the filter from the proxy 1777 if (aFilter-> data().mActive)1777 if (aFilter->getData().mActive) 1778 1778 { 1779 ComAssertRet (aFilter->id() == NULL, E_FAIL);1780 aFilter-> id() = m->pUSBProxyService->insertFilter (&aFilter->data().mUSBFilter);1779 ComAssertRet(aFilter->getId() == NULL, E_FAIL); 1780 aFilter->getId() = m->pUSBProxyService->insertFilter(&aFilter->getData().mUSBFilter); 1781 1781 } 1782 1782 else 1783 1783 { 1784 ComAssertRet (aFilter->id() != NULL, E_FAIL);1785 m->pUSBProxyService->removeFilter (aFilter->id());1786 aFilter-> id() = NULL;1784 ComAssertRet(aFilter->getId() != NULL, E_FAIL); 1785 m->pUSBProxyService->removeFilter(aFilter->getId()); 1786 aFilter->getId() = NULL; 1787 1787 } 1788 1788 } 1789 1789 else 1790 1790 { 1791 if (aFilter-> data().mActive)1791 if (aFilter->getData().mActive) 1792 1792 { 1793 1793 // update the filter in the proxy 1794 ComAssertRet (aFilter->id() != NULL, E_FAIL);1795 m->pUSBProxyService->removeFilter (aFilter->id());1796 aFilter-> id() = m->pUSBProxyService->insertFilter (&aFilter->data().mUSBFilter);1794 ComAssertRet(aFilter->getId() != NULL, E_FAIL); 1795 m->pUSBProxyService->removeFilter(aFilter->getId()); 1796 aFilter->getId() = m->pUSBProxyService->insertFilter(&aFilter->getData().mUSBFilter); 1797 1797 } 1798 1798 } -
trunk/src/VBox/Main/MachineImpl.cpp
r24936 r24989 237 237 while (thatIt != thatFolders.end()) 238 238 { 239 if ( (*it)-> name() == (*thatIt)->name()240 && RTPathCompare(Utf8Str((*it)-> hostPath()).c_str(),241 Utf8Str((*thatIt)-> hostPath()).c_str()239 if ( (*it)->getName() == (*thatIt)->getName() 240 && RTPathCompare(Utf8Str((*it)->getHostPath()).c_str(), 241 Utf8Str((*thatIt)->getHostPath()).c_str() 242 242 ) == 0) 243 243 { … … 272 272 } 273 273 274 bool Machine::MediaData::operator== 274 bool Machine::MediaData::operator==(const MediaData &that) const 275 275 { 276 276 if (this == &that) … … 294 294 while (thatIt != thatAtts.end()) 295 295 { 296 if ((*it)->matches((*thatIt)->controllerName(), 297 (*thatIt)->port(), 298 (*thatIt)->device()) && 299 (*it)->passthrough() == (*thatIt)->passthrough() && 300 (*it)->medium().equalsTo ((*thatIt)->medium())) 296 if ( (*it)->matches((*thatIt)->getControllerName(), 297 (*thatIt)->getPort(), 298 (*thatIt)->getDevice()) 299 && (*it)->getPassthrough() == (*thatIt)->getPassthrough() 300 && (*it)->getMedium().equalsTo((*thatIt)->getMedium()) 301 ) 301 302 { 302 thatAtts.erase 303 thatAtts.erase(thatIt); 303 304 found = true; 304 305 break; … … 404 405 405 406 /* get the full file name */ 406 int vrc = mParent->calculateFullPath(strConfigFile, mData->m_strConfigFileFull);407 if (RT_FAILURE(vrc ))407 int vrc1 = mParent->calculateFullPath(strConfigFile, mData->m_strConfigFileFull); 408 if (RT_FAILURE(vrc1)) 408 409 return setError(VBOX_E_FILE_ERROR, 409 410 tr("Invalid machine settings file name '%s' (%Rrc)"), 410 411 strConfigFile.raw(), 411 vrc );412 vrc1); 412 413 413 414 if (aMode == Init_Registered) … … 1385 1386 } 1386 1387 1387 STDMETHODIMP Machine::GetCpuIdLeaf(ULONG id, ULONG *aValEax, ULONG *aValEbx, ULONG *aValEcx, ULONG *aValEdx)1388 STDMETHODIMP Machine::GetCpuIdLeaf(ULONG aId, ULONG *aValEax, ULONG *aValEbx, ULONG *aValEcx, ULONG *aValEdx) 1388 1389 { 1389 1390 CheckComArgOutPointerValid(aValEax); … … 1397 1398 AutoReadLock alock(this); 1398 1399 1399 switch( id)1400 { 1401 case 0x0:1402 case 0x1:1403 case 0x2:1404 case 0x3:1405 case 0x4:1406 case 0x5:1407 case 0x6:1408 case 0x7:1409 case 0x8:1410 case 0x9:1411 case 0xA:1412 if (mHWData->mCpuIdStdLeafs[id].ulId != id)1413 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is not set"), id);1414 1415 *aValEax = mHWData->mCpuIdStdLeafs[id].ulEax;1416 *aValEbx = mHWData->mCpuIdStdLeafs[id].ulEbx;1417 *aValEcx = mHWData->mCpuIdStdLeafs[id].ulEcx;1418 *aValEdx = mHWData->mCpuIdStdLeafs[id].ulEdx;1419 break;1420 1421 case 0x80000000:1422 case 0x80000001:1423 case 0x80000002:1424 case 0x80000003:1425 case 0x80000004:1426 case 0x80000005:1427 case 0x80000006:1428 case 0x80000007:1429 case 0x80000008:1430 case 0x80000009:1431 case 0x8000000A:1432 if (mHWData->mCpuIdExtLeafs[id - 0x80000000].ulId != id)1433 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is not set"), id);1434 1435 *aValEax = mHWData->mCpuIdExtLeafs[id - 0x80000000].ulEax;1436 *aValEbx = mHWData->mCpuIdExtLeafs[id - 0x80000000].ulEbx;1437 *aValEcx = mHWData->mCpuIdExtLeafs[id - 0x80000000].ulEcx;1438 *aValEdx = mHWData->mCpuIdExtLeafs[id - 0x80000000].ulEdx;1439 break;1440 1441 default:1442 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is out of range"), id);1443 } 1444 return S_OK; 1445 } 1446 1447 STDMETHODIMP Machine::SetCpuIdLeaf(ULONG id, ULONG aValEax, ULONG aValEbx, ULONG aValEcx, ULONG aValEdx)1400 switch(aId) 1401 { 1402 case 0x0: 1403 case 0x1: 1404 case 0x2: 1405 case 0x3: 1406 case 0x4: 1407 case 0x5: 1408 case 0x6: 1409 case 0x7: 1410 case 0x8: 1411 case 0x9: 1412 case 0xA: 1413 if (mHWData->mCpuIdStdLeafs[aId].ulId != aId) 1414 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is not set"), aId); 1415 1416 *aValEax = mHWData->mCpuIdStdLeafs[aId].ulEax; 1417 *aValEbx = mHWData->mCpuIdStdLeafs[aId].ulEbx; 1418 *aValEcx = mHWData->mCpuIdStdLeafs[aId].ulEcx; 1419 *aValEdx = mHWData->mCpuIdStdLeafs[aId].ulEdx; 1420 break; 1421 1422 case 0x80000000: 1423 case 0x80000001: 1424 case 0x80000002: 1425 case 0x80000003: 1426 case 0x80000004: 1427 case 0x80000005: 1428 case 0x80000006: 1429 case 0x80000007: 1430 case 0x80000008: 1431 case 0x80000009: 1432 case 0x8000000A: 1433 if (mHWData->mCpuIdExtLeafs[aId - 0x80000000].ulId != aId) 1434 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is not set"), aId); 1435 1436 *aValEax = mHWData->mCpuIdExtLeafs[aId - 0x80000000].ulEax; 1437 *aValEbx = mHWData->mCpuIdExtLeafs[aId - 0x80000000].ulEbx; 1438 *aValEcx = mHWData->mCpuIdExtLeafs[aId - 0x80000000].ulEcx; 1439 *aValEdx = mHWData->mCpuIdExtLeafs[aId - 0x80000000].ulEdx; 1440 break; 1441 1442 default: 1443 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is out of range"), aId); 1444 } 1445 return S_OK; 1446 } 1447 1448 STDMETHODIMP Machine::SetCpuIdLeaf(ULONG aId, ULONG aValEax, ULONG aValEbx, ULONG aValEcx, ULONG aValEdx) 1448 1449 { 1449 1450 AutoCaller autoCaller(this); … … 1455 1456 CheckComRCReturnRC(rc); 1456 1457 1457 switch( id)1458 { 1459 case 0x0:1460 case 0x1:1461 case 0x2:1462 case 0x3:1463 case 0x4:1464 case 0x5:1465 case 0x6:1466 case 0x7:1467 case 0x8:1468 case 0x9:1469 case 0xA:1470 AssertCompile(RT_ELEMENTS(mHWData->mCpuIdStdLeafs) == 0xA);1471 AssertRelease(id < RT_ELEMENTS(mHWData->mCpuIdStdLeafs));1472 mHWData->mCpuIdStdLeafs[id].ulId = id;1473 mHWData->mCpuIdStdLeafs[id].ulEax = aValEax;1474 mHWData->mCpuIdStdLeafs[id].ulEbx = aValEbx;1475 mHWData->mCpuIdStdLeafs[id].ulEcx = aValEcx;1476 mHWData->mCpuIdStdLeafs[id].ulEdx = aValEdx;1477 break;1478 1479 case 0x80000000:1480 case 0x80000001:1481 case 0x80000002:1482 case 0x80000003:1483 case 0x80000004:1484 case 0x80000005:1485 case 0x80000006:1486 case 0x80000007:1487 case 0x80000008:1488 case 0x80000009:1489 case 0x8000000A:1490 AssertCompile(RT_ELEMENTS(mHWData->mCpuIdExtLeafs) == 0xA);1491 AssertRelease(id - 0x80000000 < RT_ELEMENTS(mHWData->mCpuIdExtLeafs));1492 mHWData->mCpuIdExtLeafs[id - 0x80000000].ulId = id;1493 mHWData->mCpuIdExtLeafs[id - 0x80000000].ulEax = aValEax;1494 mHWData->mCpuIdExtLeafs[id - 0x80000000].ulEbx = aValEbx;1495 mHWData->mCpuIdExtLeafs[id - 0x80000000].ulEcx = aValEcx;1496 mHWData->mCpuIdExtLeafs[id - 0x80000000].ulEdx = aValEdx;1497 break;1498 1499 default:1500 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is out of range"), id);1501 } 1502 return S_OK; 1503 } 1504 1505 STDMETHODIMP Machine::RemoveCpuIdLeaf(ULONG id)1458 switch(aId) 1459 { 1460 case 0x0: 1461 case 0x1: 1462 case 0x2: 1463 case 0x3: 1464 case 0x4: 1465 case 0x5: 1466 case 0x6: 1467 case 0x7: 1468 case 0x8: 1469 case 0x9: 1470 case 0xA: 1471 AssertCompile(RT_ELEMENTS(mHWData->mCpuIdStdLeafs) == 0xA); 1472 AssertRelease(aId < RT_ELEMENTS(mHWData->mCpuIdStdLeafs)); 1473 mHWData->mCpuIdStdLeafs[aId].ulId = aId; 1474 mHWData->mCpuIdStdLeafs[aId].ulEax = aValEax; 1475 mHWData->mCpuIdStdLeafs[aId].ulEbx = aValEbx; 1476 mHWData->mCpuIdStdLeafs[aId].ulEcx = aValEcx; 1477 mHWData->mCpuIdStdLeafs[aId].ulEdx = aValEdx; 1478 break; 1479 1480 case 0x80000000: 1481 case 0x80000001: 1482 case 0x80000002: 1483 case 0x80000003: 1484 case 0x80000004: 1485 case 0x80000005: 1486 case 0x80000006: 1487 case 0x80000007: 1488 case 0x80000008: 1489 case 0x80000009: 1490 case 0x8000000A: 1491 AssertCompile(RT_ELEMENTS(mHWData->mCpuIdExtLeafs) == 0xA); 1492 AssertRelease(aId - 0x80000000 < RT_ELEMENTS(mHWData->mCpuIdExtLeafs)); 1493 mHWData->mCpuIdExtLeafs[aId - 0x80000000].ulId = aId; 1494 mHWData->mCpuIdExtLeafs[aId - 0x80000000].ulEax = aValEax; 1495 mHWData->mCpuIdExtLeafs[aId - 0x80000000].ulEbx = aValEbx; 1496 mHWData->mCpuIdExtLeafs[aId - 0x80000000].ulEcx = aValEcx; 1497 mHWData->mCpuIdExtLeafs[aId - 0x80000000].ulEdx = aValEdx; 1498 break; 1499 1500 default: 1501 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is out of range"), aId); 1502 } 1503 return S_OK; 1504 } 1505 1506 STDMETHODIMP Machine::RemoveCpuIdLeaf(ULONG aId) 1506 1507 { 1507 1508 AutoCaller autoCaller(this); … … 1513 1514 CheckComRCReturnRC(rc); 1514 1515 1515 switch( id)1516 { 1517 case 0x0:1518 case 0x1:1519 case 0x2:1520 case 0x3:1521 case 0x4:1522 case 0x5:1523 case 0x6:1524 case 0x7:1525 case 0x8:1526 case 0x9:1527 case 0xA:1528 AssertCompile(RT_ELEMENTS(mHWData->mCpuIdStdLeafs) == 0xA);1529 AssertRelease(id < RT_ELEMENTS(mHWData->mCpuIdStdLeafs));1530 /* Invalidate leaf. */1531 mHWData->mCpuIdStdLeafs[id].ulId = UINT32_MAX;1532 break;1533 1534 case 0x80000000:1535 case 0x80000001:1536 case 0x80000002:1537 case 0x80000003:1538 case 0x80000004:1539 case 0x80000005:1540 case 0x80000006:1541 case 0x80000007:1542 case 0x80000008:1543 case 0x80000009:1544 case 0x8000000A:1545 AssertCompile(RT_ELEMENTS(mHWData->mCpuIdExtLeafs) == 0xA);1546 AssertRelease(id - 0x80000000 < RT_ELEMENTS(mHWData->mCpuIdExtLeafs));1547 /* Invalidate leaf. */1548 mHWData->mCpuIdExtLeafs[id - 0x80000000].ulId = UINT32_MAX;1549 break;1550 1551 default:1552 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is out of range"), id);1516 switch(aId) 1517 { 1518 case 0x0: 1519 case 0x1: 1520 case 0x2: 1521 case 0x3: 1522 case 0x4: 1523 case 0x5: 1524 case 0x6: 1525 case 0x7: 1526 case 0x8: 1527 case 0x9: 1528 case 0xA: 1529 AssertCompile(RT_ELEMENTS(mHWData->mCpuIdStdLeafs) == 0xA); 1530 AssertRelease(aId < RT_ELEMENTS(mHWData->mCpuIdStdLeafs)); 1531 /* Invalidate leaf. */ 1532 mHWData->mCpuIdStdLeafs[aId].ulId = UINT32_MAX; 1533 break; 1534 1535 case 0x80000000: 1536 case 0x80000001: 1537 case 0x80000002: 1538 case 0x80000003: 1539 case 0x80000004: 1540 case 0x80000005: 1541 case 0x80000006: 1542 case 0x80000007: 1543 case 0x80000008: 1544 case 0x80000009: 1545 case 0x8000000A: 1546 AssertCompile(RT_ELEMENTS(mHWData->mCpuIdExtLeafs) == 0xA); 1547 AssertRelease(aId - 0x80000000 < RT_ELEMENTS(mHWData->mCpuIdExtLeafs)); 1548 /* Invalidate leaf. */ 1549 mHWData->mCpuIdExtLeafs[aId - 0x80000000].ulId = UINT32_MAX; 1550 break; 1551 1552 default: 1553 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is out of range"), aId); 1553 1554 } 1554 1555 return S_OK; … … 2345 2346 aDevice))) 2346 2347 { 2347 Medium *pMedium = pAttachTemp-> medium();2348 Medium *pMedium = pAttachTemp->getMedium(); 2348 2349 if (pMedium) 2349 2350 { … … 2351 2352 return setError(VBOX_E_OBJECT_IN_USE, 2352 2353 tr("Medium '%s' is already attached to device slot %d on port %d of controller '%ls' of this virtual machine"), 2353 pMedium->locationFull().raw(), aDevice, aControllerPort, aControllerName); 2354 pMedium->getLocationFull().raw(), 2355 aDevice, 2356 aControllerPort, 2357 aControllerName); 2354 2358 } 2355 2359 else … … 2359 2363 } 2360 2364 2361 Guid id(aId);2365 Guid uuid(aId); 2362 2366 2363 2367 ComObjPtr<Medium> medium; … … 2366 2370 case DeviceType_HardDisk: 2367 2371 /* find a hard disk by UUID */ 2368 rc = mParent->findHardDisk(& id, NULL, true /* aSetError */, &medium);2372 rc = mParent->findHardDisk(&uuid, NULL, true /* aSetError */, &medium); 2369 2373 CheckComRCReturnRC(rc); 2370 2374 break; 2371 2375 2372 2376 case DeviceType_DVD: 2373 if (! id.isEmpty())2377 if (!uuid.isEmpty()) 2374 2378 { 2375 2379 /* first search for host drive */ … … 2382 2386 /// @todo eliminate this conversion 2383 2387 ComObjPtr<Medium> med = (Medium *)drivevec[i]; 2384 if (med-> id() ==id)2388 if (med->getId() == uuid) 2385 2389 { 2386 2390 medium = med; … … 2393 2397 { 2394 2398 /* find a DVD image by UUID */ 2395 rc = mParent->findDVDImage(& id, NULL, true /* aSetError */, &medium);2399 rc = mParent->findDVDImage(&uuid, NULL, true /* aSetError */, &medium); 2396 2400 CheckComRCReturnRC(rc); 2397 2401 } … … 2404 2408 2405 2409 case DeviceType_Floppy: 2406 if (! id.isEmpty())2410 if (!uuid.isEmpty()) 2407 2411 { 2408 2412 /* first search for host drive */ … … 2415 2419 /// @todo eliminate this conversion 2416 2420 ComObjPtr<Medium> med = (Medium *)drivevec[i]; 2417 if (med-> id() ==id)2421 if (med->getId() == uuid) 2418 2422 { 2419 2423 medium = med; … … 2426 2430 { 2427 2431 /* find a floppy image by UUID */ 2428 rc = mParent->findFloppyImage(& id, NULL, true /* aSetError */, &medium);2432 rc = mParent->findFloppyImage(&uuid, NULL, true /* aSetError */, &medium); 2429 2433 CheckComRCReturnRC(rc); 2430 2434 } … … 2452 2456 return setError(VBOX_E_OBJECT_IN_USE, 2453 2457 tr("Medium '%s' is already attached to this virtual machine"), 2454 medium-> locationFull().raw());2458 medium->getLocationFull().raw()); 2455 2459 } 2456 2460 … … 2497 2501 * hard disks. */ 2498 2502 2499 if (medium-> parent().isNull())2503 if (medium->getParent().isNull()) 2500 2504 { 2501 2505 /* first, investigate the backup copy of the current hard disk … … 2515 2519 uint32_t level = 0; 2516 2520 MediumAttachment *pAttach = *it; 2517 ComObjPtr<Medium> pMedium = pAttach-> medium();2518 Assert(!pMedium.isNull() || pAttach-> type() != DeviceType_HardDisk);2521 ComObjPtr<Medium> pMedium = pAttach->getMedium(); 2522 Assert(!pMedium.isNull() || pAttach->getType() != DeviceType_HardDisk); 2519 2523 if (pMedium.isNull()) 2520 2524 continue; 2521 2525 2522 if (pMedium-> base(&level).equalsTo(medium))2526 if (pMedium->getBase(&level).equalsTo(medium)) 2523 2527 { 2524 2528 /* skip the hard disk if its currently attached (we … … 2553 2557 { 2554 2558 /* use the previously attached hard disk */ 2555 medium = (*foundIt)-> medium();2559 medium = (*foundIt)->getMedium(); 2556 2560 mediumCaller.attach(medium); 2557 2561 CheckComRCReturnRC(mediumCaller.rc()); … … 2584 2588 { 2585 2589 MediumAttachment *pAttach = *it; 2586 ComObjPtr<Medium> pMedium = pAttach-> medium();2587 Assert(!pMedium.isNull() || pAttach-> type() != DeviceType_HardDisk);2590 ComObjPtr<Medium> pMedium = pAttach->getMedium(); 2591 Assert(!pMedium.isNull() || pAttach->getType() != DeviceType_HardDisk); 2588 2592 if (pMedium.isNull()) 2589 2593 continue; 2590 2594 2591 2595 uint32_t level = 0; 2592 if (pMedium-> base(&level).equalsTo(medium))2596 if (pMedium->getBase(&level).equalsTo(medium)) 2593 2597 { 2594 2598 /* matched device, channel and bus (i.e. attached to the … … 2597 2601 * descendant of medium will be used 2598 2602 */ 2599 if ( (*it)-> device() == aDevice2600 && (*it)-> port() == aControllerPort2601 && (*it)-> controllerName() == aControllerName2603 if ( (*it)->getDevice() == aDevice 2604 && (*it)->getPort() == aControllerPort 2605 && (*it)->getControllerName() == aControllerName 2602 2606 ) 2603 2607 { … … 2617 2621 if (foundIt != snapAtts.end()) 2618 2622 { 2619 base = (*foundIt)-> medium();2623 base = (*foundIt)->getMedium(); 2620 2624 break; 2621 2625 } … … 2726 2730 aDevice, aControllerPort, aControllerName); 2727 2731 2728 ComObjPtr<Medium> oldmedium = pAttach-> medium();2729 DeviceType_T mediumType = pAttach-> type();2732 ComObjPtr<Medium> oldmedium = pAttach->getMedium(); 2733 DeviceType_T mediumType = pAttach->getType(); 2730 2734 2731 2735 if (pAttach->isImplicit()) … … 2806 2810 AutoWriteLock attLock(pAttach); 2807 2811 2808 if (pAttach-> type() != DeviceType_DVD)2812 if (pAttach->getType() != DeviceType_DVD) 2809 2813 return setError(E_INVALIDARG, 2810 2814 tr("Setting passthrough rejected as the device attached to device slot %d on port %d of controller '%ls' is not a DVD"), … … 2845 2849 * backup is not necessarily the same thing. */ 2846 2850 ComObjPtr<Medium> oldmedium; 2847 oldmedium = pAttach-> medium();2848 2849 Guid id(aId);2851 oldmedium = pAttach->getMedium(); 2852 2853 Guid uuid(aId); 2850 2854 ComObjPtr<Medium> medium; 2851 DeviceType_T mediumType = pAttach-> type();2855 DeviceType_T mediumType = pAttach->getType(); 2852 2856 switch (mediumType) 2853 2857 { 2854 2858 case DeviceType_DVD: 2855 if (! id.isEmpty())2859 if (!uuid.isEmpty()) 2856 2860 { 2857 2861 /* find a DVD by host device UUID */ … … 2864 2868 /// @todo eliminate this conversion 2865 2869 ComObjPtr<Medium> med = (Medium *)drivevec[i]; 2866 if ( id == med->id())2870 if (uuid == med->getId()) 2867 2871 { 2868 2872 medium = med; … … 2873 2877 /* find a DVD by UUID */ 2874 2878 if (medium.isNull()) 2875 rc = mParent->findDVDImage(& id, NULL, true /* aDoSetError */, &medium);2879 rc = mParent->findDVDImage(&uuid, NULL, true /* aDoSetError */, &medium); 2876 2880 } 2877 2881 CheckComRCReturnRC(rc); 2878 2882 break; 2879 2883 case DeviceType_Floppy: 2880 if (! id.isEmpty())2884 if (!uuid.isEmpty()) 2881 2885 { 2882 2886 /* find a Floppy by host device UUID */ … … 2889 2893 /// @todo eliminate this conversion 2890 2894 ComObjPtr<Medium> med = (Medium *)drivevec[i]; 2891 if ( id == med->id())2895 if (uuid == med->getId()) 2892 2896 { 2893 2897 medium = med; … … 2898 2902 /* find a Floppy by UUID */ 2899 2903 if (medium.isNull()) 2900 rc = mParent->findFloppyImage(& id, NULL, true /* aDoSetError */, &medium);2904 rc = mParent->findFloppyImage(&uuid, NULL, true /* aDoSetError */, &medium); 2901 2905 } 2902 2906 CheckComRCReturnRC(rc); … … 2980 2984 aDevice, aControllerPort, aControllerName); 2981 2985 2982 pAttach-> medium().queryInterfaceTo(aMedium);2986 pAttach->getMedium().queryInterfaceTo(aMedium); 2983 2987 2984 2988 return S_OK; … … 3287 3291 AutoReadLock alock(this); 3288 3292 3289 Guid id(aId);3293 Guid uuid(aId); 3290 3294 ComObjPtr<Snapshot> snapshot; 3291 3295 3292 HRESULT rc = findSnapshot (id, snapshot, true /* aSetError */);3296 HRESULT rc = findSnapshot(uuid, snapshot, true /* aSetError */); 3293 3297 snapshot.queryInterfaceTo(aSnapshot); 3294 3298 … … 3343 3347 3344 3348 sharedFolder.createObject(); 3345 rc = sharedFolder->init (machine(), aName, aHostPath, aWritable);3349 rc = sharedFolder->init(getMachine(), aName, aHostPath, aWritable); 3346 3350 CheckComRCReturnRC(rc); 3347 3351 … … 3917 3921 ++it) 3918 3922 { 3919 if ((*it)-> controllerName() == aName)3923 if ((*it)->getControllerName() == aName) 3920 3924 return setError(VBOX_E_OBJECT_IN_USE, 3921 3925 tr("Storage controller named '%ls' has still devices attached"), … … 3967 3971 { 3968 3972 uint32_t cBlocks; 3969 intrc = SSMR3GetU32(pSSM, &cBlocks);3973 rc = SSMR3GetU32(pSSM, &cBlocks); 3970 3974 AssertRCReturn(rc, rc); 3971 3975 … … 4656 4660 } 4657 4661 4658 Bstr type(aType);4662 Utf8Str strType(aType); 4659 4663 4660 4664 /* Qt is default */ 4661 4665 #ifdef VBOX_WITH_QTGUI 4662 if ( type == "gui" || type == "GUI/Qt")4666 if (strType == "gui" || strType == "GUI/Qt") 4663 4667 { 4664 4668 # ifdef RT_OS_DARWIN /* Avoid Launch Services confusing this with the selector by using a helper app. */ … … 4674 4678 const char * args[] = {szPath, "--startvm", idStr.c_str(), 0 }; 4675 4679 # else 4676 Utf8Str name = mUserData->mName;4677 const char * args[] = {szPath, "--comment", name.c_str(), "--startvm", idStr.c_str(), 0 };4680 Utf8Str strName = mUserData->mName; 4681 const char * args[] = {szPath, "--comment", strName.c_str(), "--startvm", idStr.c_str(), 0 }; 4678 4682 # endif 4679 4683 vrc = RTProcCreate(szPath, args, env, 0, &pid); … … 4687 4691 4688 4692 #ifdef VBOX_WITH_VBOXSDL 4689 if ( type == "sdl" || type == "GUI/SDL")4693 if (strType == "sdl" || strType == "GUI/SDL") 4690 4694 { 4691 4695 const char VBoxSDL_exe[] = "VBoxSDL" HOSTSUFF_EXE; … … 4697 4701 const char * args[] = {szPath, "--startvm", idStr.c_str(), 0 }; 4698 4702 # else 4699 Utf8Str name = mUserData->mName;4700 const char * args[] = {szPath, "--comment", name.c_str(), "--startvm", idStr.c_str(), 0 };4703 Utf8Str strName = mUserData->mName; 4704 const char * args[] = {szPath, "--comment", strName.c_str(), "--startvm", idStr.c_str(), 0 }; 4701 4705 # endif 4702 4706 vrc = RTProcCreate(szPath, args, env, 0, &pid); … … 4710 4714 4711 4715 #ifdef VBOX_WITH_HEADLESS 4712 if ( type == "headless"4713 || type == "capture"4716 if ( strType == "headless" 4717 || strType == "capture" 4714 4718 #ifdef VBOX_WITH_VRDP 4715 || type == "vrdp"4719 || strType == "vrdp" 4716 4720 #endif 4717 4721 ) … … 4726 4730 const char * args[] = {szPath, "--startvm", idStr.c_str(), 0, 0, 0 }; 4727 4731 # else 4728 Utf8Str name = mUserData->mName;4729 const char * args[] ={szPath, "--comment", name.c_str(), "--startvm", idStr.c_str(), 0, 0, 0 };4732 Utf8Str strName = mUserData->mName; 4733 const char * args[] ={szPath, "--comment", strName.c_str(), "--startvm", idStr.c_str(), 0, 0, 0 }; 4730 4734 # endif 4731 4735 #ifdef VBOX_WITH_VRDP 4732 if ( type == "headless")4736 if (strType == "headless") 4733 4737 { 4734 4738 unsigned pos = RT_ELEMENTS(args) - 3; … … 4737 4741 } 4738 4742 #endif 4739 if ( type == "capture")4743 if (strType == "capture") 4740 4744 { 4741 4745 unsigned pos = RT_ELEMENTS(args) - 3; … … 4751 4755 { 4752 4756 RTEnvDestroy (env); 4753 return setError (E_INVALIDARG, 4754 tr ("Invalid session type: '%ls'"), aType); 4757 return setError(E_INVALIDARG, 4758 tr("Invalid session type: '%s'"), 4759 strType.c_str()); 4755 4760 } 4756 4761 … … 4758 4763 4759 4764 if (RT_FAILURE(vrc)) 4760 return setError 4761 tr("Could not launch a process for the machine '%ls' (%Rrc)"),4762 mUserData->mName.raw(), vrc);4765 return setError(VBOX_E_IPRT_ERROR, 4766 tr("Could not launch a process for the machine '%ls' (%Rrc)"), 4767 mUserData->mName.raw(), vrc); 4763 4768 4764 4769 LogFlowThisFunc(("launched.pid=%d(0x%x)\n", pid, pid)); … … 4793 4798 mData->mSession.mPid = pid; 4794 4799 mData->mSession.mState = SessionState_Spawning; 4795 mData->mSession.mType = type;4800 mData->mSession.mType = strType; 4796 4801 4797 4802 LogFlowThisFuncLeave(); … … 5040 5045 rc = setError(E_FAIL, 5041 5046 tr("Virtual machine '%ls' has terminated unexpectedly during startup"), 5042 name().raw());5047 getName().raw()); 5043 5048 #endif 5044 5049 … … 5520 5525 ++it) 5521 5526 { 5522 ComObjPtr<Medium> hd = (*it)-> medium();5527 ComObjPtr<Medium> hd = (*it)->getMedium(); 5523 5528 if (hd.isNull()) 5524 5529 continue; 5525 HRESULT rc = hd->detachFrom(mData->mUuid, snapshotId());5530 HRESULT rc = hd->detachFrom(mData->mUuid, getSnapshotId()); 5526 5531 AssertComRC (rc); 5527 5532 } … … 5647 5652 { 5648 5653 AutoWriteLock alock(*it); 5649 found = (*it)-> name() == aName;5654 found = (*it)->getName() == aName; 5650 5655 if (found) 5651 5656 aSharedFolder = *it; … … 6220 6225 /// @todo eliminate this conversion 6221 6226 ComObjPtr<Medium> med = (Medium *)drivevec[i]; 6222 if ( dev.strHostDriveSrc == med-> name()6223 || dev.strHostDriveSrc == med-> location())6227 if ( dev.strHostDriveSrc == med->getName() 6228 || dev.strHostDriveSrc == med->getLocation()) 6224 6229 { 6225 6230 medium = med; … … 6247 6252 /// @todo eliminate this conversion 6248 6253 ComObjPtr<Medium> med = (Medium *)drivevec[i]; 6249 if ( hostDriveSrc == med-> name()6250 || hostDriveSrc == med-> location())6254 if ( hostDriveSrc == med->getName() 6255 || hostDriveSrc == med->getLocation()) 6251 6256 { 6252 6257 medium = med; … … 6280 6285 AutoWriteLock hdLock(medium); 6281 6286 6282 if (medium-> type() == MediumType_Immutable)6287 if (medium->getType() == MediumType_Immutable) 6283 6288 { 6284 6289 if (mType == IsSnapshotMachine) … … 6286 6291 tr("Immutable hard disk '%s' with UUID {%RTuuid} cannot be directly attached to snapshot with UUID {%RTuuid} " 6287 6292 "of the virtual machine '%ls' ('%s')"), 6288 medium-> locationFull().raw(),6293 medium->getLocationFull().raw(), 6289 6294 dev.uuid.raw(), 6290 6295 aSnapshotId->raw(), … … 6294 6299 return setError(E_FAIL, 6295 6300 tr("Immutable hard disk '%s' with UUID {%RTuuid} cannot be directly attached to the virtual machine '%ls' ('%s')"), 6296 medium-> locationFull().raw(),6301 medium->getLocationFull().raw(), 6297 6302 dev.uuid.raw(), 6298 6303 mUserData->mName.raw(), … … 6301 6306 6302 6307 if ( mType != IsSnapshotMachine 6303 && medium-> children().size() != 06308 && medium->getChildren().size() != 0 6304 6309 ) 6305 6310 return setError(E_FAIL, 6306 6311 tr("Hard disk '%s' with UUID {%RTuuid} cannot be directly attached to the virtual machine '%ls' ('%s') " 6307 6312 "because it has %d differencing child hard disks"), 6308 medium-> locationFull().raw(),6313 medium->getLocationFull().raw(), 6309 6314 dev.uuid.raw(), 6310 6315 mUserData->mName.raw(), 6311 6316 mData->m_strConfigFileFull.raw(), 6312 medium-> children().size());6317 medium->getChildren().size()); 6313 6318 6314 6319 if (findAttachment(mMediaData->mAttachments, … … 6316 6321 return setError(E_FAIL, 6317 6322 tr("Hard disk '%s' with UUID {%RTuuid} is already attached to the virtual machine '%ls' ('%s')"), 6318 medium-> locationFull().raw(),6323 medium->getLocationFull().raw(), 6319 6324 dev.uuid.raw(), 6320 6325 mUserData->mName.raw(), … … 6327 6332 return setError(E_FAIL, 6328 6333 tr("Device with unknown type is attached to the virtual machine '%s' ('%s')"), 6329 medium-> locationFull().raw(),6334 medium->getLocationFull().raw(), 6330 6335 mUserData->mName.raw(), 6331 6336 mData->m_strConfigFileFull.raw()); … … 6484 6489 ++it) 6485 6490 { 6486 if ((*it)-> controllerName() == aName)6491 if ((*it)->getControllerName() == aName) 6487 6492 atts.push_back(*it); 6488 6493 } … … 7029 7034 ComObjPtr<SharedFolder> pFolder = *it; 7030 7035 settings::SharedFolder sf; 7031 sf.strName = pFolder-> name();7032 sf.strHostPath = pFolder-> hostPath();7033 sf.fWritable = !!pFolder-> writable();7036 sf.strName = pFolder->getName(); 7037 sf.strHostPath = pFolder->getHostPath(); 7038 sf.fWritable = !!pFolder->isWritable(); 7034 7039 7035 7040 data.llSharedFolders.push_back(sf); … … 7143 7148 7144 7149 MediumAttachment *pAttach = *it; 7145 Medium *pMedium = pAttach-> medium();7146 7147 dev.deviceType = pAttach-> type();7148 dev.lPort = pAttach-> port();7149 dev.lDevice = pAttach-> device();7150 Medium *pMedium = pAttach->getMedium(); 7151 7152 dev.deviceType = pAttach->getType(); 7153 dev.lPort = pAttach->getPort(); 7154 dev.lDevice = pAttach->getDevice(); 7150 7155 if (pMedium) 7151 7156 { … … 7155 7160 return rc; 7156 7161 if (fHostDrive) 7157 dev.strHostDriveSrc = pMedium-> location();7162 dev.strHostDriveSrc = pMedium->getLocation(); 7158 7163 else 7159 dev.uuid = pMedium-> id();7160 dev.fPassThrough = pAttach-> passthrough();7164 dev.uuid = pMedium->getId(); 7165 dev.fPassThrough = pAttach->getPassthrough(); 7161 7166 } 7162 7167 … … 7294 7299 { 7295 7300 MediumAttachment* pAtt = *it; 7296 if (pAtt-> type() == DeviceType_HardDisk)7301 if (pAtt->getType() == DeviceType_HardDisk) 7297 7302 { 7298 Medium* pHD = pAtt-> medium();7303 Medium* pHD = pAtt->getMedium(); 7299 7304 Assert(pHD); 7300 7305 rc = pHD->LockRead (NULL); … … 7320 7325 MediumAttachment* pAtt = *it; 7321 7326 7322 DeviceType_T devType = pAtt-> type();7323 Medium* medium = pAtt-> medium();7327 DeviceType_T devType = pAtt->getType(); 7328 Medium* medium = pAtt->getMedium(); 7324 7329 7325 7330 if ( devType != DeviceType_HardDisk 7326 7331 || medium == NULL 7327 || medium-> type() != MediumType_Normal)7332 || medium->getType() != MediumType_Normal) 7328 7333 { 7329 7334 /* copy the attachment as is */ … … 7339 7344 else 7340 7345 aProgress->SetNextOperation(BstrFmt(tr("Skipping medium '%s'"), 7341 medium-> base()->name().raw()),7346 medium->getBase()->getName().raw()), 7342 7347 aWeight); // weight 7343 7348 } … … 7349 7354 /* need a diff */ 7350 7355 aProgress->SetNextOperation(BstrFmt(tr("Creating differencing hard disk for '%s'"), 7351 medium-> base()->name().raw()),7356 medium->getBase()->getName().raw()), 7352 7357 aWeight); // weight 7353 7358 … … 7395 7400 rc = attachment->init(this, 7396 7401 diff, 7397 pAtt-> controllerName(),7398 pAtt-> port(),7399 pAtt-> device(),7402 pAtt->getControllerName(), 7403 pAtt->getPort(), 7404 pAtt->getDevice(), 7400 7405 DeviceType_HardDisk, 7401 7406 true /* aImplicit */); … … 7461 7466 ++it) 7462 7467 { 7463 ComObjPtr<Medium> hd = (*it)-> medium();7468 ComObjPtr<Medium> hd = (*it)->getMedium(); 7464 7469 if (hd.isNull()) 7465 7470 continue; … … 7468 7473 { 7469 7474 /* deassociate and mark for deletion */ 7470 LogFlowThisFunc(("Detaching '%s', pending deletion\n", (*it)-> logName()));7475 LogFlowThisFunc(("Detaching '%s', pending deletion\n", (*it)->getLogName())); 7471 7476 rc = hd->detachFrom(mData->mUuid); 7472 7477 AssertComRC(rc); … … 7479 7484 { 7480 7485 /* no: de-associate */ 7481 LogFlowThisFunc(("Detaching '%s', no deletion\n", (*it)-> logName()));7486 LogFlowThisFunc(("Detaching '%s', no deletion\n", (*it)->getLogName())); 7482 7487 rc = hd->detachFrom(mData->mUuid); 7483 7488 AssertComRC(rc); 7484 7489 continue; 7485 7490 } 7486 LogFlowThisFunc(("Not detaching '%s'\n", (*it)-> logName()));7491 LogFlowThisFunc(("Not detaching '%s'\n", (*it)->getLogName())); 7487 7492 } 7488 7493 … … 7512 7517 ++it) 7513 7518 { 7514 LogFlowThisFunc(("Deleting '%s'\n", (*it)-> logName()));7515 ComObjPtr<Medium> hd = (*it)-> medium();7519 LogFlowThisFunc(("Deleting '%s'\n", (*it)->getLogName())); 7520 ComObjPtr<Medium> hd = (*it)->getMedium(); 7516 7521 7517 7522 rc = hd->deleteStorageAndWait(); … … 7519 7524 if (rc == VBOX_E_INVALID_OBJECT_STATE) 7520 7525 { 7521 LogFlowFunc(("Applying unlock hack on '%s'! FIXME!\n", (*it)-> logName()));7526 LogFlowFunc(("Applying unlock hack on '%s'! FIXME!\n", (*it)->getLogName())); 7522 7527 hd->UnlockWrite(NULL); 7523 7528 rc = hd->deleteStorageAndWait(); 7524 7529 } 7525 7530 #endif 7526 AssertMsg(SUCCEEDED(rc), ("rc=%Rhrc it=%s hd=%s\n", rc, (*it)-> logName(), hd->locationFull().c_str() ));7531 AssertMsg(SUCCEEDED(rc), ("rc=%Rhrc it=%s hd=%s\n", rc, (*it)->getLogName(), hd->getLocationFull().c_str() )); 7527 7532 mrc = rc; 7528 7533 } … … 7586 7591 { 7587 7592 MediumAttachment *pAttach = *it; 7588 ComObjPtr<Medium> pMediumThis = pAttach-> medium();7593 ComObjPtr<Medium> pMediumThis = pAttach->getMedium(); 7589 7594 if (pMediumThis.equalsTo(pMedium)) 7590 7595 return pAttach; … … 7613 7618 { 7614 7619 MediumAttachment *pAttach = *it; 7615 ComObjPtr<Medium> pMediumThis = pAttach-> medium();7616 if (pMediumThis-> id() == id)7620 ComObjPtr<Medium> pMediumThis = pAttach->getMedium(); 7621 if (pMediumThis->getId() == id) 7617 7622 return pAttach; 7618 7623 } … … 7669 7674 pAttach->commit(); 7670 7675 7671 Medium* pMedium = pAttach-> medium();7676 Medium* pMedium = pAttach->getMedium(); 7672 7677 bool fImplicit = pAttach->isImplicit(); 7673 7678 7674 7679 LogFlowThisFunc(("Examining current medium '%s' (implicit: %d)\n", 7675 (pMedium) ? pMedium-> name().raw() : "NULL",7680 (pMedium) ? pMedium->getName().raw() : "NULL", 7676 7681 fImplicit)); 7677 7682 … … 7685 7690 if ( aOnline 7686 7691 && pMedium 7687 && pAttach-> type() == DeviceType_HardDisk7692 && pAttach->getType() == DeviceType_HardDisk 7688 7693 ) 7689 7694 { … … 7698 7703 * new diff for reading if the VM is online */ 7699 7704 7700 ComObjPtr<Medium> parent = pMedium-> parent();7705 ComObjPtr<Medium> parent = pMedium->getParent(); 7701 7706 /* make the relock atomic */ 7702 7707 AutoWriteLock parentLock (parent); … … 7726 7731 { 7727 7732 MediumAttachment *pOldAttach = *oldIt; 7728 if (pOldAttach-> medium().equalsTo(pMedium))7733 if (pOldAttach->getMedium().equalsTo(pMedium)) 7729 7734 { 7730 LogFlowThisFunc(("--> medium '%s' was attached before, will not remove\n", pMedium-> name().raw()));7735 LogFlowThisFunc(("--> medium '%s' was attached before, will not remove\n", pMedium->getName().raw())); 7731 7736 7732 7737 /* yes: remove from old to avoid de-association */ … … 7745 7750 { 7746 7751 MediumAttachment *pAttach = *it; 7747 Medium* pMedium = pAttach-> medium();7752 Medium* pMedium = pAttach->getMedium(); 7748 7753 7749 7754 /* Detach only hard disks, since DVD/floppy media is detached 7750 7755 * instantly in MountMedium. */ 7751 if (pAttach-> type() == DeviceType_HardDisk && pMedium)7756 if (pAttach->getType() == DeviceType_HardDisk && pMedium) 7752 7757 { 7753 LogFlowThisFunc(("detaching medium '%s' from machine\n", pMedium-> name().raw()));7758 LogFlowThisFunc(("detaching medium '%s' from machine\n", pMedium->getName().raw())); 7754 7759 7755 7760 /* now de-associate from the current machine state */ … … 7758 7763 7759 7764 if ( aOnline 7760 && pAttach-> type() == DeviceType_HardDisk)7765 && pAttach->getType() == DeviceType_HardDisk) 7761 7766 { 7762 7767 /* unlock since not used anymore */ … … 7787 7792 MediumAttachment *pAttach = *it; 7788 7793 /* Fix up the backrefs for DVD/floppy media. */ 7789 if (pAttach-> type() != DeviceType_HardDisk)7794 if (pAttach->getType() != DeviceType_HardDisk) 7790 7795 { 7791 Medium* pMedium = pAttach-> medium();7796 Medium* pMedium = pAttach->getMedium(); 7792 7797 if (pMedium) 7793 7798 { … … 7801 7806 pAttach = *it; 7802 7807 /* Fix up the backrefs for DVD/floppy media. */ 7803 if (pAttach-> type() != DeviceType_HardDisk)7808 if (pAttach->getType() != DeviceType_HardDisk) 7804 7809 { 7805 Medium* pMedium = pAttach-> medium();7810 Medium* pMedium = pAttach->getMedium(); 7806 7811 if (pMedium) 7807 7812 { … … 7991 7996 ++cit) 7992 7997 { 7993 if ((*cit)-> name() != (*rit)->name() ||7994 (*cit)-> hostPath() != (*rit)->hostPath())7998 if ((*cit)->getName() != (*rit)->getName() || 7999 (*cit)->getHostPath() != (*rit)->getHostPath()) 7995 8000 { 7996 8001 sharedFoldersChanged = true; … … 8263 8268 ComObjPtr<SharedFolder> folder; 8264 8269 folder.createObject(); 8265 HRESULT rc = folder->initCopy (machine(), *it);8270 HRESULT rc = folder->initCopy(getMachine(), *it); 8266 8271 AssertComRC (rc); 8267 8272 *it = folder; … … 9882 9887 ++it) 9883 9888 { 9884 DeviceType_T devType = (*it)-> type();9885 ComObjPtr<Medium> medium = (*it)-> medium();9889 DeviceType_T devType = (*it)->getType(); 9890 ComObjPtr<Medium> medium = (*it)->getMedium(); 9886 9891 9887 9892 bool first = true; … … 9891 9896 while (!medium.isNull()) 9892 9897 { 9893 MediumState_T mediumState = medium-> state();9898 MediumState_T mediumState = medium->getState(); 9894 9899 9895 9900 /* accessibility check must be first, otherwise locking … … 9959 9964 * change the hard disk parent at this point (as it is still 9960 9965 * attached to the machine) */ 9961 medium = medium-> parent();9966 medium = medium->getParent(); 9962 9967 } 9963 9968 } -
trunk/src/VBox/Main/MediumAttachmentImpl.cpp
r24935 r24989 99 99 aImplicit ? ":I" : ""); 100 100 101 LogFlowThisFunc(("LEAVE - %s\n", logName()));101 LogFlowThisFunc(("LEAVE - %s\n", getLogName())); 102 102 return S_OK; 103 103 } … … 109 109 void MediumAttachment::uninit() 110 110 { 111 LogFlowThisFunc(("ENTER - %s\n", logName()));111 LogFlowThisFunc(("ENTER - %s\n", getLogName())); 112 112 113 113 /* Enclose the state transition Ready->InUninit->NotReady */ … … 128 128 bool MediumAttachment::rollback() 129 129 { 130 LogFlowThisFunc(("ENTER - %s\n", logName()));130 LogFlowThisFunc(("ENTER - %s\n", getLogName())); 131 131 132 132 /* sanity */ … … 146 146 } 147 147 148 LogFlowThisFunc(("LEAVE - %s - returning %RTbool\n", logName(), changed));148 LogFlowThisFunc(("LEAVE - %s - returning %RTbool\n", getLogName(), changed)); 149 149 return changed; 150 150 } -
trunk/src/VBox/Main/MediumImpl.cpp
r24954 r24989 179 179 struct Medium::Task : public com::SupportErrorInfoBase 180 180 { 181 enum Operation { CreateBase, CreateDiff, 182 Merge, Clone, Delete, Reset, Compact }; 181 enum Operation { CreateBase, 182 CreateDiff, 183 Merge, 184 Clone, 185 Delete, 186 Reset, 187 Compact 188 }; 183 189 184 190 Medium *that; 185 VirtualBoxBaseProto::AutoCaller autoCaller;186 187 ComObjPtr <Progress> progress;188 Operation operation;191 VirtualBoxBaseProto::AutoCaller m_autoCaller; 192 193 ComObjPtr<Progress> m_pProgress; 194 Operation m_operation; 189 195 190 196 /** Where to save the result when executed using #runNow(). */ 191 HRESULT rc; 192 193 Task(Medium *aThat, Progress *aProgress, Operation aOperation) 194 : that(aThat), autoCaller(aThat) 195 , progress(aProgress) 196 , operation(aOperation) 197 , rc(S_OK) {} 197 HRESULT m_rc; 198 199 Task(Medium *aThat, 200 Progress *aProgress, 201 Operation aOperation) 202 : that(aThat), 203 m_autoCaller(aThat), 204 m_pProgress(aProgress), 205 m_operation(aOperation), 206 m_rc(S_OK) 207 {} 198 208 199 209 ~Task(); … … 341 351 Medium::taskThread(NIL_RTTHREAD, this); 342 352 343 return rc;353 return m_rc; 344 354 } 345 355 … … 354 364 * 355 365 * @note It is assumed that when modifying methods of this class are called, 356 * Medium:: treeLock() is held in read mode.366 * Medium::getTreeLock() is held in read mode. 357 367 */ 358 368 class Medium::MergeChain : public Medium::List, … … 441 451 { 442 452 /* we will need to reparent children */ 443 for (List::const_iterator it = aMedium->children().begin(); 444 it != aMedium->children().end(); ++ it) 453 for (List::const_iterator it = aMedium->getChildren().begin(); 454 it != aMedium->getChildren().end(); 455 ++it) 445 456 { 446 rc = (*it)->addCaller(); 457 ComObjPtr<Medium> pMedium = *it; 458 rc = pMedium->addCaller(); 447 459 CheckComRCReturnRC(rc); 448 460 449 rc = (*it)->LockWrite(NULL);461 rc = pMedium->LockWrite(NULL); 450 462 if (FAILED(rc)) 451 463 { 452 (*it)->releaseCaller();464 pMedium->releaseCaller(); 453 465 return rc; 454 466 } 455 467 456 mChildren.push_back( *it);468 mChildren.push_back(pMedium); 457 469 } 458 470 } … … 545 557 { 546 558 /* not going to multi-merge as it's too expensive */ 547 if (aMedium-> children().size() > 1)559 if (aMedium->getChildren().size() > 1) 548 560 { 549 561 return setError(E_FAIL, 550 562 tr("Medium '%s' involved in the merge operation has more than one child medium (%d)"), 551 563 aMedium->m->strLocationFull.raw(), 552 aMedium-> children().size());564 aMedium->getChildren().size()); 553 565 } 554 566 } … … 607 619 * 608 620 * @note It is assumed that when modifying methods of this class are called, 609 * Medium:: treeLock() is held in read mode.621 * Medium::getTreeLock() is held in read mode. 610 622 */ 611 623 class Medium::ImageChain : public Medium::List, … … 667 679 { 668 680 HRESULT rc = S_OK; 669 MediumState_T mediumState = (*it)-> state();681 MediumState_T mediumState = (*it)->getState(); 670 682 671 683 /* accessibility check must be first, otherwise locking … … 721 733 { 722 734 HRESULT rc = S_OK; 723 MediumState_T mediumState = (*it)-> state();735 MediumState_T mediumState = (*it)->getState(); 724 736 725 737 /* accessibility check must be first, otherwise locking … … 1039 1051 * @param aNode Configuration settings. 1040 1052 * 1041 * @note Locks VirtualBox lock for writing, treeLock() for writing.1053 * @note Locks VirtualBox lock for writing, getTreeLock() for writing. 1042 1054 */ 1043 1055 HRESULT Medium::init(VirtualBox *aVirtualBox, … … 1066 1078 { 1067 1079 /* we set mParent */ 1068 AutoWriteLock treeLock(this-> treeLock());1080 AutoWriteLock treeLock(this->getTreeLock()); 1069 1081 1070 1082 mParent = aParent; … … 1154 1166 it != data.llChildren.end(); ++ it) 1155 1167 { 1156 const settings::Medium &m = *it;1168 const settings::Medium &med = *it; 1157 1169 1158 1170 ComObjPtr<Medium> pHD; … … 1161 1173 this, // parent 1162 1174 aDeviceType, 1163 m ); // child data1175 med); // child data 1164 1176 CheckComRCBreakRC(rc); 1165 1177 … … 1188 1200 * @param aDescription Comment for this host drive. 1189 1201 * 1190 * @note Locks VirtualBox lock for writing, treeLock() for writing.1202 * @note Locks VirtualBox lock for writing, getTreeLock() for writing. 1191 1203 */ 1192 1204 HRESULT Medium::init(VirtualBox *aVirtualBox, … … 1246 1258 * uninit() methods. 1247 1259 * 1248 * @note Locks treeLock() for writing, VirtualBox for writing.1260 * @note Locks getTreeLock() for writing, VirtualBox for writing. 1249 1261 */ 1250 1262 void Medium::uninit() … … 1274 1286 /* we uninit children and reset mParent 1275 1287 * and VirtualBox::removeDependentChild() needs a write lock */ 1276 AutoMultiWriteLock2 alock(mVirtualBox->lockHandle(), this-> treeLock());1288 AutoMultiWriteLock2 alock(mVirtualBox->lockHandle(), this->getTreeLock()); 1277 1289 1278 1290 uninitDependentChildren(); … … 1405 1417 AutoReadLock alock(this); 1406 1418 1407 name().cloneTo(aName);1419 getName().cloneTo(aName); 1408 1420 1409 1421 return S_OK; … … 1505 1517 1506 1518 /* we access mParent & children() */ 1507 AutoReadLock treeLock(this-> treeLock());1519 AutoReadLock treeLock(this->getTreeLock()); 1508 1520 1509 1521 /* cannot change the type of a differencing hard disk */ … … 1532 1544 { 1533 1545 /* cannot change to writethrough if there are children */ 1534 if ( children().size() != 0)1546 if (getChildren().size() != 0) 1535 1547 return setError(E_FAIL, 1536 1548 tr("Cannot change type for hard disk '%s' since it has %d child hard disk(s)"), 1537 m->strLocationFull.raw(), children().size());1549 m->strLocationFull.raw(), getChildren().size()); 1538 1550 break; 1539 1551 } … … 1558 1570 1559 1571 /* we access mParent */ 1560 AutoReadLock treeLock(this-> treeLock());1572 AutoReadLock treeLock(this->getTreeLock()); 1561 1573 1562 1574 mParent.queryInterfaceTo(aParent); … … 1574 1586 1575 1587 /* we access children */ 1576 AutoReadLock treeLock(this-> treeLock());1577 1578 SafeIfaceArray<IMedium> children(this-> children());1588 AutoReadLock treeLock(this->getTreeLock()); 1589 1590 SafeIfaceArray<IMedium> children(this->getChildren()); 1579 1591 children.detachTo(ComSafeArrayOutArg(aChildren)); 1580 1592 … … 1589 1601 /* base() will do callers/locking */ 1590 1602 1591 base().queryInterfaceTo(aBase);1603 getBase().queryInterfaceTo(aBase); 1592 1604 1593 1605 return S_OK; … … 1620 1632 1621 1633 /* we access mParent */ 1622 AutoReadLock treeLock(this-> treeLock());1634 AutoReadLock treeLock(this->getTreeLock()); 1623 1635 1624 1636 if (mParent.isNull()) … … 1636 1648 /* base() will do callers/locking */ 1637 1649 1638 return base()->COMGETTER(LogicalSize)(aLogicalSize);1650 return getBase()->COMGETTER(LogicalSize)(aLogicalSize); 1639 1651 } 1640 1652 … … 1936 1948 m->preLockState = m->state; 1937 1949 1938 LogFlowThisFunc(("Okay - prev state=%d locationFull=%s\n", m->state, locationFull().c_str()));1950 LogFlowThisFunc(("Okay - prev state=%d locationFull=%s\n", m->state, getLocationFull().c_str())); 1939 1951 m->state = MediumState_LockedWrite; 1940 1952 break; … … 1942 1954 default: 1943 1955 { 1944 LogFlowThisFunc(("Failing - state=%d locationFull=%s\n", m->state, locationFull().c_str()));1956 LogFlowThisFunc(("Failing - state=%d locationFull=%s\n", m->state, getLocationFull().c_str())); 1945 1957 rc = setStateError(); 1946 1958 break; … … 1969 1981 { 1970 1982 m->state = m->preLockState; 1971 LogFlowThisFunc(("new state=%d locationFull=%s\n", m->state, locationFull().c_str()));1983 LogFlowThisFunc(("new state=%d locationFull=%s\n", m->state, getLocationFull().c_str())); 1972 1984 break; 1973 1985 } 1974 1986 default: 1975 1987 { 1976 LogFlowThisFunc(("Failing - state=%d locationFull=%s\n", m->state, locationFull().c_str()));1988 LogFlowThisFunc(("Failing - state=%d locationFull=%s\n", m->state, getLocationFull().c_str())); 1977 1989 rc = setError(VBOX_E_INVALID_OBJECT_STATE, 1978 1990 tr ("Medium '%s' is not locked for writing"), … … 2228 2240 2229 2241 std::auto_ptr <Task> task(new Task(this, progress, Task::CreateBase)); 2230 AssertComRCReturnRC(task-> autoCaller.rc());2242 AssertComRCReturnRC(task->m_autoCaller.rc()); 2231 2243 2232 2244 task->d.size = aLogicalSize; … … 2358 2370 2359 2371 /* we walk the source tree */ 2360 AutoReadLock srcTreeLock(this-> treeLock());2372 AutoReadLock srcTreeLock(this->getTreeLock()); 2361 2373 for (Medium *hd = this; hd; hd = hd->mParent) 2362 2374 { … … 2373 2385 AutoReadLock parentTreeLock; 2374 2386 if (parent) 2375 parentTreeLock.attach(parent-> treeLock());2387 parentTreeLock.attach(parent->getTreeLock()); 2376 2388 for (Medium *hd = parent; hd; hd = hd->mParent) 2377 2389 { … … 2405 2417 2406 2418 std::auto_ptr <Task> task(new Task(this, progress, Task::Clone)); 2407 AssertComRCThrowRC(task-> autoCaller.rc());2419 AssertComRCThrowRC(task->m_autoCaller.rc()); 2408 2420 2409 2421 task->setData(target, parent); … … 2460 2472 2461 2473 /* we walk the image tree */ 2462 AutoReadLock srcTreeLock(this-> treeLock());2474 AutoReadLock srcTreeLock(this->getTreeLock()); 2463 2475 for (Medium *hd = this; hd; hd = hd->mParent) 2464 2476 { … … 2479 2491 2480 2492 std::auto_ptr <Task> task(new Task(this, progress, Task::Compact)); 2481 AssertComRCThrowRC(task-> autoCaller.rc());2493 AssertComRCThrowRC(task->m_autoCaller.rc()); 2482 2494 2483 2495 task->setData(imgChain.release()); … … 2552 2564 2553 2565 std::auto_ptr<Task> task(new Task(this, progress, Task::Reset)); 2554 AssertComRCThrowRC(task-> autoCaller.rc());2566 AssertComRCThrowRC(task->m_autoCaller.rc()); 2555 2567 2556 2568 rc = task->startThread(); … … 2794 2806 * @return 2795 2807 */ 2796 const Guid& Medium:: id() const2808 const Guid& Medium::getId() const 2797 2809 { 2798 2810 return m->id; … … 2803 2815 * @return 2804 2816 */ 2805 MediumState_T Medium:: state() const2817 MediumState_T Medium::getState() const 2806 2818 { 2807 2819 return m->state; … … 2812 2824 * @return 2813 2825 */ 2814 const Utf8Str& Medium:: location() const2826 const Utf8Str& Medium::getLocation() const 2815 2827 { 2816 2828 return m->strLocation; … … 2821 2833 * @return 2822 2834 */ 2823 const Utf8Str& Medium:: locationFull() const2835 const Utf8Str& Medium::getLocationFull() const 2824 2836 { 2825 2837 return m->strLocationFull; … … 2830 2842 * @return 2831 2843 */ 2832 uint64_t Medium:: size() const2844 uint64_t Medium::getSize() const 2833 2845 { 2834 2846 return m->size; … … 2867 2879 * @param aNewPath New path (full). 2868 2880 * 2869 * @note Locks treeLock() for reading, this object and all children for writing.2881 * @note Locks getTreeLock() for reading, this object and all children for writing. 2870 2882 */ 2871 2883 void Medium::updatePaths(const char *aOldPath, const char *aNewPath) … … 2880 2892 2881 2893 /* we access children() */ 2882 AutoReadLock treeLock(this-> treeLock());2894 AutoReadLock treeLock(this->getTreeLock()); 2883 2895 2884 2896 updatePath(aOldPath, aNewPath); 2885 2897 2886 2898 /* update paths of all children */ 2887 for (List::const_iterator it = children().begin();2888 it != children().end();2899 for (List::const_iterator it = getChildren().begin(); 2900 it != getChildren().end(); 2889 2901 ++ it) 2890 2902 { … … 2903 2915 * (zero for the base), may be @c NULL. 2904 2916 * 2905 * @note Locks treeLock() for reading.2917 * @note Locks getTreeLock() for reading. 2906 2918 */ 2907 ComObjPtr<Medium> Medium:: base(uint32_t *aLevel /*= NULL*/)2908 { 2909 ComObjPtr <Medium> base;2919 ComObjPtr<Medium> Medium::getBase(uint32_t *aLevel /*= NULL*/) 2920 { 2921 ComObjPtr<Medium> pBase; 2910 2922 uint32_t level; 2911 2923 2912 2924 AutoCaller autoCaller(this); 2913 AssertReturn(autoCaller.isOk(), base);2925 AssertReturn(autoCaller.isOk(), pBase); 2914 2926 2915 2927 /* we access mParent */ 2916 AutoReadLock treeLock(this-> treeLock());2917 2918 base = this;2928 AutoReadLock treeLock(this->getTreeLock()); 2929 2930 pBase = this; 2919 2931 level = 0; 2920 2932 … … 2923 2935 for (;;) 2924 2936 { 2925 AutoCaller baseCaller( base);2926 AssertReturn(baseCaller.isOk(), base);2927 2928 if ( base->mParent.isNull())2937 AutoCaller baseCaller(pBase); 2938 AssertReturn(baseCaller.isOk(), pBase); 2939 2940 if (pBase->mParent.isNull()) 2929 2941 break; 2930 2942 2931 base = base->mParent;2932 ++ 2943 pBase = pBase->mParent; 2944 ++level; 2933 2945 } 2934 2946 } … … 2937 2949 *aLevel = level; 2938 2950 2939 return base;2951 return pBase; 2940 2952 } 2941 2953 … … 2945 2957 * type and posterity, not to the current media state. 2946 2958 * 2947 * @note Locks this object and treeLock() for reading.2959 * @note Locks this object and getTreeLock() for reading. 2948 2960 */ 2949 2961 bool Medium::isReadOnly() … … 2955 2967 2956 2968 /* we access children */ 2957 AutoReadLock treeLock(this-> treeLock());2969 AutoReadLock treeLock(this->getTreeLock()); 2958 2970 2959 2971 switch (m->type) … … 2961 2973 case MediumType_Normal: 2962 2974 { 2963 if ( children().size() != 0)2975 if (getChildren().size() != 0) 2964 2976 return true; 2965 2977 … … 2992 3004 * @param data Settings struct to be updated. 2993 3005 * 2994 * @note Locks this object, treeLock() and children for reading.3006 * @note Locks this object, getTreeLock() and children for reading. 2995 3007 */ 2996 3008 HRESULT Medium::saveSettings(settings::Medium &data) … … 3002 3014 3003 3015 /* we access mParent */ 3004 AutoReadLock treeLock(this-> treeLock());3016 AutoReadLock treeLock(this->getTreeLock()); 3005 3017 3006 3018 data.uuid = m->id; … … 3037 3049 3038 3050 /* save all children */ 3039 for (List::const_iterator it = children().begin();3040 it != children().end();3051 for (List::const_iterator it = getChildren().begin(); 3052 it != getChildren().end(); 3041 3053 ++it) 3042 3054 { 3043 settings::Medium m ;3044 HRESULT rc = (*it)->saveSettings(m );3055 settings::Medium med; 3056 HRESULT rc = (*it)->saveSettings(med); 3045 3057 AssertComRCReturnRC(rc); 3046 data.llChildren.push_back(m );3058 data.llChildren.push_back(med); 3047 3059 } 3048 3060 … … 3116 3128 * if no real merge is necessary). 3117 3129 * 3118 * @note Locks treeLock() for reading. Locks this object, aTarget and all3130 * @note Locks getTreeLock() for reading. Locks this object, aTarget and all 3119 3131 * intermediate hard disks for writing. 3120 3132 */ … … 3129 3141 3130 3142 /* we access mParent & children() */ 3131 AutoReadLock treeLock(this-> treeLock());3143 AutoReadLock treeLock(this->getTreeLock()); 3132 3144 3133 3145 AssertReturn(m->type == MediumType_Normal, E_FAIL); 3134 3146 3135 if ( children().size() == 0)3147 if (getChildren().size() == 0) 3136 3148 { 3137 3149 /* special treatment of the last hard disk in the chain: */ … … 3161 3173 3162 3174 /* not going multi-merge as it's too expensive */ 3163 if ( children().size() > 1)3175 if (getChildren().size() > 1) 3164 3176 return setError(E_FAIL, 3165 3177 tr ("Hard disk '%s' has more than one child hard disk (%d)"), 3166 m->strLocationFull.raw(), children().size());3178 m->strLocationFull.raw(), getChildren().size()); 3167 3179 3168 3180 /* this is a read-only hard disk with children; it must be associated with … … 3175 3187 AssertReturn(m->backRefs.front().llSnapshotIds.size() == 1, E_FAIL); 3176 3188 3177 ComObjPtr<Medium> child = children().front();3189 ComObjPtr<Medium> child = getChildren().front(); 3178 3190 3179 3191 /* we keep this locked, so lock the affected child to make sure the lock … … 3244 3256 * 3245 3257 * @note Locks the hard disks from the chain for writing. Locks the machine 3246 * object when the backward merge takes place. Locks treeLock() lock for3258 * object when the backward merge takes place. Locks getTreeLock() lock for 3247 3259 * reading or writing. 3248 3260 */ … … 3259 3271 AssertComRCReturnRC(autoCaller.rc()); 3260 3272 3261 aProgress->SetNextOperation(BstrFmt(tr("Discarding hard disk '%s'"), name().raw()),3273 aProgress->SetNextOperation(BstrFmt(tr("Discarding hard disk '%s'"), getName().raw()), 3262 3274 ulWeight); // weight 3263 3275 … … 3267 3279 3268 3280 /* we access mParent & children() */ 3269 AutoReadLock treeLock(this-> treeLock());3270 3271 Assert( children().size() == 0);3281 AutoReadLock treeLock(this->getTreeLock()); 3282 3283 Assert(getChildren().size() == 0); 3272 3284 3273 3285 /* special treatment of the last hard disk in the chain: */ … … 3322 3334 * no real merge takes place). 3323 3335 * 3324 * @note Locks the hard disks from the chain for writing. Locks treeLock() for3336 * @note Locks the hard disks from the chain for writing. Locks getTreeLock() for 3325 3337 * reading. 3326 3338 */ … … 3335 3347 3336 3348 /* we access mParent & children() */ 3337 AutoReadLock treeLock(this-> treeLock());3338 3339 Assert( children().size() == 0);3349 AutoReadLock treeLock(this->getTreeLock()); 3350 3351 Assert(getChildren().size() == 0); 3340 3352 3341 3353 /* special treatment of the last hard disk in the chain: */ … … 3389 3401 * @return 3390 3402 */ 3391 MediumType_T Medium:: type() const3403 MediumType_T Medium::getType() const 3392 3404 { 3393 3405 return m->type; … … 3406 3418 * object lock. 3407 3419 */ 3408 RWLockHandle* Medium:: treeLock()3420 RWLockHandle* Medium::getTreeLock() 3409 3421 { 3410 3422 return &mVirtualBox->hardDiskTreeLockHandle(); … … 3419 3431 * @note Must be called from under this object's read or write lock. 3420 3432 */ 3421 Utf8Str Medium::name() 3422 { 3423 Utf8Str location(m->strLocationFull); 3424 3425 Utf8Str name = RTPathFilename(location.c_str()); 3433 Utf8Str Medium::getName() 3434 { 3435 Utf8Str name = RTPathFilename(m->strLocationFull.c_str()); 3426 3436 return name; 3427 3437 } … … 3612 3622 * accessibility. 3613 3623 * 3614 * @note Locks treeLock() for reading and writing (for new diff media checked3624 * @note Locks getTreeLock() for reading and writing (for new diff media checked 3615 3625 * for the first time). Locks mParent for reading. Locks this object for 3616 3626 * writing. … … 3824 3834 3825 3835 /* we set mParent & children() */ 3826 AutoWriteLock treeLock(this-> treeLock());3836 AutoWriteLock treeLock(this->getTreeLock()); 3827 3837 3828 3838 Assert(mParent.isNull()); … … 3833 3843 { 3834 3844 /* we access mParent */ 3835 AutoReadLock treeLock(this-> treeLock());3845 AutoReadLock treeLock(this->getTreeLock()); 3836 3846 3837 3847 /* check that parent UUIDs match. Note that there's no need … … 3849 3859 3850 3860 AutoReadLock parentLock(mParent); 3851 if ( mParent->state() != MediumState_Inaccessible &&3852 mParent->id() != parentId)3861 if ( mParent->getState() != MediumState_Inaccessible 3862 && mParent->getId() != parentId) 3853 3863 { 3854 3864 lastAccessError = Utf8StrFmt( 3855 3865 tr ("Parent UUID {%RTuuid} of the hard disk '%s' does not match UUID {%RTuuid} of its parent hard disk stored in the media registry ('%s')"), 3856 3866 &parentId, location.c_str(), 3857 mParent-> id().raw(),3867 mParent->getId().raw(), 3858 3868 mVirtualBox->settingsFilePath().c_str()); 3859 3869 throw S_OK; … … 4017 4027 * an asynchronous thread. 4018 4028 * 4019 * @note Locks mVirtualBox and this object for writing. Locks treeLock() for4029 * @note Locks mVirtualBox and this object for writing. Locks getTreeLock() for 4020 4030 * writing. 4021 4031 */ … … 4031 4041 4032 4042 AutoMultiWriteLock2 alock(mVirtualBox->lockHandle(), this->lockHandle()); 4033 LogFlowThisFunc(("aWait=%RTbool locationFull=%s\n", aWait, locationFull().c_str() ));4043 LogFlowThisFunc(("aWait=%RTbool locationFull=%s\n", aWait, getLocationFull().c_str() )); 4034 4044 4035 4045 if ( !(m->formatObj->capabilities() & ( MediumFormatCapabilities_CreateDynamic … … 4084 4094 4085 4095 /* we need to leave this object's write lock now because of 4086 * unregisterWithVirtualBox() that locks treeLock() for writing */4096 * unregisterWithVirtualBox() that locks getTreeLock() for writing */ 4087 4097 alock.leave(); 4088 4098 … … 4121 4131 4122 4132 std::auto_ptr <Task> task(new Task(this, progress, Task::Delete)); 4123 AssertComRCReturnRC(task-> autoCaller.rc());4133 AssertComRCReturnRC(task->m_autoCaller.rc()); 4124 4134 4125 4135 if (aWait) … … 4262 4272 4263 4273 std::auto_ptr <Task> task(new Task(this, progress, Task::CreateDiff)); 4264 AssertComRCReturnRC(task-> autoCaller.rc());4274 AssertComRCReturnRC(task->m_autoCaller.rc()); 4265 4275 4266 4276 task->setData(aTarget); … … 4319 4329 * hard disk is attached to any VM. 4320 4330 * 4321 * @note Locks treeLock() for reading. Locks this object, aTarget and all4331 * @note Locks getTreeLock() for reading. Locks this object, aTarget and all 4322 4332 * intermediate hard disks for writing. 4323 4333 */ … … 4337 4347 4338 4348 /* we walk the tree */ 4339 AutoReadLock treeLock(this-> treeLock());4349 AutoReadLock treeLock(this->getTreeLock()); 4340 4350 4341 4351 HRESULT rc = S_OK; … … 4361 4371 { 4362 4372 AutoReadLock alock(this); 4363 tgtLoc = aTarget-> locationFull();4373 tgtLoc = aTarget->getLocationFull(); 4364 4374 } 4365 4375 … … 4498 4508 rc = progress->init(mVirtualBox, static_cast<IMedium*>(this), 4499 4509 BstrFmt(tr("Merging hard disk '%s' to '%s'"), 4500 name().raw(), aChain->target()->name().raw()), 4510 getName().raw(), 4511 aChain->target()->getName().raw()), 4501 4512 TRUE /* aCancelable */); 4502 4513 CheckComRCReturnRC(rc); … … 4508 4519 4509 4520 std::auto_ptr <Task> task(new Task(this, progress, Task::Merge)); 4510 AssertComRCReturnRC(task-> autoCaller.rc());4521 AssertComRCReturnRC(task->m_autoCaller.rc()); 4511 4522 4512 4523 task->setData(aChain); … … 4610 4621 * @note Also reused by Medium::Reset(). 4611 4622 * 4612 * @note Locks treeLock() for reading.4623 * @note Locks getTreeLock() for reading. 4613 4624 */ 4614 4625 HRESULT Medium::canClose() 4615 4626 { 4616 4627 /* we access children */ 4617 AutoReadLock treeLock(this-> treeLock());4618 4619 if ( children().size() != 0)4628 AutoReadLock treeLock(this->getTreeLock()); 4629 4630 if (getChildren().size() != 0) 4620 4631 return setError(E_FAIL, 4621 4632 tr("Cannot close medium '%s' because it has %d child hard disk(s)"), 4622 m->strLocationFull.raw(), children().size());4633 m->strLocationFull.raw(), getChildren().size()); 4623 4634 4624 4635 return S_OK; … … 4629 4640 * from under mVirtualBox write lock. 4630 4641 * 4631 * @note Locks treeLock() for writing.4642 * @note Locks getTreeLock() for writing. 4632 4643 */ 4633 4644 HRESULT Medium::unregisterWithVirtualBox() … … 4637 4648 4638 4649 /* we modify mParent and access children */ 4639 AutoWriteLock treeLock(this-> treeLock());4650 AutoWriteLock treeLock(this->getTreeLock()); 4640 4651 4641 4652 const ComObjPtr<Medium, ComWeakRef> parent = mParent; 4642 4653 4643 AssertReturn( children().size() == 0, E_FAIL);4654 AssertReturn(getChildren().size() == 0, E_FAIL); 4644 4655 4645 4656 if (!mParent.isNull()) … … 4867 4878 VDINTERFACE vdIfProgress; 4868 4879 PVDINTERFACE vdOperationIfaces = NULL; 4869 int vrc = VDInterfaceAdd(&vdIfProgress,4880 int vrc1 = VDInterfaceAdd(&vdIfProgress, 4870 4881 "Medium::vdInterfaceProgress", 4871 4882 VDINTERFACETYPE_PROGRESS, 4872 &vdIfCallsProgress, task->progress, &vdOperationIfaces); 4873 AssertRCReturn(vrc, E_FAIL); 4883 &vdIfCallsProgress, 4884 task->m_pProgress, 4885 &vdOperationIfaces); 4886 AssertRCReturn(vrc1, E_FAIL); 4874 4887 4875 4888 /// @todo ugly hack, fix ComAssert... later … … 4879 4892 4880 4893 LogFlowFuncEnter(); 4881 LogFlowFunc(("{%p}: operation=%d\n", that, task-> operation));4894 LogFlowFunc(("{%p}: operation=%d\n", that, task->m_operation)); 4882 4895 4883 4896 HRESULT rc = S_OK; 4884 4897 4885 switch (task-> operation)4898 switch (task->m_operation) 4886 4899 { 4887 4900 //////////////////////////////////////////////////////////////////////// … … 5075 5088 * here), but lock VirtualBox first to follow the rule */ 5076 5089 AutoMultiWriteLock2 alock(that->mVirtualBox->lockHandle(), 5077 that-> treeLock());5090 that->getTreeLock()); 5078 5091 5079 5092 Assert(target->mParent.isNull()); … … 5089 5102 /* diffs for immutable hard disks are auto-reset by default */ 5090 5103 target->m->autoReset = 5091 that-> base()->m->type == MediumType_Immutable ?5104 that->getBase()->m->type == MediumType_Immutable ? 5092 5105 TRUE : FALSE; 5093 5106 … … 5291 5304 * here), but lock VirtualBox first to follow the rule */ 5292 5305 AutoMultiWriteLock2 alock(that->mVirtualBox->lockHandle(), 5293 that-> treeLock());5306 that->getTreeLock()); 5294 5307 5295 5308 Medium *source = chain->source(); … … 5327 5340 else 5328 5341 { 5329 Assert(target-> children().size() == 1);5330 Medium *targetChild = target-> children().front();5342 Assert(target->getChildren().size() == 1); 5343 Medium *targetChild = target->getChildren().front(); 5331 5344 5332 5345 /* disconnect the deleted branch at the elder end */ … … 5389 5402 * the caller's responsibility) */ 5390 5403 if (*it == that) 5391 task-> autoCaller.release();5404 task->m_autoCaller.release(); 5392 5405 5393 5406 /* release the caller added by MergeChain before … … 5515 5528 5516 5529 PVBOXHDD targetHdd; 5517 intvrc = VDCreate(that->m->vdDiskIfaces, &targetHdd);5530 vrc = VDCreate(that->m->vdDiskIfaces, &targetHdd); 5518 5531 ComAssertRCThrow(vrc, E_FAIL); 5519 5532 … … 5579 5592 * here), but lock VirtualBox first to follow the rule */ 5580 5593 AutoMultiWriteLock2 alock(that->mVirtualBox->lockHandle(), 5581 that-> treeLock());5594 that->getTreeLock()); 5582 5595 5583 5596 Assert(target->mParent.isNull()); … … 5890 5903 if (isAsync) 5891 5904 { 5892 if (!task-> progress.isNull())5893 task-> progress->notifyComplete(rc);5905 if (!task->m_pProgress.isNull()) 5906 task->m_pProgress->notifyComplete(rc); 5894 5907 } 5895 5908 else 5896 5909 { 5897 task-> rc = rc;5910 task->m_rc = rc; 5898 5911 } 5899 5912 -
trunk/src/VBox/Main/ProgressImpl.cpp
r24969 r24989 829 829 { 830 830 RTTIMESPEC time; 831 RTTimeNow 831 RTTimeNow(&time); /** @todo r=bird: Use monotonic time (RTTimeMilliTS()) here because of daylight saving and things like that. */ 832 832 833 833 int vrc = VINF_SUCCESS; 834 834 bool fForever = aTimeout < 0; 835 835 int64_t timeLeft = aTimeout; 836 int64_t lastTime = RTTimeSpecGetMilli 836 int64_t lastTime = RTTimeSpecGetMilli(&time); 837 837 838 838 while (!mCompleted && (fForever || timeLeft > 0)) … … 840 840 mWaitersCount++; 841 841 alock.leave(); 842 intvrc = RTSemEventMultiWait(mCompletedSem,843 842 vrc = RTSemEventMultiWait(mCompletedSem, 843 fForever ? RT_INDEFINITE_WAIT : (unsigned)timeLeft); 844 844 alock.enter(); 845 845 mWaitersCount--; … … 907 907 mWaitersCount ++; 908 908 alock.leave(); 909 intvrc = RTSemEventMultiWait(mCompletedSem,910 909 vrc = RTSemEventMultiWait(mCompletedSem, 910 fForever ? RT_INDEFINITE_WAIT : (unsigned) timeLeft); 911 911 alock.enter(); 912 912 mWaitersCount--; … … 1729 1729 AssertReturn(mProgress < mProgresses.size(), E_FAIL); 1730 1730 1731 ComPtr<IProgress> progress = mProgresses 1731 ComPtr<IProgress> progress = mProgresses[mProgress]; 1732 1732 ComAssertRet (!progress.isNull(), E_FAIL); 1733 1733 1734 1734 HRESULT rc = S_OK; 1735 BOOL completed = FALSE;1735 BOOL fCompleted = FALSE; 1736 1736 1737 1737 do 1738 1738 { 1739 rc = progress->COMGETTER(Completed) (&completed);1739 rc = progress->COMGETTER(Completed)(&fCompleted); 1740 1740 if (FAILED (rc)) 1741 1741 return rc; 1742 1742 1743 if ( completed)1743 if (fCompleted) 1744 1744 { 1745 rc = progress->COMGETTER(Canceled) 1745 rc = progress->COMGETTER(Canceled)(&mCanceled); 1746 1746 if (FAILED (rc)) 1747 1747 return rc; 1748 1748 1749 1749 LONG iRc; 1750 rc = progress->COMGETTER(ResultCode) 1750 rc = progress->COMGETTER(ResultCode)(&iRc); 1751 1751 if (FAILED (rc)) 1752 1752 return rc; … … 1781 1781 } 1782 1782 } 1783 while ( completed && !mCompleted);1783 while (fCompleted && !mCompleted); 1784 1784 1785 1785 rc = progress->COMGETTER(OperationPercent) (&m_ulOperationPercent); -
trunk/src/VBox/Main/SnapshotImpl.cpp
r24920 r24989 825 825 { 826 826 MediumAttachment *pAtt = *it; 827 Medium *pMedium = pAtt-> medium();827 Medium *pMedium = pAtt->getMedium(); 828 828 if (pMedium) // can be NULL for non-harddisk 829 829 { … … 1536 1536 ComObjPtr<MediumAttachment> &pAttach = *it; 1537 1537 AutoReadLock attachLock(pAttach); 1538 if (pAttach-> type() == DeviceType_HardDisk)1538 if (pAttach->getType() == DeviceType_HardDisk) 1539 1539 { 1540 1540 ++ulOpCount; 1541 1541 ++ulTotalWeight; // assume one MB weight for each differencing hard disk to manage 1542 Assert(pAttach-> medium());1543 LogFlowThisFunc(("op %d: considering hard disk attachment %s\n", ulOpCount, pAttach-> medium()->name().c_str()));1542 Assert(pAttach->getMedium()); 1543 LogFlowThisFunc(("op %d: considering hard disk attachment %s\n", ulOpCount, pAttach->getMedium()->getName().c_str())); 1544 1544 } 1545 1545 } … … 1770 1770 { 1771 1771 ComObjPtr<MediumAttachment> pAttach = *it; 1772 ComObjPtr<Medium> pMedium = pAttach-> medium();1772 ComObjPtr<Medium> pMedium = pAttach->getMedium(); 1773 1773 1774 1774 /* while the hard disk is attached, the number of children or the 1775 1775 * parent cannot change, so no lock */ 1776 1776 if ( !pMedium.isNull() 1777 && pAttach-> type() == DeviceType_HardDisk1778 && !pMedium-> parent().isNull()1779 && pMedium-> children().size() == 01777 && pAttach->getType() == DeviceType_HardDisk 1778 && !pMedium->getParent().isNull() 1779 && pMedium->getChildren().size() == 0 1780 1780 ) 1781 1781 { 1782 LogFlowThisFunc(("Picked differencing image '%s' for deletion\n", pMedium-> name().raw()));1782 LogFlowThisFunc(("Picked differencing image '%s' for deletion\n", pMedium->getName().raw())); 1783 1783 1784 1784 llDiffAttachmentsToDelete.push_back(pAttach); … … 1820 1820 { 1821 1821 ComObjPtr<MediumAttachment> pAttach = *it; // guaranteed to have only attachments where medium != NULL 1822 ComObjPtr<Medium> pMedium = pAttach-> medium();1822 ComObjPtr<Medium> pMedium = pAttach->getMedium(); 1823 1823 1824 1824 AutoWriteLock mlock(pMedium); 1825 1825 1826 LogFlowThisFunc(("Detaching old current state in differencing image '%s'\n", pMedium-> name().raw()));1826 LogFlowThisFunc(("Detaching old current state in differencing image '%s'\n", pMedium->getName().raw())); 1827 1827 1828 1828 // Normally we "detach" the medium by removing the attachment object … … 1852 1852 { 1853 1853 ComObjPtr<Medium> &pMedium = *it; 1854 LogFlowThisFunc(("Deleting old current state in differencing image '%s'\n", pMedium-> name().raw()));1854 LogFlowThisFunc(("Deleting old current state in differencing image '%s'\n", pMedium->getName().raw())); 1855 1855 1856 1856 HRESULT rc2 = pMedium->deleteStorageAndWait(); … … 1984 1984 ComObjPtr<MediumAttachment> &pAttach = *it; 1985 1985 AutoReadLock attachLock(pAttach); 1986 if (pAttach-> type() == DeviceType_HardDisk)1986 if (pAttach->getType() == DeviceType_HardDisk) 1987 1987 { 1988 Assert(pAttach->medium());1989 ComObjPtr<Medium> pHD = pAttach->medium();1988 ComObjPtr<Medium> pHD = pAttach->getMedium(); 1989 Assert(pHD); 1990 1990 AutoReadLock mlock(pHD); 1991 if (pHD-> type() == MediumType_Normal)1991 if (pHD->getType() == MediumType_Normal) 1992 1992 { 1993 1993 ++ulOpCount; 1994 ulTotalWeight += pHD-> size() / _1M;1994 ulTotalWeight += pHD->getSize() / _1M; 1995 1995 } 1996 LogFlowThisFunc(("op %d: considering hard disk attachment %s\n", ulOpCount, pHD-> name().c_str()));1996 LogFlowThisFunc(("op %d: considering hard disk attachment %s\n", ulOpCount, pHD->getName().c_str())); 1997 1997 } 1998 1998 } … … 2116 2116 2117 2117 /* save the snapshot ID (for callbacks) */ 2118 Guid snapshotId = aTask.pSnapshot->getId();2118 Guid snapshotId1 = aTask.pSnapshot->getId(); 2119 2119 2120 2120 MediumDiscardRecList toDiscard; … … 2138 2138 ComObjPtr<MediumAttachment> &pAttach = *it; 2139 2139 AutoReadLock attachLock(pAttach); 2140 if (pAttach-> type() == DeviceType_HardDisk)2140 if (pAttach->getType() == DeviceType_HardDisk) 2141 2141 { 2142 Assert(pAttach-> medium());2143 ComObjPtr<Medium> pHD = pAttach-> medium();2142 Assert(pAttach->getMedium()); 2143 ComObjPtr<Medium> pHD = pAttach->getMedium(); 2144 2144 // do not lock, prepareDiscared() has a write lock which will hang otherwise 2145 2145 … … 2159 2159 // unless it's a base image: 2160 2160 2161 if ( pHD-> parent().isNull()2161 if ( pHD->getParent().isNull() 2162 2162 && chain != NULL 2163 2163 ) … … 2175 2175 // prepareDiscard() should have raised an error already 2176 2176 // if there was more than one child 2177 Assert(pHD-> children().size() == 1);2178 2179 ComObjPtr<Medium> pReplaceHD = pHD-> children().front();2177 Assert(pHD->getChildren().size() == 1); 2178 2179 ComObjPtr<Medium> pReplaceHD = pHD->getChildren().front(); 2180 2180 2181 2181 const Guid *pReplaceMachineId = pReplaceHD->getFirstMachineBackrefId(); … … 2298 2298 { 2299 2299 rc = it->hd->discard(aTask.pProgress, 2300 it->hd-> size() / _1M, // weight2300 it->hd->getSize() / _1M, // weight 2301 2301 it->chain); 2302 2302 CheckComRCBreakRC(rc); … … 2328 2328 /* undo hard disk replacement */ 2329 2329 2330 rc2 = it->replaceHd->attachTo 2330 rc2 = it->replaceHd->attachTo(mData->mUuid, it->snapshotId); 2331 2331 AssertComRC(rc2); 2332 2332 … … 2369 2369 2370 2370 if (SUCCEEDED(rc)) 2371 mParent->onSnapshotDeleted(mData->mUuid, snapshotId );2371 mParent->onSnapshotDeleted(mData->mUuid, snapshotId1); 2372 2372 2373 2373 LogFlowThisFunc(("Done deleting snapshot (rc=%08X)\n", rc)); -
trunk/src/VBox/Main/USBControllerImpl.cpp
r23271 r24989 459 459 460 460 /* notify the proxy (only when it makes sense) */ 461 if (filter-> data().mActive && Global::IsOnline(adep.machineState()))462 { 463 USBProxyService *service = mParent-> virtualBox()->host()->usbProxyService();461 if (filter->getData().mActive && Global::IsOnline(adep.machineState())) 462 { 463 USBProxyService *service = mParent->getVirtualBox()->host()->usbProxyService(); 464 464 ComAssertRet (service, E_FAIL); 465 465 466 ComAssertRet (filter->id() == NULL, E_FAIL);467 filter-> id() = service->insertFilter (&filter->data().mUSBFilter);466 ComAssertRet(filter->getId() == NULL, E_FAIL); 467 filter->getId() = service->insertFilter (&filter->getData().mUSBFilter); 468 468 } 469 469 … … 525 525 526 526 /* notify the proxy (only when it makes sense) */ 527 if (filter-> data().mActive && Global::IsOnline(adep.machineState()))528 { 529 USBProxyService *service = mParent-> virtualBox()->host()->usbProxyService();527 if (filter->getData().mActive && Global::IsOnline(adep.machineState())) 528 { 529 USBProxyService *service = mParent->getVirtualBox()->host()->usbProxyService(); 530 530 ComAssertRet (service, E_FAIL); 531 531 532 ComAssertRet (filter->id() != NULL, E_FAIL);533 service->removeFilter (filter->id());534 filter-> id() = NULL;532 ComAssertRet(filter->getId() != NULL, E_FAIL); 533 service->removeFilter(filter->getId()); 534 filter->getId() = NULL; 535 535 } 536 536 … … 623 623 { 624 624 AutoWriteLock filterLock (*it); 625 const USBDeviceFilter::Data &filterData = (*it)-> data();625 const USBDeviceFilter::Data &filterData = (*it)->getData(); 626 626 627 627 Bstr str; … … 728 728 while (thatIt != backDevices.end()) 729 729 { 730 if ((*it)-> data() == (*thatIt)->data())730 if ((*it)->getData() == (*thatIt)->getData()) 731 731 { 732 732 backDevices.erase (thatIt); … … 775 775 if (mDeviceFilters.isBackedUp()) 776 776 { 777 USBProxyService *service = mParent-> virtualBox()->host()->usbProxyService();777 USBProxyService *service = mParent->getVirtualBox()->host()->usbProxyService(); 778 778 ComAssertRet (service, false); 779 779 … … 787 787 { 788 788 /* notify the proxy (only when it makes sense) */ 789 if ((*it)-> data().mActive &&789 if ((*it)->getData().mActive && 790 790 Global::IsOnline (adep.machineState())) 791 791 { 792 792 USBDeviceFilter *filter = *it; 793 ComAssertRet (filter->id() != NULL, false);794 service->removeFilter (filter->id());795 filter-> id() = NULL;793 ComAssertRet(filter->getId() != NULL, false); 794 service->removeFilter(filter->getId()); 795 filter->getId() = NULL; 796 796 } 797 797 … … 812 812 { 813 813 /* notify the proxy (only when necessary) */ 814 if ((*it)-> data().mActive)814 if ((*it)->getData().mActive) 815 815 { 816 816 USBDeviceFilter *flt = *it; /* resolve ambiguity */ 817 ComAssertRet (flt->id() == NULL, false);818 flt-> id() = service->insertFilter (&flt->data().mUSBFilter);817 ComAssertRet(flt->getId() == NULL, false); 818 flt->getId() = service->insertFilter(&flt->getData().mUSBFilter); 819 819 } 820 820 } … … 1029 1029 if (aFilter->mInList && mParent->isRegistered()) 1030 1030 { 1031 USBProxyService *service = mParent-> virtualBox()->host()->usbProxyService();1031 USBProxyService *service = mParent->getVirtualBox()->host()->usbProxyService(); 1032 1032 ComAssertRet (service, E_FAIL); 1033 1033 … … 1035 1035 { 1036 1036 /* insert/remove the filter from the proxy */ 1037 if (aFilter-> data().mActive)1037 if (aFilter->getData().mActive) 1038 1038 { 1039 ComAssertRet (aFilter->id() == NULL, E_FAIL);1040 aFilter-> id() = service->insertFilter (&aFilter->data().mUSBFilter);1039 ComAssertRet(aFilter->getId() == NULL, E_FAIL); 1040 aFilter->getId() = service->insertFilter(&aFilter->getData().mUSBFilter); 1041 1041 } 1042 1042 else 1043 1043 { 1044 ComAssertRet (aFilter->id() != NULL, E_FAIL);1045 service->removeFilter (aFilter->id());1046 aFilter-> id() = NULL;1044 ComAssertRet(aFilter->getId() != NULL, E_FAIL); 1045 service->removeFilter(aFilter->getId()); 1046 aFilter->getId() = NULL; 1047 1047 } 1048 1048 } 1049 1049 else 1050 1050 { 1051 if (aFilter-> data().mActive)1051 if (aFilter->getData().mActive) 1052 1052 { 1053 1053 /* update the filter in the proxy */ 1054 ComAssertRet (aFilter->id() != NULL, E_FAIL);1055 service->removeFilter (aFilter->id());1056 aFilter-> id() = service->insertFilter (&aFilter->data().mUSBFilter);1054 ComAssertRet(aFilter->getId() != NULL, E_FAIL); 1055 service->removeFilter(aFilter->getId()); 1056 aFilter->getId() = service->insertFilter(&aFilter->getData().mUSBFilter); 1057 1057 } 1058 1058 } … … 1087 1087 { 1088 1088 AutoWriteLock filterLock (*it); 1089 if (aDevice->isMatch ((*it)->data()))1089 if (aDevice->isMatch((*it)->getData())) 1090 1090 { 1091 *aMaskedIfs = (*it)-> data().mMaskedIfs;1091 *aMaskedIfs = (*it)->getData().mMaskedIfs; 1092 1092 return true; 1093 1093 } … … 1184 1184 { 1185 1185 AutoWriteLock filterLock (*it); 1186 const USBDeviceFilter::Data &aData = (*it)-> data();1186 const USBDeviceFilter::Data &aData = (*it)->getData(); 1187 1187 1188 1188 if (!aData.mActive) … … 1221 1221 AutoReadLock alock(this); 1222 1222 1223 USBProxyService *service = mParent-> virtualBox()->host()->usbProxyService();1223 USBProxyService *service = mParent->getVirtualBox()->host()->usbProxyService(); 1224 1224 AssertReturn(service, E_FAIL); 1225 1225 … … 1230 1230 1231 1231 /* notify the proxy (only if the filter is active) */ 1232 if (flt-> data().mActive)1232 if (flt->getData().mActive) 1233 1233 { 1234 1234 if (aInsertFilters) 1235 1235 { 1236 AssertReturn(flt-> id() == NULL, E_FAIL);1237 flt-> id() = service->insertFilter (&flt->data().mUSBFilter);1236 AssertReturn(flt->getId() == NULL, E_FAIL); 1237 flt->getId() = service->insertFilter(&flt->getData().mUSBFilter); 1238 1238 } 1239 1239 else … … 1242 1242 * when this method gets called (as a result of an early VM 1243 1243 * process crash for example. So, don't assert that ID != NULL. */ 1244 if (flt-> id() != NULL)1244 if (flt->getId() != NULL) 1245 1245 { 1246 service->removeFilter (flt->id());1247 flt-> id() = NULL;1246 service->removeFilter(flt->getId()); 1247 flt->getId() = NULL; 1248 1248 } 1249 1249 } -
trunk/src/VBox/Main/USBDeviceImpl.cpp
r21878 r24989 93 93 ComAssertComRCRet (hrc, hrc); 94 94 95 Bstr id;96 hrc = aUSBDevice->COMGETTER(Id)( id.asOutParam());97 ComAssertComRCRet 98 unconst(mData.id) = Guid( id);95 Bstr uuid; 96 hrc = aUSBDevice->COMGETTER(Id)(uuid.asOutParam()); 97 ComAssertComRCRet(hrc, hrc); 98 unconst(mData.id) = Guid(uuid); 99 99 100 100 /* Confirm a successful initialization */ -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r24858 r24989 295 295 /* Get the VirtualBox home directory. */ 296 296 { 297 char homeDir[RTPATH_MAX];298 int vrc = com::GetVBoxUserHomeDirectory( homeDir, sizeof(homeDir));297 char szHomeDir[RTPATH_MAX]; 298 int vrc = com::GetVBoxUserHomeDirectory(szHomeDir, sizeof(szHomeDir)); 299 299 if (RT_FAILURE(vrc)) 300 300 return setError (E_FAIL, 301 301 tr ("Could not create the VirtualBox home directory '%s'" 302 302 "(%Rrc)"), 303 homeDir, vrc);304 305 unconst(m->strHomeDir) = homeDir;303 szHomeDir, vrc); 304 305 unconst(m->strHomeDir) = szHomeDir; 306 306 } 307 307 … … 944 944 const char * url = NULL; 945 945 946 NOREF(aVersion); 947 946 948 static const struct { 947 949 FirmwareType_T type; … … 1005 1007 } 1006 1008 1007 1009 1008 1010 url = firmwareDesc[i].url; 1009 1011 /** @todo: account for version in the URL */ … … 1214 1216 /* fire an event */ 1215 1217 if (SUCCEEDED(rc)) 1216 onMachineRegistered (machine->id(), TRUE);1218 onMachineRegistered(machine->getId(), TRUE); 1217 1219 1218 1220 return rc; … … 1261 1263 ++ it) 1262 1264 { 1263 AutoLimitedCaller machCaller (*it); 1264 AssertComRC (machCaller.rc()); 1265 ComObjPtr<Machine> &pMachine2 = *it; 1266 AutoLimitedCaller machCaller(pMachine2); 1267 AssertComRC(machCaller.rc()); 1265 1268 1266 1269 /* skip inaccessible machines */ 1267 1270 if (machCaller.state() == Machine::Ready) 1268 1271 { 1269 AutoReadLock machLock (*it);1270 if ( (*it)->name() == aName)1271 machine = *it;1272 AutoReadLock machLock(pMachine2); 1273 if (pMachine2->getName() == aName) 1274 machine = pMachine2; 1272 1275 } 1273 1276 } … … 2735 2738 * @note Locks this object for reading. 2736 2739 */ 2737 HRESULT VirtualBox::findMachine (const Guid &aId, bool aSetError, 2738 ComObjPtr<Machine> *aMachine /* = NULL */) 2740 HRESULT VirtualBox::findMachine(const Guid &aId, 2741 bool aSetError, 2742 ComObjPtr<Machine> *aMachine /* = NULL */) 2739 2743 { 2740 2744 AutoCaller autoCaller(this); … … 2750 2754 ++ it) 2751 2755 { 2756 ComObjPtr<Machine> pMachine2 = *it; 2752 2757 /* sanity */ 2753 AutoLimitedCaller machCaller (*it);2754 AssertComRC 2755 2756 found = (*it)->id() == aId;2758 AutoLimitedCaller machCaller(pMachine2); 2759 AssertComRC(machCaller.rc()); 2760 2761 found = pMachine2->getId() == aId; 2757 2762 if (found && aMachine) 2758 *aMachine = *it;2763 *aMachine = pMachine2; 2759 2764 } 2760 2765 } … … 2896 2901 AutoReadLock imageLock (*it); 2897 2902 2898 found = (aId && (*it)-> id() == *aId) ||2903 found = (aId && (*it)->getId() == *aId) || 2899 2904 (aLocation != NULL && 2900 2905 RTPathCompare(location.c_str(), 2901 (*it)-> locationFull().c_str()2906 (*it)->getLocationFull().c_str() 2902 2907 ) == 0); 2903 2908 if (found) … … 2972 2977 AutoReadLock imageLock (*it); 2973 2978 2974 found = (aId && (*it)-> id() == *aId) ||2979 found = (aId && (*it)->getId() == *aId) || 2975 2980 (aLocation != NULL && 2976 2981 RTPathCompare(location.c_str(), 2977 (*it)-> locationFull().c_str()2982 (*it)->getLocationFull().c_str() 2978 2983 ) == 0); 2979 2984 if (found) … … 3184 3189 { 3185 3190 /* Note: no AutoCaller since bound to this */ 3186 AutoReadLock mediaLock 3187 aConflict = Utf8StrFmt (3188 tr ("hard disk '%s' with UUID {%RTuuid}"),3189 hardDisk->locationFull().raw(), hardDisk->id().raw());3191 AutoReadLock mediaLock(hardDisk); 3192 aConflict = Utf8StrFmt(tr("hard disk '%s' with UUID {%RTuuid}"), 3193 hardDisk->getLocationFull().raw(), 3194 hardDisk->getId().raw()); 3190 3195 return S_OK; 3191 3196 } … … 3199 3204 /* Note: no AutoCaller since bound to this */ 3200 3205 AutoReadLock mediaLock (image); 3201 aConflict = Utf8StrFmt (3202 tr ("CD/DVD image '%s' with UUID {%RTuuid}"),3203 image->locationFull().raw(), image->id().raw());3206 aConflict = Utf8StrFmt(tr("CD/DVD image '%s' with UUID {%RTuuid}"), 3207 image->getLocationFull().raw(), 3208 image->getId().raw()); 3204 3209 return S_OK; 3205 3210 } … … 3213 3218 /* Note: no AutoCaller since bound to this */ 3214 3219 AutoReadLock mediaLock (image); 3215 aConflict = Utf8StrFmt (3216 tr ("floppy image '%s' with UUID {%RTuuid}"),3217 image->locationFull().raw(), image->id().raw());3220 aConflict = Utf8StrFmt(tr("floppy image '%s' with UUID {%RTuuid}"), 3221 image->getLocationFull().raw(), 3222 image->getId().raw()); 3218 3223 return S_OK; 3219 3224 } … … 3339 3344 * @note Locks objects! 3340 3345 */ 3341 HRESULT VirtualBox::registerMachine 3346 HRESULT VirtualBox::registerMachine(Machine *aMachine) 3342 3347 { 3343 3348 ComAssertRet (aMachine, E_INVALIDARG); … … 3351 3356 3352 3357 { 3353 ComObjPtr<Machine> m;3354 rc = findMachine (aMachine->id(), false /* aDoSetError */, &m);3358 ComObjPtr<Machine> pMachine; 3359 rc = findMachine(aMachine->getId(), false /* aDoSetError */, &pMachine); 3355 3360 if (SUCCEEDED(rc)) 3356 3361 { 3357 3362 /* sanity */ 3358 AutoLimitedCaller machCaller (m); 3359 AssertComRC (machCaller.rc()); 3360 3361 return setError (E_INVALIDARG, 3362 tr ("Registered machine with UUID {%RTuuid} ('%ls') already exists"), 3363 aMachine->id().raw(), m->settingsFileFull().raw()); 3364 } 3365 3366 ComAssertRet (rc == VBOX_E_OBJECT_NOT_FOUND, rc); 3363 AutoLimitedCaller machCaller(pMachine); 3364 AssertComRC(machCaller.rc()); 3365 3366 return setError(E_INVALIDARG, 3367 tr("Registered machine with UUID {%RTuuid} ('%ls') already exists"), 3368 aMachine->getId().raw(), 3369 pMachine->getSettingsFileFull().raw()); 3370 } 3371 3372 ComAssertRet(rc == VBOX_E_OBJECT_NOT_FOUND, rc); 3367 3373 rc = S_OK; 3368 3374 } … … 3371 3377 { 3372 3378 /* Machine::trySetRegistered() will commit and save machine settings */ 3373 rc = aMachine->trySetRegistered 3379 rc = aMachine->trySetRegistered(TRUE); 3374 3380 CheckComRCReturnRC(rc); 3375 3381 } … … 3415 3421 3416 3422 Utf8Str strConflict; 3417 HRESULT rc = checkMediaForConflicts2(aHardDisk-> id(),3418 aHardDisk-> locationFull(),3423 HRESULT rc = checkMediaForConflicts2(aHardDisk->getId(), 3424 aHardDisk->getLocationFull(), 3419 3425 strConflict); 3420 3426 CheckComRCReturnRC(rc); … … 3424 3430 return setError(E_INVALIDARG, 3425 3431 tr("Cannot register the hard disk '%s' with UUID {%RTuuid} because a %s already exists in the media registry ('%s')"), 3426 aHardDisk-> locationFull().raw(),3427 aHardDisk-> id().raw(),3432 aHardDisk->getLocationFull().raw(), 3433 aHardDisk->getId().raw(), 3428 3434 strConflict.raw(), 3429 3435 m->strSettingsFilePath.raw()); 3430 3436 } 3431 3437 3432 if (aHardDisk-> parent().isNull())3438 if (aHardDisk->getParent().isNull()) 3433 3439 { 3434 3440 /* base (root) hard disk */ … … 3436 3442 } 3437 3443 3438 m->mapHardDisks 3439 .insert (HardDiskMap::value_type ( 3440 aHardDisk->id(), HardDiskMap::mapped_type (aHardDisk))); 3444 m->mapHardDisks.insert(HardDiskMap::value_type(aHardDisk->getId(), 3445 HardDiskMap::mapped_type(aHardDisk))); 3441 3446 3442 3447 if (aSaveRegistry) … … 3480 3485 AutoReadLock hardDiskLock (aHardDisk); 3481 3486 3482 size_t cnt = m->mapHardDisks.erase (aHardDisk->id());3483 Assert 3487 size_t cnt = m->mapHardDisks.erase(aHardDisk->getId()); 3488 Assert(cnt == 1); 3484 3489 NOREF(cnt); 3485 3490 3486 if (aHardDisk-> parent().isNull())3491 if (aHardDisk->getParent().isNull()) 3487 3492 { 3488 3493 /* base (root) hard disk */ 3489 m->llHardDisks.remove 3494 m->llHardDisks.remove(aHardDisk); 3490 3495 } 3491 3496 … … 3533 3538 3534 3539 Utf8Str strConflict; 3535 HRESULT rc = checkMediaForConflicts2(aImage-> id(),3536 aImage-> locationFull(),3540 HRESULT rc = checkMediaForConflicts2(aImage->getId(), 3541 aImage->getLocationFull(), 3537 3542 strConflict); 3538 3543 CheckComRCReturnRC(rc); … … 3542 3547 return setError(VBOX_E_INVALID_OBJECT_STATE, 3543 3548 tr("Cannot register the CD/DVD image '%s' with UUID {%RTuuid} because a %s already exists in the media registry ('%s')"), 3544 aImage-> locationFull().raw(),3545 aImage-> id().raw(),3549 aImage->getLocationFull().raw(), 3550 aImage->getId().raw(), 3546 3551 strConflict.raw(), 3547 3552 m->strSettingsFilePath.raw()); … … 3636 3641 3637 3642 Utf8Str strConflict; 3638 HRESULT rc = checkMediaForConflicts2(aImage-> id(),3639 aImage-> locationFull(),3643 HRESULT rc = checkMediaForConflicts2(aImage->getId(), 3644 aImage->getLocationFull(), 3640 3645 strConflict); 3641 3646 CheckComRCReturnRC(rc); … … 3645 3650 return setError(VBOX_E_INVALID_OBJECT_STATE, 3646 3651 tr("Cannot register the floppy image '%s' with UUID {%RTuuid} because a %s already exists in the media registry ('%s')"), 3647 aImage-> locationFull().raw(),3648 aImage-> id().raw(),3652 aImage->getLocationFull().raw(), 3653 aImage->getId().raw(), 3649 3654 strConflict.raw(), 3650 3655 m->strSettingsFilePath.raw()); -
trunk/src/VBox/Main/generic/NetIf-generic.cpp
r22875 r24989 139 139 140 140 ComPtr<IHost> host; 141 HRESULT rc = pVBox->COMGETTER(Host)(host.asOutParam());142 if (SUCCEEDED(rc))143 { 144 rc = progress->init(pVBox, host,141 HRESULT hrc = pVBox->COMGETTER(Host)(host.asOutParam()); 142 if (SUCCEEDED(hrc)) 143 { 144 hrc = progress->init(pVBox, host, 145 145 Bstr ("Creating host only network interface"), 146 146 FALSE /* aCancelable */); 147 if (SUCCEEDED(rc))147 if (SUCCEEDED(hrc)) 148 148 { 149 CheckComRCReturnRC(rc);150 149 progress.queryInterfaceTo(aProgress); 151 150 … … 208 207 } 209 208 210 return rc;209 return hrc; 211 210 212 211 #else -
trunk/src/VBox/Main/hgcm/HGCMObjects.cpp
r13837 r24989 90 90 if (RT_SUCCESS(rc)) 91 91 { 92 ObjectAVLCore *pCore = &pObject-> Core;92 ObjectAVLCore *pCore = &pObject->m_core; 93 93 94 94 /* Generate a new handle value. */ -
trunk/src/VBox/Main/include/AudioAdapterImpl.h
r23223 r24989 100 100 void copyFrom (AudioAdapter *aThat); 101 101 102 // public methods for internal purposes only103 // (ensure there is a caller and a read lock before calling them!)104 105 const Backupable <Data> &data() const { return mData; }106 107 102 // for VirtualBoxSupportErrorInfoImpl 108 103 static const wchar_t *getComponentName() { return L"AudioAdapter"; } … … 113 108 const ComObjPtr<AudioAdapter> mPeer; 114 109 115 Backupable 110 Backupable<Data> mData; 116 111 }; 117 112 -
trunk/src/VBox/Main/include/BIOSSettingsImpl.h
r23223 r24989 125 125 HRESULT saveSettings(settings::BIOSSettings &data); 126 126 127 const Backupable <Data> &data() const { return mData; }128 129 127 bool isModified() { AutoWriteLock alock (this); return mData.isBackedUp(); } 130 128 bool isReallyModified() { AutoWriteLock alock (this); return mData.hasActualChanges(); } … … 141 139 ComObjPtr<Machine, ComWeakRef> mParent; 142 140 ComObjPtr<BIOSSettings> mPeer; 143 Backupable 141 Backupable<Data> mData; 144 142 }; 145 143 -
trunk/src/VBox/Main/include/MachineImpl.h
r24663 r24989 636 636 // public methods only for internal purposes 637 637 638 InstanceType type() const { return mType; }638 InstanceType getType() const { return mType; } 639 639 640 640 /// @todo (dmik) add lock and make non-inlined after revising classes … … 653 653 * one) or after doing addCaller() manually. 654 654 */ 655 const ComObjPtr<VirtualBox, ComWeakRef> &virtualBox() const { return mParent; }655 const ComObjPtr<VirtualBox, ComWeakRef>& getVirtualBox() const { return mParent; } 656 656 657 657 /** … … 662 662 * one) or after adding a caller manually. 663 663 */ 664 const Guid &id() const { return mData->mUuid; }664 const Guid& getId() const { return mData->mUuid; } 665 665 666 666 /** … … 672 672 * one) or after adding a caller manually. 673 673 */ 674 inline const Guid &snapshotId() const;674 inline const Guid& getSnapshotId() const; 675 675 676 676 /** … … 681 681 * for reading. 682 682 */ 683 const Utf8Str &settingsFileFull() const { return mData->m_strConfigFileFull; }683 const Utf8Str& getSettingsFileFull() const { return mData->m_strConfigFileFull; } 684 684 685 685 /** … … 690 690 * for reading. 691 691 */ 692 const Bstr &name() const { return mUserData->mName; }692 const Bstr& getName() const { return mUserData->mName; } 693 693 694 694 // callback handlers … … 798 798 HRESULT checkStateDependency(StateDependency aDepType); 799 799 800 inline Machine * machine();800 inline Machine *getMachine(); 801 801 802 802 void ensureNoStateDependencies(); … … 1149 1149 // a caller and a read lock before calling them!) 1150 1150 1151 const Guid &snapshotId() const { return mSnapshotId; }1151 const Guid& getSnapshotId() const { return mSnapshotId; } 1152 1152 1153 1153 private: … … 1160 1160 // third party methods that depend on SnapshotMachine definiton 1161 1161 1162 inline const Guid &Machine:: snapshotId() const1162 inline const Guid &Machine::getSnapshotId() const 1163 1163 { 1164 1164 return mType != IsSnapshotMachine ? Guid::Empty : 1165 static_cast<const SnapshotMachine *>(this)-> snapshotId();1165 static_cast<const SnapshotMachine *>(this)->getSnapshotId(); 1166 1166 } 1167 1167 … … 1176 1176 * (primary) machine pointer. 1177 1177 */ 1178 inline Machine *Machine:: machine()1178 inline Machine *Machine::getMachine() 1179 1179 { 1180 1180 if (mType == IsSessionMachine) -
trunk/src/VBox/Main/include/MediumAttachmentImpl.h
r24934 r24989 80 80 void setImplicit(bool aImplicit) { m->implicit = aImplicit; } 81 81 82 const ComObjPtr<Medium> &medium() const { return m->medium; }83 Bstr controllerName() const { return m->controllerName; }84 LONG port() const { return m->port; }85 LONG device() const { return m->device; }86 DeviceType_T type() const { return m->type; }87 bool passthrough() const { AutoReadLock lock(this); return m->passthrough; }82 const ComObjPtr<Medium>& getMedium() const { return m->medium; } 83 Bstr getControllerName() const { return m->controllerName; } 84 LONG getPort() const { return m->port; } 85 LONG getDevice() const { return m->device; } 86 DeviceType_T getType() const { return m->type; } 87 bool getPassthrough() const { AutoReadLock lock(this); return m->passthrough; } 88 88 89 89 bool matches(CBSTR aControllerName, LONG aPort, LONG aDevice) … … 110 110 111 111 /** Get a unique and somewhat descriptive name for logging. */ 112 const char *logName(void) const { return mLogName.c_str(); }112 const char* getLogName(void) const { return mLogName.c_str(); } 113 113 114 114 /** For com::SupportErrorInfoImpl. */ -
trunk/src/VBox/Main/include/MediumImpl.h
r24563 r24989 167 167 #endif 168 168 169 const Guid& id() const;170 MediumState_T state() const;171 const Utf8Str& location() const;172 const Utf8Str& locationFull() const;173 uint64_t size() const;169 const Guid& getId() const; 170 MediumState_T getState() const; 171 const Utf8Str& getLocation() const; 172 const Utf8Str& getLocationFull() const; 173 uint64_t getSize() const; 174 174 175 175 const Guid* getFirstMachineBackrefId() const; … … 179 179 * Shortcut to VirtualBoxBaseWithTypedChildrenNEXT::dependentChildren(). 180 180 */ 181 const List &children() const { return dependentChildren(); }181 const List& getChildren() const { return dependentChildren(); } 182 182 183 183 void updatePaths(const char *aOldPath, const char *aNewPath); 184 184 185 ComObjPtr<Medium> base(uint32_t *aLevel = NULL);185 ComObjPtr<Medium> getBase(uint32_t *aLevel = NULL); 186 186 187 187 bool isReadOnly(); … … 244 244 void cancelMergeTo(MergeChain *aChain); 245 245 246 Utf8Str name();246 Utf8Str getName(); 247 247 248 248 HRESULT prepareDiscard(MergeChain * &aChain); … … 256 256 // a caller and a read lock before calling them!) 257 257 258 ComObjPtr<Medium> parent() const { return static_cast<Medium *>(mParent); }259 MediumType_T type() const;258 ComObjPtr<Medium> getParent() const { return static_cast<Medium *>(mParent); } 259 MediumType_T getType() const; 260 260 261 261 /** For com::SupportErrorInfoImpl. */ … … 264 264 protected: 265 265 266 RWLockHandle* treeLock();266 RWLockHandle* getTreeLock(); 267 267 268 268 /** Reimplements VirtualBoxWithTypedChildren::childrenLock() to return 269 269 * treeLock(). */ 270 RWLockHandle *childrenLock() { return treeLock(); }270 RWLockHandle *childrenLock() { return getTreeLock(); } 271 271 272 272 private: -
trunk/src/VBox/Main/include/NetworkAdapterImpl.h
r23223 r24989 147 147 void applyDefaults (GuestOSType *aOsType); 148 148 149 // public methods for internal purposes only150 // (ensure there is a caller and a read lock before calling them!)151 152 const Backupable <Data> &data() const { return mData; }153 154 149 // for VirtualBoxSupportErrorInfoImpl 155 150 static const wchar_t *getComponentName() { return L"NetworkAdapter"; } … … 163 158 const ComObjPtr<NetworkAdapter> mPeer; 164 159 165 Backupable 160 Backupable<Data> mData; 166 161 }; 167 162 -
trunk/src/VBox/Main/include/ParallelPortImpl.h
r23223 r24989 125 125 const ComObjPtr<ParallelPort> mPeer; 126 126 127 Backupable 127 Backupable<Data> mData; 128 128 }; 129 129 -
trunk/src/VBox/Main/include/ProgressImpl.h
r24969 r24989 94 94 // a caller and a read lock before calling them!) 95 95 96 BOOL completed() const { return mCompleted; }97 HRESULT resultCode() const { return mResultCode; }96 BOOL getCompleted() const { return mCompleted; } 97 HRESULT getResultCode() const { return mResultCode; } 98 98 double calcTotalPercent(); 99 99 -
trunk/src/VBox/Main/include/SerialPortImpl.h
r23223 r24989 138 138 const ComObjPtr<SerialPort> mPeer; 139 139 140 Backupable 140 Backupable<Data> mData; 141 141 }; 142 142 -
trunk/src/VBox/Main/include/SharedFolderImpl.h
r23223 r24989 85 85 // (ensure there is a caller added before calling them!) 86 86 87 const Bstr &name() const { return m.name; }88 const Bstr &hostPath() const { return m.hostPath; }89 BOOL writable() const { return m.writable; }87 const Bstr& getName() const { return m.name; } 88 const Bstr& getHostPath() const { return m.hostPath; } 89 BOOL isWritable() const { return m.writable; } 90 90 91 91 // for VirtualBoxSupportErrorInfoImpl -
trunk/src/VBox/Main/include/USBControllerImpl.h
r23223 r24989 137 137 const ComObjPtr<Machine, ComWeakRef> &parent() { return mParent; }; 138 138 139 const Backupable<Data> &data() { return mData; }139 const Backupable<Data>& getData() { return mData; } 140 140 141 141 // for VirtualBoxSupportErrorInfoImpl … … 162 162 const ComObjPtr<USBController> mPeer; 163 163 /** Data. */ 164 Backupable 164 Backupable<Data> mData; 165 165 166 166 #ifdef VBOX_WITH_USB -
trunk/src/VBox/Main/include/VRDPServerImpl.h
r23643 r24989 119 119 void copyFrom (VRDPServer *aThat); 120 120 121 // public methods for internal purposes only122 // (ensure there is a caller and a read lock before calling them!)123 124 const Backupable <Data> &data() const { return mData; }125 126 121 // for VirtualBoxSupportErrorInfoImpl 127 122 static const wchar_t *getComponentName() { return L"VRDPServer"; } … … 132 127 const ComObjPtr<VRDPServer> mPeer; 133 128 134 Backupable 129 Backupable<Data> mData; 135 130 }; 136 131 -
trunk/src/VBox/Main/include/VirtualBoxBase.h
r24655 r24989 1163 1163 bool aLimited = false) \ 1164 1164 { \ 1165 VirtualBoxBaseProto::State state; \1166 HRESULT rc = VirtualBoxBaseProto::addCaller(& state, aLimited); \1165 VirtualBoxBaseProto::State protoState; \ 1166 HRESULT rc = VirtualBoxBaseProto::addCaller(&protoState, aLimited); \ 1167 1167 if (FAILED(rc)) \ 1168 1168 { \ 1169 if ( state == VirtualBoxBaseProto::Limited) \1169 if (protoState == VirtualBoxBaseProto::Limited) \ 1170 1170 rc = setError(rc, tr("The object functionality is limited")); \ 1171 1171 else \ … … 1173 1173 } \ 1174 1174 if (aState) \ 1175 *aState = state; \1175 *aState = protoState; \ 1176 1176 return rc; \ 1177 1177 } \ … … 2233 2233 } 2234 2234 2235 void attach(D *d ata) {2236 AssertMsg(d ata, ("new data must not be NULL"));2237 if (d ata && mData != data) {2235 void attach(D *d) { 2236 AssertMsg(d, ("new data must not be NULL")); 2237 if (d && mData != d) { 2238 2238 if (mData && !mIsShared) 2239 2239 delete mData; 2240 mData = d ata;2240 mData = d; 2241 2241 mIsShared = false; 2242 2242 } 2243 2243 } 2244 2244 2245 void attach(Shareable &d ata) {2245 void attach(Shareable &d) { 2246 2246 AssertMsg( 2247 d ata.mData == mData || !data.mIsShared,2247 d.mData == mData || !d.mIsShared, 2248 2248 ("new data must not be shared") 2249 2249 ); 2250 if (this != &d ata && !data.mIsShared) {2251 attach (data.mData);2252 d ata.mIsShared = true;2250 if (this != &d && !d.mIsShared) { 2251 attach(d.mData); 2252 d.mIsShared = true; 2253 2253 } 2254 2254 } 2255 2255 2256 void share(D *d ata) {2257 AssertMsg(d ata, ("new data must not be NULL"));2258 if (mData != d ata) {2256 void share(D *d) { 2257 AssertMsg(d, ("new data must not be NULL")); 2258 if (mData != d) { 2259 2259 if (mData && !mIsShared) 2260 2260 delete mData; 2261 mData = d ata;2261 mData = d; 2262 2262 mIsShared = true; 2263 2263 } 2264 2264 } 2265 2265 2266 void share(const Shareable &d ata) { share (data.mData); }2267 2268 void attachCopy(const D *d ata) {2269 AssertMsg(d ata, ("data to copy must not be NULL"));2270 if (d ata)2271 attach(new D(*d ata));2272 } 2273 2274 void attachCopy(const Shareable &d ata) {2275 attachCopy(d ata.mData);2266 void share(const Shareable &d) { share(d.mData); } 2267 2268 void attachCopy(const D *d) { 2269 AssertMsg(d, ("data to copy must not be NULL")); 2270 if (d) 2271 attach(new D(*d)); 2272 } 2273 2274 void attachCopy(const Shareable &d) { 2275 attachCopy(d.mData); 2276 2276 } 2277 2277 … … 2330 2330 } 2331 2331 2332 void share(const Backupable &d ata)2333 { 2334 AssertMsg(!d ata.isBackedUp(), ("data to share must not be backed up"));2335 if (!d ata.isBackedUp())2336 Shareable<D>::share(d ata.mData);2332 void share(const Backupable &d) 2333 { 2334 AssertMsg(!d.isBackedUp(), ("data to share must not be backed up")); 2335 if (!d.isBackedUp()) 2336 Shareable<D>::share(d.mData); 2337 2337 } 2338 2338 … … 2410 2410 } 2411 2411 2412 void assignCopy(const D * data)2412 void assignCopy(const D *pData) 2413 2413 { 2414 2414 AssertMsg(this->mData, ("data must not be NULL")); 2415 AssertMsg( data, ("data to copy must not be NULL"));2416 if (this->mData && data)2415 AssertMsg(pData, ("data to copy must not be NULL")); 2416 if (this->mData && pData) 2417 2417 { 2418 2418 if (!mBackupData) 2419 2419 { 2420 D *pNewData = new D(* data);2420 D *pNewData = new D(*pData); 2421 2421 mBackupData = this->mData; 2422 2422 this->mData = pNewData; 2423 2423 } 2424 2424 else 2425 *this->mData = * data;2425 *this->mData = *pData; 2426 2426 } 2427 2427 } 2428 2428 2429 void assignCopy(const Backupable &d ata)2430 { 2431 assignCopy(d ata.mData);2429 void assignCopy(const Backupable &d) 2430 { 2431 assignCopy(d.mData); 2432 2432 } 2433 2433 -
trunk/src/VBox/Main/include/hgcm/HGCMObjects.h
r8155 r24989 50 50 { 51 51 private: 52 friend uint32_t hgcmObjMake(HGCMObject *pObject, uint32_t u32HandleIn);52 friend uint32_t hgcmObjMake(HGCMObject *pObject, uint32_t u32HandleIn); 53 53 54 int32_t volatile cRef;55 HGCMOBJ_TYPE enmObjType;54 int32_t volatile m_cRefs; 55 HGCMOBJ_TYPE m_enmObjType; 56 56 57 ObjectAVLCore Core;57 ObjectAVLCore m_core; 58 58 59 59 protected: 60 virtual ~HGCMObject (void) {}; 60 virtual ~HGCMObject() 61 {}; 61 62 62 63 public: 63 HGCMObject (HGCMOBJ_TYPE enmObjType) : cRef (0) 64 HGCMObject(HGCMOBJ_TYPE enmObjType) 65 : m_cRefs(0) 64 66 { 65 this-> enmObjType = enmObjType;67 this->m_enmObjType = enmObjType; 66 68 }; 67 69 68 void Reference (void)70 void Reference() 69 71 { 70 int32_t refCnt = ASMAtomicIncS32 (&cRef);72 int32_t refCnt = ASMAtomicIncS32(&m_cRefs); 71 73 NOREF(refCnt); 72 74 Log(("Reference: refCnt = %d\n", refCnt)); 73 75 } 74 76 75 void Dereference (void)77 void Dereference() 76 78 { 77 int32_t refCnt = ASMAtomicDecS32 (&cRef);79 int32_t refCnt = ASMAtomicDecS32(&m_cRefs); 78 80 79 81 Log(("Dereference: refCnt = %d\n", refCnt)); 80 82 81 83 AssertRelease(refCnt >= 0); 82 84 … … 89 91 } 90 92 91 uint32_t Handle (void)93 uint32_t Handle() 92 94 { 93 return Core.AvlCore.Key;95 return m_core.AvlCore.Key; 94 96 }; 95 97 96 HGCMOBJ_TYPE Type (void)98 HGCMOBJ_TYPE Type() 97 99 { 98 return enmObjType;100 return m_enmObjType; 99 101 }; 100 102 }; 101 103 102 int hgcmObjInit (void);104 int hgcmObjInit(); 103 105 104 void hgcmObjUninit (void);106 void hgcmObjUninit(); 105 107 106 uint32_t hgcmObjGenerateHandle 107 uint32_t hgcmObjAssignHandle 108 uint32_t hgcmObjGenerateHandle(HGCMObject *pObject); 109 uint32_t hgcmObjAssignHandle(HGCMObject *pObject, uint32_t u32Handle); 108 110 109 void hgcmObjDeleteHandle 111 void hgcmObjDeleteHandle(uint32_t handle); 110 112 111 HGCMObject *hgcmObjReference 113 HGCMObject *hgcmObjReference(uint32_t handle, HGCMOBJ_TYPE enmObjType); 112 114 113 void hgcmObjDereference 115 void hgcmObjDereference(HGCMObject *pObject); 114 116 115 uint32_t hgcmObjQueryHandleCount 116 void hgcmObjSetHandleCount 117 uint32_t hgcmObjQueryHandleCount(); 118 void hgcmObjSetHandleCount(uint32_t u32HandleCount); 117 119 118 120 #endif /* __HGCMOBJECTS__H */ -
trunk/src/VBox/Main/xml/Settings.cpp
r24888 r24989 179 179 va_list args; 180 180 va_start(args, pcszFormat); 181 Utf8StrFmtVA what(pcszFormat, args);181 Utf8StrFmtVA strWhat(pcszFormat, args); 182 182 va_end(args); 183 183 … … 190 190 file->m->strFilename.c_str(), 191 191 (pcsz) ? pcsz : "", 192 what.c_str());192 strWhat.c_str()); 193 193 194 194 setWhat(str.c_str()); … … 1089 1089 */ 1090 1090 void MainConfigFile::writeHardDisk(xml::ElementNode &elmMedium, 1091 const Medium &m ,1091 const Medium &mdm, 1092 1092 uint32_t level) // 0 for "root" call, incremented with each recursion 1093 1093 { 1094 1094 xml::ElementNode *pelmHardDisk = elmMedium.createChild("HardDisk"); 1095 pelmHardDisk->setAttribute("uuid", makeString(m .uuid));1096 pelmHardDisk->setAttribute("location", m .strLocation);1097 pelmHardDisk->setAttribute("format", m .strFormat);1098 if (m .fAutoReset)1099 pelmHardDisk->setAttribute("autoReset", m .fAutoReset);1100 if (m .strDescription.length())1101 pelmHardDisk->setAttribute("Description", m .strDescription);1102 1103 for (PropertiesMap::const_iterator it = m .properties.begin();1104 it != m .properties.end();1095 pelmHardDisk->setAttribute("uuid", makeString(mdm.uuid)); 1096 pelmHardDisk->setAttribute("location", mdm.strLocation); 1097 pelmHardDisk->setAttribute("format", mdm.strFormat); 1098 if (mdm.fAutoReset) 1099 pelmHardDisk->setAttribute("autoReset", mdm.fAutoReset); 1100 if (mdm.strDescription.length()) 1101 pelmHardDisk->setAttribute("Description", mdm.strDescription); 1102 1103 for (PropertiesMap::const_iterator it = mdm.properties.begin(); 1104 it != mdm.properties.end(); 1105 1105 ++it) 1106 1106 { … … 1114 1114 { 1115 1115 const char *pcszType = 1116 m .hdType == MediumType_Normal ? "Normal" :1117 m .hdType == MediumType_Immutable ? "Immutable" :1118 /*m .hdType == MediumType_Writethrough ?*/ "Writethrough";1116 mdm.hdType == MediumType_Normal ? "Normal" : 1117 mdm.hdType == MediumType_Immutable ? "Immutable" : 1118 /*mdm.hdType == MediumType_Writethrough ?*/ "Writethrough"; 1119 1119 pelmHardDisk->setAttribute("type", pcszType); 1120 1120 } 1121 1121 1122 for (MediaList::const_iterator it = m .llChildren.begin();1123 it != m .llChildren.end();1122 for (MediaList::const_iterator it = mdm.llChildren.begin(); 1123 it != mdm.llChildren.end(); 1124 1124 ++it) 1125 1125 { … … 1171 1171 ++it) 1172 1172 { 1173 const Medium &m = *it;1173 const Medium &mdm = *it; 1174 1174 xml::ElementNode *pelmMedium = pelmDVDImages->createChild("Image"); 1175 pelmMedium->setAttribute("uuid", makeString(m .uuid));1176 pelmMedium->setAttribute("location", m .strLocation);1177 if (m .strDescription.length())1178 pelmMedium->setAttribute("Description", m .strDescription);1175 pelmMedium->setAttribute("uuid", makeString(mdm.uuid)); 1176 pelmMedium->setAttribute("location", mdm.strLocation); 1177 if (mdm.strDescription.length()) 1178 pelmMedium->setAttribute("Description", mdm.strDescription); 1179 1179 } 1180 1180 … … 1184 1184 ++it) 1185 1185 { 1186 const Medium &m = *it;1186 const Medium &mdm = *it; 1187 1187 xml::ElementNode *pelmMedium = pelmFloppyImages->createChild("Image"); 1188 pelmMedium->setAttribute("uuid", makeString(m .uuid));1189 pelmMedium->setAttribute("location", m .strLocation);1190 if (m .strDescription.length())1191 pelmMedium->setAttribute("Description", m .strDescription);1188 pelmMedium->setAttribute("uuid", makeString(mdm.uuid)); 1189 pelmMedium->setAttribute("location", mdm.strLocation); 1190 if (mdm.strDescription.length()) 1191 pelmMedium->setAttribute("Description", mdm.strDescription); 1192 1192 } 1193 1193 -
trunk/src/VBox/Main/xpcom/server.cpp
r24830 r24989 677 677 static nsresult 678 678 RegisterSelfComponents(nsIComponentRegistrar *registrar, 679 const nsModuleComponentInfoEx * components,679 const nsModuleComponentInfoEx *aComponents, 680 680 PRUint32 count) 681 681 { 682 682 nsresult rc = NS_OK; 683 const nsModuleComponentInfoEx *info = components;683 const nsModuleComponentInfoEx *info = aComponents; 684 684 for (PRUint32 i = 0; i < count && NS_SUCCEEDED(rc); i++, info++) 685 685 {
Note:
See TracChangeset
for help on using the changeset viewer.