Changeset 66941 in vbox for trunk/src/VBox
- Timestamp:
- May 17, 2017 5:54:01 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 115473
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r66877 r66941 1085 1085 { 1086 1086 /* look up the object by Id to check it is valid */ 1087 ComPtr<IGuestOSType> guestOSType; 1088 HRESULT rc = mParent->GetGuestOSType(Bstr(aOSTypeId).raw(), guestOSType.asOutParam()); 1087 ComObjPtr<GuestOSType> pGuestOSType; 1088 HRESULT rc = mParent->i_findGuestOSType(aOSTypeId, 1089 pGuestOSType); 1089 1090 if (FAILED(rc)) return rc; 1090 1091 1091 1092 /* when setting, always use the "etalon" value for consistency -- lookup 1092 1093 * by ID is case-insensitive and the input value may have different case */ 1093 Bstr osTypeId; 1094 rc = guestOSType->COMGETTER(Id)(osTypeId.asOutParam()); 1095 if (FAILED(rc)) return rc; 1094 Utf8Str osTypeId = pGuestOSType->i_id(); 1096 1095 1097 1096 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 1285 1284 default: 1286 1285 { 1287 ComPtr<IGuestOSType> ptrGuestOSType; 1288 HRESULT hrc2 = mParent->GetGuestOSType(Bstr(mUserData->s.strOsType).raw(), ptrGuestOSType.asOutParam()); 1286 ComObjPtr<GuestOSType> pGuestOSType; 1287 HRESULT hrc2 = mParent->i_findGuestOSType(mUserData->s.strOsType, 1288 pGuestOSType); 1289 1289 AssertMsgReturn(SUCCEEDED(hrc2), ("Failed to get guest OS type. hrc2=%Rhrc\n", hrc2), hrc2); 1290 1290 1291 Bstr guestTypeFamilyId; 1292 hrc2 = ptrGuestOSType->COMGETTER(FamilyId)(guestTypeFamilyId.asOutParam()); 1293 AssertMsgReturn(SUCCEEDED(hrc2), ("Failed to get guest family. hrc2=%Rhrc\n", hrc2), hrc2); 1294 BOOL fOsXGuest = guestTypeFamilyId == Bstr("MacOS"); 1291 Utf8Str guestTypeFamilyId = pGuestOSType->i_familyId(); 1292 bool fOsXGuest = guestTypeFamilyId == "MacOS"; 1295 1293 1296 1294 switch (mHWData->mParavirtProvider) … … 2226 2224 *aValue = FALSE; 2227 2225 2228 ComPtr<IGuestOSType> ptrGuestOSType; 2229 HRESULT hrc2 = mParent->GetGuestOSType(Bstr(mUserData->s.strOsType).raw(), ptrGuestOSType.asOutParam()); 2226 ComObjPtr<GuestOSType> pGuestOSType; 2227 HRESULT hrc2 = mParent->i_findGuestOSType(mUserData->s.strOsType, 2228 pGuestOSType); 2230 2229 if (SUCCEEDED(hrc2)) 2231 2230 { 2232 BOOL fIs64Bit = FALSE; 2233 hrc2 = ptrGuestOSType->COMGETTER(Is64Bit)(&fIs64Bit); AssertComRC(hrc2); 2234 if (SUCCEEDED(hrc2) && fIs64Bit) 2231 if (pGuestOSType->i_is64Bit()) 2235 2232 { 2236 ComObjPtr<Host> p trHost = mParent->i_host();2233 ComObjPtr<Host> pHost = mParent->i_host(); 2237 2234 alock.release(); 2238 2235 2239 hrc2 = p trHost->GetProcessorFeature(ProcessorFeature_LongMode, aValue); AssertComRC(hrc2);2236 hrc2 = pHost->GetProcessorFeature(ProcessorFeature_LongMode, aValue); AssertComRC(hrc2); 2240 2237 if (FAILED(hrc2)) 2241 2238 *aValue = FALSE; … … 3859 3856 MediumAttachment *pAttachTemp; 3860 3857 if ((pAttachTemp = i_findAttachment(*mMediumAttachments.data(), 3861 Bstr(aName).raw(),3858 aName, 3862 3859 aControllerPort, 3863 3860 aDevice))) … … 3946 3943 3947 3944 /* see if it's the same bus/channel/device */ 3948 if (pAttachTemp->i_matches( Bstr(aName).raw(), aControllerPort, aDevice))3945 if (pAttachTemp->i_matches(aName, aControllerPort, aDevice)) 3949 3946 { 3950 3947 /* the simplest case: restore the whole attachment … … 4047 4044 * descendant of medium will be used 4048 4045 */ 4049 if (pAttach->i_matches( Bstr(aName).raw(), aControllerPort, aDevice))4046 if (pAttach->i_matches(aName, aControllerPort, aDevice)) 4050 4047 { 4051 4048 /* the simplest case: restore the whole attachment … … 4421 4418 4422 4419 MediumAttachment *pAttach = i_findAttachment(*mMediumAttachments.data(), 4423 Bstr(aName).raw(),4420 aName, 4424 4421 aControllerPort, 4425 4422 aDevice); … … 4478 4475 4479 4476 MediumAttachment *pAttach = i_findAttachment(*mMediumAttachments.data(), 4480 Bstr(aName).raw(),4477 aName, 4481 4478 aControllerPort, 4482 4479 aDevice); … … 4514 4511 4515 4512 MediumAttachment *pAttach = i_findAttachment(*mMediumAttachments.data(), 4516 Bstr(aName).raw(),4513 aName, 4517 4514 aControllerPort, 4518 4515 aDevice); … … 4557 4554 4558 4555 MediumAttachment *pAttach = i_findAttachment(*mMediumAttachments.data(), 4559 Bstr(aName).raw(),4556 aName, 4560 4557 aControllerPort, 4561 4558 aDevice); … … 4600 4597 4601 4598 MediumAttachment *pAttach = i_findAttachment(*mMediumAttachments.data(), 4602 Bstr(aName).raw(),4599 aName, 4603 4600 aControllerPort, 4604 4601 aDevice); … … 4642 4639 4643 4640 MediumAttachment *pAttach = i_findAttachment(*mMediumAttachments.data(), 4644 Bstr(aName).raw(),4641 aName, 4645 4642 aControllerPort, 4646 4643 aDevice); … … 4710 4707 4711 4708 MediumAttachment *pAttach = i_findAttachment(*mMediumAttachments.data(), 4712 Bstr(aName).raw(),4709 aName, 4713 4710 aControllerPort, 4714 4711 aDevice); … … 4760 4757 aName.c_str(), aControllerPort, aDevice, aType)); 4761 4758 4762 rc = AttachDevice(Bstr(aName).raw(), aControllerPort, aDevice, aType, NULL);4759 rc = attachDevice(aName, aControllerPort, aDevice, aType, NULL); 4763 4760 4764 4761 return rc; … … 4797 4794 4798 4795 ComObjPtr<MediumAttachment> pAttach = i_findAttachment(*mMediumAttachments.data(), 4799 Bstr(aName).raw(),4796 aName, 4800 4797 aControllerPort, 4801 4798 aDevice); … … 4844 4841 // old settings. Re-get the correct reference. 4845 4842 pAttach = i_findAttachment(*mMediumAttachments.data(), 4846 Bstr(aName).raw(),4843 aName, 4847 4844 aControllerPort, 4848 4845 aDevice); … … 4878 4875 pMedium->i_removeBackReference(mData->mUuid); 4879 4876 pAttach = i_findAttachment(*mMediumAttachments.data(), 4880 Bstr(aName).raw(),4877 aName, 4881 4878 aControllerPort, 4882 4879 aDevice); … … 4913 4910 4914 4911 ComObjPtr<MediumAttachment> pAttach = i_findAttachment(*mMediumAttachments.data(), 4915 Bstr(aName).raw(),4912 aName, 4916 4913 aControllerPort, 4917 4914 aDevice); … … 5524 5521 rc = pProgress->init(i_getVirtualBox(), 5525 5522 static_cast<IMachine*>(this) /* aInitiator */, 5526 Bstr(tr("Deleting files")).raw(),5523 tr("Deleting files"), 5527 5524 true /* fCancellable */, 5528 5525 (ULONG)(1 + llMediums.size() + llFilesToDelete.size() + 1), // cOperations 5529 Bstr(tr("Collecting file inventory")).raw());5526 tr("Collecting file inventory")); 5530 5527 if (FAILED(rc)) 5531 5528 return rc; … … 5725 5722 rc = E_ACCESSDENIED; 5726 5723 else 5727 rc = directControl->AccessGuestProperty(Bstr(aName).raw(), Bstr ("").raw(), Bstr("").raw(),5724 rc = directControl->AccessGuestProperty(Bstr(aName).raw(), Bstr::Empty.raw(), Bstr::Empty.raw(), 5728 5725 0 /* accessMode */, 5729 5726 &bValue, aTimestamp, &bFlags); … … 6089 6086 6090 6087 ComObjPtr<MediumAttachment> pAttach = i_findAttachment(*mMediumAttachments.data(), 6091 Bstr(aName).raw(),6088 aName, 6092 6089 aControllerPort, 6093 6090 aDevice); … … 6807 6804 RTStrPrintf(name, sizeof(name), "host%02x:%02x.%x", (aHostAddress>>8) & 0xff, 6808 6805 (aHostAddress & 0xf8) >> 3, aHostAddress & 7); 6809 Bstr bname(name);6810 6806 pda.createObject(); 6811 pda->init(this, bname,aHostAddress, aDesiredGuestAddress, TRUE);6807 pda->init(this, name, aHostAddress, aDesiredGuestAddress, TRUE); 6812 6808 i_setModified(IsModified_MachineData); 6813 6809 mHWData.backup(); … … 7408 7404 vrc = RTPathAbs(szTmp, szTmp2, sizeof(szTmp2)); 7409 7405 if (RT_SUCCESS(vrc)) 7410 aLogFolder = BstrFmt("%s%c%s",7411 szTmp2,7412 RTPATH_DELIMITER,7413 mUserData->s.strName.c_str()); // path/to/logfolder/vmname7406 aLogFolder = Utf8StrFmt("%s%c%s", 7407 szTmp2, 7408 RTPATH_DELIMITER, 7409 mUserData->s.strName.c_str()); // path/to/logfolder/vmname 7414 7410 } 7415 7411 else … … 8737 8733 8738 8734 // look up the object by Id to check it is valid 8739 Com Ptr<IGuestOSType> guestOSType;8740 HRESULT rc = mParent-> GetGuestOSType(Bstr(mUserData->s.strOsType).raw(),8741 guestOSType.asOutParam());8735 ComObjPtr<GuestOSType> pGuestOSType; 8736 HRESULT rc = mParent->i_findGuestOSType(mUserData->s.strOsType, 8737 pGuestOSType); 8742 8738 if (FAILED(rc)) return rc; 8739 mUserData->s.strOsType = pGuestOSType->i_id(); 8743 8740 8744 8741 // stateFile (optional) … … 9107 9104 const settings::NetworkAdapter &nic = *it; 9108 9105 9109 /* slot uni cityis guaranteed by XML Schema */9106 /* slot uniqueness is guaranteed by XML Schema */ 9110 9107 AssertBreak(nic.ulSlot < mNetworkAdapters.size()); 9111 9108 rc = mNetworkAdapters[nic.ulSlot]->i_loadSettings(mBandwidthControl, nic); … … 9265 9262 9266 9263 /** 9267 * Called from Machine::loadHardware() to load the debugging settings of the9264 * Called from i_loadHardware() to load the debugging settings of the 9268 9265 * machine. 9269 9266 * … … 9526 9523 } 9527 9524 9528 const Bstr controllerName = aStorageController->i_getName();9525 const Utf8Str controllerName = aStorageController->i_getName(); 9529 9526 ComObjPtr<MediumAttachment> pAttachment; 9530 9527 pAttachment.createObject(); … … 12838 12835 { 12839 12836 multilock.release(); 12840 LogRel(("VM '%s' stops using NAT network '%ls'\n", 12841 mUserData->s.strName.c_str(), name.raw())); 12842 mParent->i_natNetworkRefDec(name.raw()); 12837 Utf8Str strName(name); 12838 LogRel(("VM '%s' stops using NAT network '%s'\n", 12839 mUserData->s.strName.c_str(), strName.c_str())); 12840 mParent->i_natNetworkRefDec(strName); 12843 12841 multilock.acquire(); 12844 12842 } … … 13125 13123 rc = pProgress->init(i_getVirtualBox(), 13126 13124 static_cast<IMachine *>(this) /* aInitiator */, 13127 Bstr(tr("Saving the execution state of the virtual machine")).raw(),13125 tr("Saving the execution state of the virtual machine"), 13128 13126 FALSE /* aCancelable */); 13129 13127 if (FAILED(rc)) … … 13255 13253 if (SUCCEEDED(hrc)) 13256 13254 { 13257 LogRel(("VM '%s' starts using NAT network '%ls'\n", 13258 mUserData->s.strName.c_str(), name.raw())); 13255 Utf8Str strName(name); 13256 LogRel(("VM '%s' starts using NAT network '%s'\n", 13257 mUserData->s.strName.c_str(), strName.c_str())); 13259 13258 mPeer->lockHandle()->unlockWrite(); 13260 mParent->i_natNetworkRefInc( name.raw());13259 mParent->i_natNetworkRefInc(strName); 13261 13260 #ifdef RT_LOCK_STRICT 13262 13261 mPeer->lockHandle()->lockWrite(RT_SRC_POS); … … 13322 13321 pProgress->init(i_getVirtualBox(), 13323 13322 static_cast<IMachine *>(this) /* aInitiator */, 13324 Bstr(tr("Stopping the virtual machine")).raw(),13323 tr("Stopping the virtual machine"), 13325 13324 FALSE /* aCancelable */); 13326 13325 … … 13752 13751 ComObjPtr<MediumAttachment> pAttach = static_cast<MediumAttachment *>(iAttach); 13753 13752 13754 Bstr ctrlName;13753 Utf8Str ctrlName; 13755 13754 LONG lPort; 13756 13755 LONG lDevice; … … 13780 13779 // old settings. Re-get the correct reference. 13781 13780 pAttach = i_findAttachment(*mMediumAttachments.data(), 13782 ctrlName .raw(),13781 ctrlName, 13783 13782 lPort, 13784 13783 lDevice);
Note:
See TracChangeset
for help on using the changeset viewer.