Changeset 31539 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 10, 2010 3:40:18 PM (14 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImplExport.cpp
r31464 r31539 106 106 107 107 // get name 108 bstrName1 = mUserData->mName;108 Utf8Str strVMName = mUserData->s.strName; 109 109 // get description 110 bstrDescription = mUserData->mDescription;110 Utf8Str strDescription = mUserData->s.strDescription; 111 111 // get guest OS 112 bstrGuestOSType = mUserData->mOSTypeId;112 Utf8Str strOsTypeVBox = mUserData->s.strOsType; 113 113 // CPU count 114 114 cCPUs = mHWData->mCPUCount; … … 126 126 127 127 /* Guest OS type */ 128 Utf8Str strOsTypeVBox(bstrGuestOSType);129 128 ovf::CIMOSType_T cim = convertVBoxOSType2CIMOSType(strOsTypeVBox.c_str()); 130 129 pNewDesc->addEntry(VirtualSystemDescriptionType_OS, … … 134 133 135 134 /* VM name */ 136 Utf8Str strVMName(bstrName1);137 135 pNewDesc->addEntry(VirtualSystemDescriptionType_Name, 138 136 "", … … 141 139 142 140 // description 143 Utf8Str strDescription(bstrDescription);144 141 pNewDesc->addEntry(VirtualSystemDescriptionType_Description, 145 142 "", … … 1506 1503 1507 1504 // create a new hard disk interface for the destination disk image 1508 Log(("Creating target disk \"%s\"\n", strTargetFilePath. raw()));1505 Log(("Creating target disk \"%s\"\n", strTargetFilePath.c_str())); 1509 1506 rc = mVirtualBox->CreateHardDisk(bstrSrcFormat, Bstr(strTargetFilePath), pTargetDisk.asOutParam()); 1510 1507 if (FAILED(rc)) throw rc; -
trunk/src/VBox/Main/ApplianceImplImport.cpp
r31333 r31539 498 498 /* Construct a unique target path */ 499 499 Utf8StrFmt strPath("%s%c%s", 500 strDefaultHardDiskFolder. raw(),500 strDefaultHardDiskFolder.c_str(), 501 501 RTPATH_DELIMITER, 502 502 strFilename.c_str()); … … 1972 1972 */ 1973 1973 1974 config. strDescription = stack.strDescription;1974 config.machineUserData.strDescription = stack.strDescription; 1975 1975 1976 1976 config.hardwareMachine.cCPUs = stack.cCPUs; … … 2087 2087 DebugBreakThrow(setError(E_FAIL, 2088 2088 tr("<vbox:Machine> element in OVF contains a medium attachment for the disk image %s but the OVF describes no such image"), 2089 strUuid. raw()));2089 strUuid.c_str())); 2090 2090 } // for (settings::AttachedDevicesList::const_iterator dit = sc.llAttachedDevices.begin(); 2091 2091 } // for (settings::StorageControllersList::const_iterator sit = config.storageMachine.llStorageControllers.begin(); -
trunk/src/VBox/Main/ConsoleImpl.cpp
r31332 r31539 2309 2309 rc = setError(VBOX_E_FILE_ERROR, 2310 2310 tr("Could not create a directory '%s' to save the state to (%Rrc)"), 2311 dir. raw(), vrc);2311 dir.c_str(), vrc); 2312 2312 break; 2313 2313 } … … 2980 2980 va_end(args); 2981 2981 return rc; 2982 }2983 2984 HRESULT Console::setAuthLibraryError(const char *filename, int rc)2985 {2986 return setError(E_FAIL, tr("Could not load the external authentication library '%s' (%Rrc)"), filename, rc);2987 2982 } 2988 2983 … … 4944 4939 4945 4940 Utf8Str logFile = Utf8StrFmt("%s%cVBox.log", 4946 logDir. raw(), RTPATH_DELIMITER);4941 logDir.c_str(), RTPATH_DELIMITER); 4947 4942 Utf8Str pngFile = Utf8StrFmt("%s%cVBox.png", 4948 logDir. raw(), RTPATH_DELIMITER);4943 logDir.c_str(), RTPATH_DELIMITER); 4949 4944 4950 4945 /* … … 4969 4964 { 4970 4965 if (i > 0) 4971 oldName = Utf8StrFmt("%s.%d", files[j]-> raw(), i);4966 oldName = Utf8StrFmt("%s.%d", files[j]->c_str(), i); 4972 4967 else 4973 4968 oldName = *files[j]; 4974 newName = Utf8StrFmt("%s.%d", files[j]-> raw(), i + 1);4969 newName = Utf8StrFmt("%s.%d", files[j]->c_str(), i + 1); 4975 4970 /* If the old file doesn't exist, delete the new file (if it 4976 4971 * exists) to provide correct rotation even if the sequence is … … 4992 4987 int vrc = RTLogCreateEx(&loggerRelease, fFlags, "all", 4993 4988 "VBOX_RELEASE_LOG", RT_ELEMENTS(s_apszGroups), s_apszGroups, 4994 RTLOGDEST_FILE, szError, sizeof(szError), logFile. raw());4989 RTLOGDEST_FILE, szError, sizeof(szError), logFile.c_str()); 4995 4990 if (RT_SUCCESS(vrc)) 4996 4991 { … … 6376 6371 6377 6372 LogFlowThisFunc(("Proxying USB device '%s' {%RTuuid}...\n", 6378 Address. raw(), uuid.ptr()));6373 Address.c_str(), uuid.ptr())); 6379 6374 6380 6375 /* leave the lock before a VMR3* call (EMT will call us back)! */ … … 6383 6378 /** @todo just do everything here and only wrap the PDMR3Usb call. That'll offload some notification stuff from the EMT thread. */ 6384 6379 int vrc = VMR3ReqCallWait(mpVM, VMCPUID_ANY, 6385 (PFNRT) usbAttachCallback, 6, this, aHostDevice, uuid.ptr(), fRemote, Address.raw(), aMaskedIfs);6380 (PFNRT)usbAttachCallback, 6, this, aHostDevice, uuid.ptr(), fRemote, Address.c_str(), aMaskedIfs); 6386 6381 6387 6382 /* restore the lock */ … … 6393 6388 { 6394 6389 LogWarningThisFunc(("Failed to create proxy device for '%s' {%RTuuid} (%Rrc)\n", 6395 Address. raw(), uuid.ptr(), vrc));6390 Address.c_str(), uuid.ptr(), vrc)); 6396 6391 6397 6392 switch (vrc) … … 6922 6917 6923 6918 LogRel(("Console: VM runtime error: fatal=%RTbool, errorID=%s message=\"%s\"\n", 6924 fFatal, pszErrorId, message. raw()));6919 fFatal, pszErrorId, message.c_str())); 6925 6920 6926 6921 that->onRuntimeError(BOOL(fFatal), Bstr(pszErrorId), Bstr(message)); … … 7252 7247 Utf8Str ports = bstr; 7253 7248 errMsg = Utf8StrFmt(tr("VRDP server can't bind to a port: %s"), 7254 ports. raw());7249 ports.c_str()); 7255 7250 LogRel(("Warning: failed to launch VRDP server (%Rrc): '%s'\n", 7256 vrc, errMsg. raw()));7251 vrc, errMsg.c_str())); 7257 7252 } 7258 7253 else if (RT_FAILURE(vrc)) … … 7271 7266 } 7272 7267 LogRel(("Failed to launch VRDP server (%Rrc), error message: '%s'\n", 7273 vrc, errMsg. raw()));7268 vrc, errMsg.c_str())); 7274 7269 throw setErrorStatic(E_FAIL, errMsg.c_str()); 7275 7270 } … … 7366 7361 { 7367 7362 LogFlowFunc(("Restoring saved state from '%s'...\n", 7368 task->mSavedStateFile. raw()));7363 task->mSavedStateFile.c_str())); 7369 7364 7370 7365 vrc = VMR3LoadFromFile(pVM, … … 7958 7953 HRESULT rc = S_OK; 7959 7954 7960 LogFlowFunc(("Saving the state to '%s'...\n", task->mSavedStateFile. raw()));7955 LogFlowFunc(("Saving the state to '%s'...\n", task->mSavedStateFile.c_str())); 7961 7956 7962 7957 bool fSuspenededBySave; … … 7970 7965 { 7971 7966 errMsg = Utf8StrFmt(Console::tr("Failed to save the machine state to '%s' (%Rrc)"), 7972 task->mSavedStateFile. raw(), vrc);7967 task->mSavedStateFile.c_str(), vrc); 7973 7968 rc = E_FAIL; 7974 7969 } -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r31519 r31539 1590 1590 Assert(macAddr); 1591 1591 Utf8Str macAddrUtf8 = macAddr; 1592 char *macStr = (char*)macAddrUtf8. raw();1592 char *macStr = (char*)macAddrUtf8.c_str(); 1593 1593 Assert(strlen(macStr) == 12); 1594 1594 RTMAC Mac; … … 2349 2349 continue; 2350 2350 2351 const char *pszExtraDataKey = strKey. raw() + sizeof("VBoxInternal/") - 1;2351 const char *pszExtraDataKey = strKey.c_str() + sizeof("VBoxInternal/") - 1; 2352 2352 2353 2353 // get the value … … 2359 2359 hrc = pMachine->GetExtraData(Bstr(strKey), bstrExtraDataValue.asOutParam()); 2360 2360 if (FAILED(hrc)) 2361 LogRel(("Warning: Cannot get extra data key %s, rc = %Rrc\n", strKey. raw(), hrc));2361 LogRel(("Warning: Cannot get extra data key %s, rc = %Rrc\n", strKey.c_str(), hrc)); 2362 2362 2363 2363 /* … … 3300 3300 if (pos == Utf8Str::npos) \ 3301 3301 { \ 3302 Log(( #res " extracting from %s is failed\n", str. raw())); \3302 Log(( #res " extracting from %s is failed\n", str.c_str())); \ 3303 3303 continue; \ 3304 3304 } \ 3305 3305 res = str.substr(ppos, pos - ppos); \ 3306 Log2((#res " %s pos:%d, ppos:%d\n", res. raw(), pos, ppos)); \3306 Log2((#res " %s pos:%d, ppos:%d\n", res.c_str(), pos, ppos)); \ 3307 3307 ppos = pos + 1; \ 3308 3308 } while (0) … … 3332 3332 continue; 3333 3333 3334 InsertConfigNode(pCfg, strName. raw(), &pPF);3334 InsertConfigNode(pCfg, strName.c_str(), &pPF); 3335 3335 InsertConfigString(pPF, "Protocol", strProto); 3336 3336 … … 3341 3341 InsertConfigString(pPF, "GuestIP", strGuestIP); 3342 3342 3343 port = RTStrToUInt16(strHostPort. raw());3343 port = RTStrToUInt16(strHostPort.c_str()); 3344 3344 if (port) 3345 3345 InsertConfigInteger(pPF, "HostPort", port); 3346 3346 3347 port = RTStrToUInt16(strGuestPort. raw());3347 port = RTStrToUInt16(strGuestPort.c_str()); 3348 3348 if (port) 3349 3349 InsertConfigInteger(pPF, "GuestPort", port); … … 3412 3412 3413 3413 Utf8Str HifNameUtf8(HifName); 3414 const char *pszHifName = HifNameUtf8. raw();3414 const char *pszHifName = HifNameUtf8.c_str(); 3415 3415 3416 3416 # if defined(RT_OS_DARWIN) … … 3823 3823 3824 3824 Utf8Str HifNameUtf8(HifName); 3825 const char *pszHifName = HifNameUtf8. raw();3825 const char *pszHifName = HifNameUtf8.c_str(); 3826 3826 ComPtr<IHostNetworkInterface> hostInterface; 3827 3827 rc = host->FindHostNetworkInterfaceByName(HifName, hostInterface.asOutParam()); -
trunk/src/VBox/Main/ConsoleVRDPServer.cpp
r30871 r31539 617 617 if ((size_t)cbBuffer >= cbAddress) 618 618 { 619 if (cbAddress > 0) 620 { 621 if (address.raw()) 622 { 623 memcpy(pvBuffer, address.raw(), cbAddress); 624 } 625 else 626 { 627 /* The value is an empty string. */ 628 *(uint8_t *)pvBuffer = 0; 629 } 630 } 631 619 memcpy(pvBuffer, address.c_str(), cbAddress); 632 620 rc = VINF_SUCCESS; 633 621 } … … 688 676 if ((size_t)cbBuffer >= cbPortRange) 689 677 { 690 if (cbPortRange > 0) 691 { 692 if (portRange.raw()) 693 { 694 memcpy(pvBuffer, portRange.raw(), cbPortRange); 695 } 696 else 697 { 698 /* The value is an empty string. */ 699 *(uint8_t *)pvBuffer = 0; 700 } 701 } 702 678 memcpy(pvBuffer, portRange.c_str(), cbPortRange); 703 679 rc = VINF_SUCCESS; 704 680 } … … 1470 1446 1471 1447 int rc; 1472 if (RTPathHavePath(filename. raw()))1473 rc = RTLdrLoad(filename. raw(), &mAuthLibrary);1448 if (RTPathHavePath(filename.c_str())) 1449 rc = RTLdrLoad(filename.c_str(), &mAuthLibrary); 1474 1450 else 1475 rc = RTLdrLoadAppPriv(filename. raw(), &mAuthLibrary);1451 rc = RTLdrLoadAppPriv(filename.c_str(), &mAuthLibrary); 1476 1452 1477 1453 if (RT_FAILURE(rc)) … … 1513 1489 if (RT_FAILURE(rc)) 1514 1490 { 1515 mConsole->setAuthLibraryError(filename.raw(), rc); 1491 mConsole->setError(E_FAIL, 1492 mConsole->tr("Could not load the external authentication library '%s' (%Rrc)"), 1493 filename.c_str(), 1494 rc); 1516 1495 1517 1496 mpfnAuthEntry = NULL; -
trunk/src/VBox/Main/DHCPServerRunner.cpp
r28800 r31539 111 111 */ 112 112 if (mOptions[i].length()) 113 args[index++] = mOptions[i]. raw(); // value113 args[index++] = mOptions[i].c_str(); // value 114 114 } 115 115 } -
trunk/src/VBox/Main/GuestImpl.cpp
r31525 r31539 466 466 467 467 pVMMDevPort->pfnSetCredentials(pVMMDevPort, 468 Utf8Str(aUserName). raw(),469 Utf8Str(aPassword). raw(),470 Utf8Str(aDomain). raw(),468 Utf8Str(aUserName).c_str(), 469 Utf8Str(aPassword).c_str(), 470 Utf8Str(aDomain).c_str(), 471 471 u32Flags); 472 472 return S_OK; … … 1020 1020 for (unsigned i = 0; i < env.size(); i++) 1021 1021 { 1022 vrc = prepareExecuteEnv(Utf8Str(env[i]). raw(), &pvEnv, &cbEnv, &uNumEnv);1022 vrc = prepareExecuteEnv(Utf8Str(env[i]).c_str(), &pvEnv, &cbEnv, &uNumEnv); 1023 1023 if (RT_FAILURE(vrc)) 1024 1024 break; … … 1027 1027 1028 1028 LogRel(("Executing guest process \"%s\" as user \"%s\" ...\n", 1029 Utf8Command. raw(), Utf8UserName.raw()));1029 Utf8Command.c_str(), Utf8UserName.c_str())); 1030 1030 1031 1031 if (RT_SUCCESS(vrc)) … … 1041 1041 int i = 0; 1042 1042 paParms[i++].setUInt32(uContextID); 1043 paParms[i++].setPointer((void*)Utf8Command. raw(), (uint32_t)strlen(Utf8Command.raw()) + 1);1043 paParms[i++].setPointer((void*)Utf8Command.c_str(), (uint32_t)Utf8Command.length() + 1); 1044 1044 paParms[i++].setUInt32(aFlags); 1045 1045 paParms[i++].setUInt32(uNumArgs); … … 1048 1048 paParms[i++].setUInt32(cbEnv); 1049 1049 paParms[i++].setPointer((void*)pvEnv, cbEnv); 1050 paParms[i++].setPointer((void*)Utf8UserName. raw(), (uint32_t)strlen(Utf8UserName.raw()) + 1);1051 paParms[i++].setPointer((void*)Utf8Password. raw(), (uint32_t)strlen(Utf8Password.raw()) + 1);1050 paParms[i++].setPointer((void*)Utf8UserName.c_str(), (uint32_t)Utf8UserName.length() + 1); 1051 paParms[i++].setPointer((void*)Utf8Password.c_str(), (uint32_t)Utf8Password.length() + 1); 1052 1052 paParms[i++].setUInt32(aTimeoutMS); 1053 1053 … … 1159 1159 { 1160 1160 if (vrc == VERR_FILE_NOT_FOUND) /* This is the most likely error. */ 1161 {1162 1161 rc = setError(VBOX_E_IPRT_ERROR, 1163 tr("The file '%s' was not found on guest"), Utf8Command.raw()); 1164 } 1162 tr("The file '%s' was not found on guest"), Utf8Command.c_str()); 1165 1163 else if (vrc == VERR_PATH_NOT_FOUND) 1166 {1167 1164 rc = setError(VBOX_E_IPRT_ERROR, 1168 tr("The path to file '%s' was not found on guest"), Utf8Command.raw()); 1169 } 1165 tr("The path to file '%s' was not found on guest"), Utf8Command.c_str()); 1170 1166 else if (vrc == VERR_BAD_EXE_FORMAT) 1171 {1172 1167 rc = setError(VBOX_E_IPRT_ERROR, 1173 tr("The file '%s' is not an executable format on guest"), Utf8Command.raw()); 1174 } 1168 tr("The file '%s' is not an executable format on guest"), Utf8Command.c_str()); 1175 1169 else if (vrc == VERR_AUTHENTICATION_FAILURE) 1176 {1177 1170 rc = setError(VBOX_E_IPRT_ERROR, 1178 tr("The specified user '%s' was not able to logon on guest"), Utf8UserName.raw()); 1179 } 1171 tr("The specified user '%s' was not able to logon on guest"), Utf8UserName.c_str()); 1180 1172 else if (vrc == VERR_TIMEOUT) 1181 {1182 1173 rc = setError(VBOX_E_IPRT_ERROR, 1183 1174 tr("The guest did not respond within time (%ums)"), aTimeoutMS); 1184 }1185 1175 else if (vrc == VERR_CANCELLED) 1186 {1187 1176 rc = setError(VBOX_E_IPRT_ERROR, 1188 1177 tr("The execution operation was canceled")); 1189 }1190 1178 else if (vrc == VERR_PERMISSION_DENIED) 1191 {1192 1179 rc = setError(VBOX_E_IPRT_ERROR, 1193 1180 tr("Invalid user/password credentials")); 1194 }1195 1181 else 1196 1182 { … … 1215 1201 { 1216 1202 if (vrc == VERR_INVALID_VM_HANDLE) 1217 {1218 1203 rc = setError(VBOX_E_VM_ERROR, 1219 1204 tr("VMM device is not available (is the VM running?)")); 1220 }1221 1205 else if (vrc == VERR_TIMEOUT) 1222 {1223 1206 rc = setError(VBOX_E_VM_ERROR, 1224 1207 tr("The guest execution service is not ready")); 1225 }1226 1208 else if (vrc == VERR_HGCM_SERVICE_NOT_FOUND) 1227 {1228 1209 rc = setError(VBOX_E_VM_ERROR, 1229 1210 tr("The guest execution service is not available")); 1230 }1231 1211 else /* HGCM call went wrong. */ 1232 {1233 1212 rc = setError(E_UNEXPECTED, 1234 1213 tr("The HGCM call failed with error %Rrc"), vrc); 1235 }1236 1214 } 1237 1215 … … 1243 1221 if (RT_FAILURE(vrc)) 1244 1222 LogRel(("Executing guest process \"%s\" as user \"%s\" failed with %Rrc\n", 1245 Utf8Command. raw(), Utf8UserName.raw(), vrc));1223 Utf8Command.c_str(), Utf8UserName.c_str(), vrc)); 1246 1224 } 1247 1225 catch (std::bad_alloc &) -
trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp
r30750 r31539 61 61 * @param aGuid GUID of the host network interface 62 62 */ 63 HRESULT HostNetworkInterface::init 63 HRESULT HostNetworkInterface::init(Bstr aInterfaceName, Guid aGuid, HostNetworkInterfaceType_T ifType) 64 64 { 65 65 LogFlowThisFunc(("aInterfaceName={%ls}, aGuid={%s}\n", 66 aInterfaceName.raw(), aGuid.toString(). raw()));66 aInterfaceName.raw(), aGuid.toString().c_str())); 67 67 68 68 ComAssertRet(aInterfaceName, E_INVALIDARG); … … 76 76 unconst(mGuid) = aGuid; 77 77 mIfType = ifType; 78 79 78 80 79 /* Confirm a successful initialization */ … … 440 439 441 440 ULONG ip, mask; 442 ip = inet_addr(Utf8Str(aIPAddress). raw());441 ip = inet_addr(Utf8Str(aIPAddress).c_str()); 443 442 if (ip != INADDR_NONE) 444 443 { … … 446 445 mask = 0xFFFFFF; 447 446 else 448 mask = inet_addr(Utf8Str(aNetMask). raw());447 mask = inet_addr(Utf8Str(aNetMask).c_str()); 449 448 if (mask != INADDR_NONE) 450 449 { … … 567 566 if (tmpMask.isEmpty()) 568 567 tmpMask = Bstr(VBOXNET_IPV4MASK_DEFAULT); 569 m.IPAddress = inet_addr(Utf8Str(tmpAddr). raw());570 m.networkMask = inet_addr(Utf8Str(tmpMask). raw());568 m.IPAddress = inet_addr(Utf8Str(tmpAddr).c_str()); 569 m.networkMask = inet_addr(Utf8Str(tmpMask).c_str()); 571 570 } 572 571 -
trunk/src/VBox/Main/MachineDebuggerImpl.cpp
r30681 r31539 657 657 * @param aPattern The selection pattern. A bit similar to filename globbing. 658 658 */ 659 STDMETHODIMP MachineDebugger::ResetStats 659 STDMETHODIMP MachineDebugger::ResetStats(IN_BSTR aPattern) 660 660 { 661 661 Console::SafeVMPtrQuiet pVM (mParent); … … 664 664 return setError(VBOX_E_INVALID_VM_STATE, "Machine is not running"); 665 665 666 STAMR3Reset (pVM, Utf8Str (aPattern).raw());666 STAMR3Reset(pVM, Utf8Str(aPattern).c_str()); 667 667 668 668 return S_OK; … … 682 682 return setError(VBOX_E_INVALID_VM_STATE, "Machine is not running"); 683 683 684 STAMR3Dump (pVM, Utf8Str (aPattern).raw());684 STAMR3Dump(pVM, Utf8Str(aPattern).c_str()); 685 685 686 686 return S_OK; … … 703 703 704 704 char *pszSnapshot; 705 int vrc = STAMR3Snapshot (pVM, Utf8Str (aPattern).raw(), &pszSnapshot, NULL,706 705 int vrc = STAMR3Snapshot(pVM, Utf8Str(aPattern).c_str(), &pszSnapshot, NULL, 706 !!aWithDescriptions); 707 707 if (RT_FAILURE(vrc)) 708 708 return vrc == VERR_NO_MEMORY ? E_OUTOFMEMORY : E_FAIL; -
trunk/src/VBox/Main/MachineImpl.cpp
r31482 r31539 131 131 pMachineConfigFile = NULL; 132 132 } 133 }134 135 /////////////////////////////////////////////////////////////////////////////136 // Machine::UserData structure137 /////////////////////////////////////////////////////////////////////////////138 139 Machine::UserData::UserData()140 {141 /* default values for a newly created machine */142 143 mNameSync = TRUE;144 mTeleporterEnabled = FALSE;145 mTeleporterPort = 0;146 mRTCUseUTC = FALSE;147 148 /* mName, mOSTypeId, mSnapshotFolder, mSnapshotFolderFull are initialized in149 * Machine::init() */150 }151 152 Machine::UserData::~UserData()153 {154 133 } 155 134 … … 290 269 { 291 270 LogFlowThisFuncEnter(); 292 LogFlowThisFunc(("(Init_New) aConfigFile='%s'\n", strConfigFile. raw()));271 LogFlowThisFunc(("(Init_New) aConfigFile='%s'\n", strConfigFile.c_str())); 293 272 294 273 /* Enclose the state transition NotReady->InInit->Ready */ … … 317 296 unconst(mData->mUuid) = aId; 318 297 319 mUserData-> mName = strName;320 mUserData-> mNameSync = aNameSync;298 mUserData->s.strName = strName; 299 mUserData->s.fNameSync = aNameSync; 321 300 322 301 /* initialize the default snapshots folder … … 328 307 { 329 308 /* Store OS type */ 330 mUserData-> mOSTypeId= aOsType->id();309 mUserData->s.strOsType = aOsType->id(); 331 310 332 311 /* Apply BIOS defaults */ … … 355 334 } 356 335 357 LogFlowThisFunc(("mName='% ls', mRegistered=%RTbool, mAccessible=%RTbool, rc=%08X\n",358 !!mUserData ? mUserData-> mName.raw() : NULL,336 LogFlowThisFunc(("mName='%s', mRegistered=%RTbool, mAccessible=%RTbool, rc=%08X\n", 337 !!mUserData ? mUserData->s.strName.c_str() : "NULL", 359 338 mData->mRegistered, 360 339 mData->mAccessible, … … 388 367 { 389 368 LogFlowThisFuncEnter(); 390 LogFlowThisFunc(("(Init_Registered) aConfigFile='%s\n", strConfigFile. raw()));369 LogFlowThisFunc(("(Init_Registered) aConfigFile='%s\n", strConfigFile.c_str())); 391 370 392 371 /* Enclose the state transition NotReady->InInit->Ready */ … … 450 429 } 451 430 452 LogFlowThisFunc(("mName='% ls', mRegistered=%RTbool, mAccessible=%RTbool "431 LogFlowThisFunc(("mName='%s', mRegistered=%RTbool, mAccessible=%RTbool " 453 432 "rc=%08X\n", 454 !!mUserData ? mUserData-> mName.raw() : NULL,433 !!mUserData ? mUserData->s.strName.c_str() : "NULL", 455 434 mData->mRegistered, mData->mAccessible, rc)); 456 435 … … 511 490 512 491 // override VM name as well, it may be different 513 mUserData-> mName = strName;492 mUserData->s.strName = strName; 514 493 515 494 /* commit all changes made during the initialization */ … … 527 506 } 528 507 529 LogFlowThisFunc(("mName='% ls', mRegistered=%RTbool, mAccessible=%RTbool "508 LogFlowThisFunc(("mName='%s', mRegistered=%RTbool, mAccessible=%RTbool " 530 509 "rc=%08X\n", 531 !!mUserData ? mUserData-> mName.raw() : NULL,510 !!mUserData ? mUserData->s.strName.c_str() : "NULL", 532 511 mData->mRegistered, mData->mAccessible, rc)); 533 512 … … 567 546 return setError(VBOX_E_FILE_ERROR, 568 547 tr("Invalid machine settings file name '%s' (%Rrc)"), 569 strConfigFile. raw(),548 strConfigFile.c_str(), 570 549 vrc1); 571 550 … … 597 576 rc = setError(VBOX_E_FILE_ERROR, 598 577 tr("Machine settings file '%s' already exists"), 599 mData->m_strConfigFileFull. raw());578 mData->m_strConfigFileFull.c_str()); 600 579 else 601 580 { … … 606 585 rc = setError(VBOX_E_FILE_ERROR, 607 586 tr("Could not delete the existing settings file '%s' (%Rrc)"), 608 mData->m_strConfigFileFull. raw(), vrc2);587 mData->m_strConfigFileFull.c_str(), vrc2); 609 588 } 610 589 } … … 614 593 rc = setError(VBOX_E_FILE_ERROR, 615 594 tr("Invalid machine settings file name '%s' (%Rrc)"), 616 mData->m_strConfigFileFull. raw(),595 mData->m_strConfigFileFull.c_str(), 617 596 vrc); 618 597 return rc; … … 657 636 tr("Machine UUID {%RTuuid} in '%s' doesn't match its UUID {%s} in the registry file '%s'"), 658 637 mData->pMachineConfigFile->uuid.raw(), 659 mData->m_strConfigFileFull. raw(),660 mData->mUuid.toString(). raw(),661 mParent->settingsFilePath(). raw());638 mData->m_strConfigFileFull.c_str(), 639 mData->mUuid.toString().c_str(), 640 mParent->settingsFilePath().c_str()); 662 641 663 642 rc = loadMachineDataFromSettings(*mData->pMachineConfigFile); … … 907 886 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 908 887 909 mUserData-> mName.cloneTo(aName);888 mUserData->s.strName.cloneTo(aName); 910 889 911 890 return S_OK; … … 926 905 setModified(IsModified_MachineData); 927 906 mUserData.backup(); 928 mUserData-> mName = aName;907 mUserData->s.strName = aName; 929 908 930 909 return S_OK; … … 940 919 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 941 920 942 mUserData-> mDescription.cloneTo(aDescription);921 mUserData->s.strDescription.cloneTo(aDescription); 943 922 944 923 return S_OK; … … 957 936 setModified(IsModified_MachineData); 958 937 mUserData.backup(); 959 mUserData-> mDescription = aDescription;938 mUserData->s.strDescription = aDescription; 960 939 961 940 return S_OK; … … 985 964 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 986 965 987 mUserData-> mOSTypeId.cloneTo(aOSTypeId);966 mUserData->s.strOsType.cloneTo(aOSTypeId); 988 967 989 968 return S_OK; … … 1015 994 setModified(IsModified_MachineData); 1016 995 mUserData.backup(); 1017 mUserData-> mOSTypeId= osTypeId;996 mUserData->s.strOsType = osTypeId; 1018 997 1019 998 return S_OK; … … 2031 2010 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 2032 2011 2033 mUserData->m SnapshotFolderFull.cloneTo(aSnapshotFolder);2012 mUserData->m_strSnapshotFolderFull.cloneTo(aSnapshotFolder); 2034 2013 2035 2014 return S_OK; … … 2058 2037 tr("The snapshot folder of a machine with snapshots cannot be changed (please delete all snapshots first)")); 2059 2038 2060 Utf8Str snapshotFolder = aSnapshotFolder; 2061 2062 if (snapshotFolder.isEmpty()) 2039 Utf8Str strSnapshotFolder0(aSnapshotFolder); // keep original 2040 Utf8Str strSnapshotFolder(strSnapshotFolder0); 2041 2042 if (strSnapshotFolder.isEmpty()) 2063 2043 { 2064 2044 if (isInOwnDir()) 2065 {2066 2045 /* the default snapshots folder is 'Snapshots' in the machine dir */ 2067 snapshotFolder = "Snapshots"; 2068 } 2046 strSnapshotFolder = "Snapshots"; 2069 2047 else 2070 {2071 2048 /* the default snapshots folder is {UUID}, for backwards 2072 2049 * compatibility and to resolve conflicts */ 2073 snapshotFolder = Utf8StrFmt("{%RTuuid}", mData->mUuid.raw()); 2074 } 2075 } 2076 2077 int vrc = calculateFullPath(snapshotFolder, snapshotFolder); 2050 strSnapshotFolder = Utf8StrFmt("{%RTuuid}", mData->mUuid.raw()); 2051 } 2052 2053 int vrc = calculateFullPath(strSnapshotFolder, strSnapshotFolder); 2078 2054 if (RT_FAILURE(vrc)) 2079 2055 return setError(E_FAIL, … … 2083 2059 setModified(IsModified_MachineData); 2084 2060 mUserData.backup(); 2085 mUserData-> mSnapshotFolder = aSnapshotFolder;2086 mUserData->m SnapshotFolderFull = snapshotFolder;2061 mUserData->s.strSnapshotFolder = strSnapshotFolder0; 2062 mUserData->m_strSnapshotFolderFull = strSnapshotFolder; 2087 2063 2088 2064 return S_OK; … … 2464 2440 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 2465 2441 2466 *aEnabled = mUserData-> mTeleporterEnabled;2442 *aEnabled = mUserData->s.fTeleporterEnabled; 2467 2443 2468 2444 return S_OK; … … 2493 2469 setModified(IsModified_MachineData); 2494 2470 mUserData.backup(); 2495 mUserData-> mTeleporterEnabled =aEnabled;2471 mUserData->s.fTeleporterEnabled = !!aEnabled; 2496 2472 2497 2473 return S_OK; … … 2507 2483 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 2508 2484 2509 *aPort = mUserData->mTeleporterPort;2485 *aPort = (ULONG)mUserData->s.uTeleporterPort; 2510 2486 2511 2487 return S_OK; … … 2527 2503 setModified(IsModified_MachineData); 2528 2504 mUserData.backup(); 2529 mUserData-> mTeleporterPort =aPort;2505 mUserData->s.uTeleporterPort = (uint32_t)aPort; 2530 2506 2531 2507 return S_OK; … … 2541 2517 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 2542 2518 2543 mUserData-> mTeleporterAddress.cloneTo(aAddress);2519 mUserData->s.strTeleporterAddress.cloneTo(aAddress); 2544 2520 2545 2521 return S_OK; … … 2558 2534 setModified(IsModified_MachineData); 2559 2535 mUserData.backup(); 2560 mUserData-> mTeleporterAddress = aAddress;2536 mUserData->s.strTeleporterAddress = aAddress; 2561 2537 2562 2538 return S_OK; … … 2572 2548 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 2573 2549 2574 mUserData-> mTeleporterPassword.cloneTo(aPassword);2550 mUserData->s.strTeleporterPassword.cloneTo(aPassword); 2575 2551 2576 2552 return S_OK; … … 2589 2565 setModified(IsModified_MachineData); 2590 2566 mUserData.backup(); 2591 mUserData-> mTeleporterPassword = aPassword;2567 mUserData->s.strTeleporterPassword = aPassword; 2592 2568 2593 2569 return S_OK; … … 2603 2579 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 2604 2580 2605 *aEnabled = mUserData-> mRTCUseUTC;2581 *aEnabled = mUserData->s.fRTCUseUTC; 2606 2582 2607 2583 return S_OK; … … 2632 2608 setModified(IsModified_MachineData); 2633 2609 mUserData.backup(); 2634 mUserData-> mRTCUseUTC =aEnabled;2610 mUserData->s.fRTCUseUTC = !!aEnabled; 2635 2611 2636 2612 return S_OK; … … 2729 2705 if (!mData->mRegistered) 2730 2706 return setError(E_UNEXPECTED, 2731 tr("The machine '% ls' is not registered"),2732 mUserData-> mName.raw());2707 tr("The machine '%s' is not registered"), 2708 mUserData->s.strName.c_str()); 2733 2709 2734 2710 LogFlowThisFunc(("mSession.mState=%s\n", Global::stringifySessionState(mData->mSession.mState))); … … 2800 2776 pSessionControl->Uninitialize(); 2801 2777 return setError(VBOX_E_INVALID_SESSION_STATE, 2802 tr("The machine '% ls' was unlocked unexpectedly while attempting to share its session"),2803 mUserData-> mName.raw());2778 tr("The machine '%s' was unlocked unexpectedly while attempting to share its session"), 2779 mUserData->s.strName.c_str()); 2804 2780 } 2805 2781 … … 2813 2789 // sharing not permitted, or machine still unlocking: 2814 2790 return setError(VBOX_E_INVALID_OBJECT_STATE, 2815 tr("The machine '% ls' is already locked for a session (or being unlocked)"),2816 mUserData-> mName.raw());2791 tr("The machine '%s' is already locked for a session (or being unlocked)"), 2792 mUserData->s.strName.c_str()); 2817 2793 } 2818 2794 else … … 2843 2819 return setError(E_ACCESSDENIED, 2844 2820 tr("An unexpected process (PID=0x%08X) has tried to lock the " 2845 "machine '% ls', while only the process started by launchVMProcess (PID=0x%08X) is allowed"),2846 pid, mUserData-> mName.raw(), mData->mSession.mPid);2821 "machine '%s', while only the process started by launchVMProcess (PID=0x%08X) is allowed"), 2822 pid, mUserData->s.strName.c_str(), mData->mSession.mPid); 2847 2823 } 2848 2824 … … 3178 3154 return setError(VBOX_E_OBJECT_IN_USE, 3179 3155 tr("Medium '%s' is already attached to port %d, device %d of controller '%ls' of this virtual machine"), 3180 pMedium->getLocationFull(). raw(),3156 pMedium->getLocationFull().c_str(), 3181 3157 aControllerPort, 3182 3158 aDevice, … … 3222 3198 return setError(VBOX_E_OBJECT_IN_USE, 3223 3199 tr("Medium '%s' is already attached to this virtual machine"), 3224 medium->getLocationFull(). raw());3200 medium->getLocationFull().c_str()); 3225 3201 3226 3202 bool fIndirect = false; … … 3417 3393 rc = diff->init(mParent, 3418 3394 medium->getPreferredDiffFormat(), 3419 Utf8StrFmt("%ls"RTPATH_SLASH_STR, 3420 mUserData->mSnapshotFolderFull.raw()).raw(), 3395 Utf8Str(mUserData->m_strSnapshotFolderFull).append(RTPATH_SLASH_STR), 3421 3396 &fNeedsSaveSettings); 3422 3397 if (FAILED(rc)) return rc; … … 3985 3960 if (mData->mSession.mState != SessionState_Unlocked) 3986 3961 return setError(VBOX_E_INVALID_OBJECT_STATE, 3987 tr("Cannot unregister the machine '% ls' while it is locked"),3988 mUserData-> mName.raw());3962 tr("Cannot unregister the machine '%s' while it is locked"), 3963 mUserData->s.strName.c_str()); 3989 3964 3990 3965 HRESULT rc = S_OK; … … 4010 3985 // fail now before we start detaching media 4011 3986 return setError(VBOX_E_INVALID_OBJECT_STATE, 4012 tr("Cannot unregister the machine '% ls' because it has %d snapshots"),4013 mUserData-> mName.raw(), cSnapshots);3987 tr("Cannot unregister the machine '%s' because it has %d snapshots"), 3988 mUserData->s.strName.c_str(), cSnapshots); 4014 3989 4015 3990 // this list collects the medium objects from all medium attachments … … 4034 4009 else 4035 4010 return setError(VBOX_E_INVALID_OBJECT_STATE, 4036 tr("Cannot unregister the machine '% ls' because it has %d media attachments"),4037 mUserData-> mName.raw(), mMediaData->mAttachments.size());4011 tr("Cannot unregister the machine '%s' because it has %d media attachments"), 4012 mUserData->s.strName.c_str(), mMediaData->mAttachments.size()); 4038 4013 } 4039 4014 … … 4257 4232 * files that may have been created by the GUI. */ 4258 4233 Utf8Str log = Utf8StrFmt("%s%cVBox.log", 4259 logFolder. raw(), RTPATH_DELIMITER);4234 logFolder.c_str(), RTPATH_DELIMITER); 4260 4235 RTFileDelete(log.c_str()); 4261 4236 log = Utf8StrFmt("%s%cVBox.png", 4262 logFolder. raw(), RTPATH_DELIMITER);4237 logFolder.c_str(), RTPATH_DELIMITER); 4263 4238 RTFileDelete(log.c_str()); 4264 4239 for (int i = uLogHistoryCount; i > 0; i--) 4265 4240 { 4266 4241 log = Utf8StrFmt("%s%cVBox.log.%d", 4267 logFolder. raw(), RTPATH_DELIMITER, i);4242 logFolder.c_str(), RTPATH_DELIMITER, i); 4268 4243 RTFileDelete(log.c_str()); 4269 4244 log = Utf8StrFmt("%s%cVBox.png.%d", 4270 logFolder. raw(), RTPATH_DELIMITER, i);4245 logFolder.c_str(), RTPATH_DELIMITER, i); 4271 4246 RTFileDelete(log.c_str()); 4272 4247 } … … 4278 4253 * there (we don't check for errors because the user might have 4279 4254 * some private files there that we don't want to delete) */ 4280 Utf8Str snapshotFolder(mUserData->mSnapshotFolderFull); 4281 Assert(snapshotFolder.length()); 4282 if (RTDirExists(snapshotFolder.c_str())) 4283 RTDirRemove(snapshotFolder.c_str()); 4255 Assert(mUserData->m_strSnapshotFolderFull.length()); 4256 if (RTDirExists(mUserData->m_strSnapshotFolderFull.c_str())) 4257 RTDirRemove(mUserData->m_strSnapshotFolderFull.c_str()); 4284 4258 4285 4259 /* delete the directory that contains the settings file, but only … … 4601 4575 uint32_t fFlags = NILFLAG; 4602 4576 if ( (aFlags != NULL) 4603 && RT_FAILURE(validateFlags(utf8Flags. raw(), &fFlags))4577 && RT_FAILURE(validateFlags(utf8Flags.c_str(), &fFlags)) 4604 4578 ) 4605 4579 return setError(E_INVALIDARG, … … 4660 4634 if ( SUCCEEDED(rc) 4661 4635 && ( mHWData->mGuestPropertyNotificationPatterns.isEmpty() 4662 || RTStrSimplePatternMultiMatch(mHWData->mGuestPropertyNotificationPatterns.raw(), RTSTR_MAX, 4663 utf8Name.raw(), RTSTR_MAX, NULL) ) 4636 || RTStrSimplePatternMultiMatch(mHWData->mGuestPropertyNotificationPatterns.c_str(), 4637 RTSTR_MAX, 4638 utf8Name.c_str(), 4639 RTSTR_MAX, 4640 NULL) 4641 ) 4664 4642 ) 4665 4643 { … … 4761 4739 ++it) 4762 4740 if ( strPatterns.isEmpty() 4763 || RTStrSimplePatternMultiMatch(strPatterns. raw(),4741 || RTStrSimplePatternMultiMatch(strPatterns.c_str(), 4764 4742 RTSTR_MAX, 4765 it->strName.raw(), 4766 RTSTR_MAX, NULL) 4743 it->strName.c_str(), 4744 RTSTR_MAX, 4745 NULL) 4767 4746 ) 4768 4747 propList.push_back(*it); … … 5057 5036 #define sSSMDisplayScreenshotVer 0x00010001 5058 5037 5059 static int readSavedDisplayScreenshot( Utf8Str *pStateFilePath, uint32_t u32Type, uint8_t **ppu8Data, uint32_t *pcbData, uint32_t *pu32Width, uint32_t *pu32Height)5060 { 5061 LogFlowFunc(("u32Type = %d [%s]\n", u32Type, pStateFilePath->raw()));5038 static int readSavedDisplayScreenshot(const Utf8Str &strStateFilePath, uint32_t u32Type, uint8_t **ppu8Data, uint32_t *pcbData, uint32_t *pu32Width, uint32_t *pu32Height) 5039 { 5040 LogFlowFunc(("u32Type = %d [%s]\n", u32Type, strStateFilePath.c_str())); 5062 5041 5063 5042 /* @todo cache read data */ 5064 if ( pStateFilePath->isEmpty())5043 if (strStateFilePath.isEmpty()) 5065 5044 { 5066 5045 /* No saved state data. */ … … 5074 5053 5075 5054 PSSMHANDLE pSSM; 5076 int vrc = SSMR3Open( pStateFilePath->raw(), 0 /*fFlags*/, &pSSM);5055 int vrc = SSMR3Open(strStateFilePath.c_str(), 0 /*fFlags*/, &pSSM); 5077 5056 if (RT_SUCCESS(vrc)) 5078 5057 { … … 5197 5176 uint32_t u32Height = 0; 5198 5177 5199 int vrc = readSavedDisplayScreenshot( &mSSData->mStateFilePath, 0 /* u32Type */, &pu8Data, &cbData, &u32Width, &u32Height);5178 int vrc = readSavedDisplayScreenshot(mSSData->mStateFilePath, 0 /* u32Type */, &pu8Data, &cbData, &u32Width, &u32Height); 5200 5179 5201 5180 if (RT_FAILURE(vrc)) … … 5234 5213 uint32_t u32Height = 0; 5235 5214 5236 int vrc = readSavedDisplayScreenshot( &mSSData->mStateFilePath, 0 /* u32Type */, &pu8Data, &cbData, &u32Width, &u32Height);5215 int vrc = readSavedDisplayScreenshot(mSSData->mStateFilePath, 0 /* u32Type */, &pu8Data, &cbData, &u32Width, &u32Height); 5237 5216 5238 5217 if (RT_FAILURE(vrc)) … … 5296 5275 uint32_t u32Height = 0; 5297 5276 5298 int vrc = readSavedDisplayScreenshot( &mSSData->mStateFilePath, 1 /* u32Type */, &pu8Data, &cbData, &u32Width, &u32Height);5277 int vrc = readSavedDisplayScreenshot(mSSData->mStateFilePath, 1 /* u32Type */, &pu8Data, &cbData, &u32Width, &u32Height); 5299 5278 5300 5279 if (RT_FAILURE(vrc)) … … 5333 5312 uint32_t u32Height = 0; 5334 5313 5335 int vrc = readSavedDisplayScreenshot( &mSSData->mStateFilePath, 1 /* u32Type */, &pu8Data, &cbData, &u32Width, &u32Height);5314 int vrc = readSavedDisplayScreenshot(mSSData->mStateFilePath, 1 /* u32Type */, &pu8Data, &cbData, &u32Width, &u32Height); 5336 5315 5337 5316 if (RT_FAILURE(vrc)) … … 5498 5477 5499 5478 RTFILE LogFile; 5500 int vrc = RTFileOpen(&LogFile, log. raw(),5479 int vrc = RTFileOpen(&LogFile, log.c_str(), 5501 5480 RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_NONE); 5502 5481 if (RT_SUCCESS(vrc)) … … 5508 5487 rc = setError(VBOX_E_IPRT_ERROR, 5509 5488 tr("Could not read log file '%s' (%Rrc)"), 5510 log. raw(), vrc);5489 log.c_str(), vrc); 5511 5490 RTFileClose(LogFile); 5512 5491 } … … 5514 5493 rc = setError(VBOX_E_IPRT_ERROR, 5515 5494 tr("Could not open log file '%s' (%Rrc)"), 5516 log. raw(), vrc);5495 log.c_str(), vrc); 5517 5496 5518 5497 if (FAILED(rc)) … … 5630 5609 Utf8Str settingsDir; 5631 5610 if (isInOwnDir(&settingsDir)) 5632 {5633 5611 /* Log folder is <Machines>/<VM_Name>/Logs */ 5634 aLogFolder = Utf8StrFmt("%s%cLogs", settingsDir.raw(), RTPATH_DELIMITER); 5635 } 5612 aLogFolder = settingsDir; 5636 5613 else 5637 5614 { 5638 5615 /* Log folder is <Machines>/<VM_SnapshotFolder>/Logs */ 5639 Assert(!mUserData->mSnapshotFolderFull.isEmpty()); 5640 aLogFolder = Utf8StrFmt ("%ls%cLogs", mUserData->mSnapshotFolderFull.raw(), 5641 RTPATH_DELIMITER); 5642 } 5616 Assert(!mUserData->m_strSnapshotFolderFull.isEmpty()); 5617 aLogFolder = mUserData->m_strSnapshotFolderFull; 5618 } 5619 5620 aLogFolder.append(RTPATH_DELIMITER); 5621 aLogFolder.append("Logs"); 5643 5622 } 5644 5623 … … 5654 5633 if (idx == 0) 5655 5634 log = Utf8StrFmt("%s%cVBox.log", 5656 logFolder. raw(), RTPATH_DELIMITER);5635 logFolder.c_str(), RTPATH_DELIMITER); 5657 5636 else 5658 5637 log = Utf8StrFmt("%s%cVBox.log.%d", 5659 logFolder. raw(), RTPATH_DELIMITER, idx);5638 logFolder.c_str(), RTPATH_DELIMITER, idx); 5660 5639 return log; 5661 5640 } … … 5682 5661 if (!mData->mRegistered) 5683 5662 return setError(E_UNEXPECTED, 5684 tr("The machine '% ls' is not registered"),5685 mUserData-> mName.raw());5663 tr("The machine '%s' is not registered"), 5664 mUserData->s.strName.c_str()); 5686 5665 5687 5666 LogFlowThisFunc(("mSession.mState=%s\n", Global::stringifySessionState(mData->mSession.mState))); … … 5691 5670 || mData->mSession.mState == SessionState_Unlocking) 5692 5671 return setError(VBOX_E_INVALID_OBJECT_STATE, 5693 tr("The machine '% ls' is already locked by a session (or being locked or unlocked)"),5694 mUserData-> mName.raw());5672 tr("The machine '%s' is already locked by a session (or being locked or unlocked)"), 5673 mUserData->s.strName.c_str()); 5695 5674 5696 5675 /* may not be busy */ … … 5775 5754 5776 5755 Utf8Str idStr = mData->mUuid.toString(); 5777 Utf8Str strName = mUserData->mName; 5778 const char * args[] = {szPath, "--comment", strName.c_str(), "--startvm", idStr.c_str(), "--no-startvm-errormsgbox", 0 }; 5756 const char * args[] = {szPath, "--comment", mUserData->s.strName.c_str(), "--startvm", idStr.c_str(), "--no-startvm-errormsgbox", 0 }; 5779 5757 vrc = RTProcCreate(szPath, args, env, 0, &pid); 5780 5758 } … … 5794 5772 5795 5773 Utf8Str idStr = mData->mUuid.toString(); 5796 Utf8Str strName = mUserData->mName; 5797 const char * args[] = {szPath, "--comment", strName.c_str(), "--startvm", idStr.c_str(), 0 }; 5774 const char * args[] = {szPath, "--comment", mUserData->s.strName.c_str(), "--startvm", idStr.c_str(), 0 }; 5798 5775 vrc = RTProcCreate(szPath, args, env, 0, &pid); 5799 5776 } … … 5819 5796 Utf8Str idStr = mData->mUuid.toString(); 5820 5797 /* Leave space for 2 args, as "headless" needs --vrdp off on non-OSE. */ 5821 Utf8Str strName = mUserData->mName; 5822 const char * args[] = {szPath, "--comment", strName.c_str(), "--startvm", idStr.c_str(), 0, 0, 0 }; 5798 const char * args[] = {szPath, "--comment", mUserData->s.strName.c_str(), "--startvm", idStr.c_str(), 0, 0, 0 }; 5823 5799 #ifdef VBOX_WITH_VRDP 5824 5800 if (strType == "headless") … … 5852 5828 if (RT_FAILURE(vrc)) 5853 5829 return setError(VBOX_E_IPRT_ERROR, 5854 tr("Could not launch a process for the machine '% ls' (%Rrc)"),5855 mUserData-> mName.raw(), vrc);5830 tr("Could not launch a process for the machine '%s' (%Rrc)"), 5831 mUserData->s.strName.c_str(), vrc); 5856 5832 5857 5833 LogFlowThisFunc(("launched.pid=%d(0x%x)\n", pid, pid)); … … 6050 6026 if (RT_SUCCESS(vrc) && status.enmReason == RTPROCEXITREASON_NORMAL) 6051 6027 rc = setError(E_FAIL, 6052 tr("The virtual machine '% ls' has terminated unexpectedly during startup with exit code %d"),6053 getName(). raw(), status.iStatus);6028 tr("The virtual machine '%s' has terminated unexpectedly during startup with exit code %d"), 6029 getName().c_str(), status.iStatus); 6054 6030 else if (RT_SUCCESS(vrc) && status.enmReason == RTPROCEXITREASON_SIGNAL) 6055 6031 rc = setError(E_FAIL, 6056 tr("The virtual machine '% ls' has terminated unexpectedly during startup because of signal %d"),6057 getName(). raw(), status.iStatus);6032 tr("The virtual machine '%s' has terminated unexpectedly during startup because of signal %d"), 6033 getName().c_str(), status.iStatus); 6058 6034 else if (RT_SUCCESS(vrc) && status.enmReason == RTPROCEXITREASON_ABEND) 6059 6035 rc = setError(E_FAIL, 6060 tr("The virtual machine '% ls' has terminated abnormally"),6061 getName(). raw(), status.iStatus);6036 tr("The virtual machine '%s' has terminated abnormally"), 6037 getName().c_str(), status.iStatus); 6062 6038 else 6063 6039 rc = setError(E_FAIL, 6064 tr("The virtual machine '% ls' has terminated unexpectedly during startup (%Rrc)"),6065 getName(). raw(), rc);6040 tr("The virtual machine '%s' has terminated unexpectedly during startup (%Rrc)"), 6041 getName().c_str(), rc); 6066 6042 } 6067 6043 … … 6122 6098 if (!mData->mAccessible) 6123 6099 return setError(VBOX_E_INVALID_OBJECT_STATE, 6124 tr("The machine '% ls' with UUID {%s} is inaccessible and cannot be registered"),6125 mUserData-> mName.raw(),6126 mData->mUuid.toString(). raw());6100 tr("The machine '%s' with UUID {%s} is inaccessible and cannot be registered"), 6101 mUserData->s.strName.c_str(), 6102 mData->mUuid.toString().c_str()); 6127 6103 6128 6104 AssertReturn(autoCaller.state() == Ready, E_FAIL); … … 6130 6106 if (mData->mRegistered) 6131 6107 return setError(VBOX_E_INVALID_OBJECT_STATE, 6132 tr("The machine '% ls' with UUID {%s} is already registered"),6133 mUserData-> mName.raw(),6134 mData->mUuid.toString(). raw());6108 tr("The machine '%s' with UUID {%s} is already registered"), 6109 mUserData->s.strName.c_str(), 6110 mData->mUuid.toString().c_str()); 6135 6111 6136 6112 HRESULT rc = S_OK; … … 6356 6332 6357 6333 /* initialize mOSTypeId */ 6358 mUserData-> mOSTypeId= mParent->getUnknownOSType()->id();6334 mUserData->s.strOsType = mParent->getUnknownOSType()->id(); 6359 6335 6360 6336 /* create associated BIOS settings object */ … … 6665 6641 HRESULT Machine::loadMachineDataFromSettings(const settings::MachineConfigFile &config) 6666 6642 { 6667 /* name (required) */ 6668 mUserData->mName = config.strName; 6669 6670 /* nameSync (optional, default is true) */ 6671 mUserData->mNameSync = config.fNameSync; 6672 6673 mUserData->mDescription = config.strDescription; 6674 6675 // guest OS type 6676 mUserData->mOSTypeId = config.strOsType; 6677 /* look up the object by Id to check it is valid */ 6643 // copy name, description, OS type, teleporter, UTC etc. 6644 mUserData->s = config.machineUserData; 6645 6646 // look up the object by Id to check it is valid 6678 6647 ComPtr<IGuestOSType> guestOSType; 6679 HRESULT rc = mParent->GetGuestOSType( mUserData->mOSTypeId,6648 HRESULT rc = mParent->GetGuestOSType(Bstr(mUserData->s.strOsType), 6680 6649 guestOSType.asOutParam()); 6681 6650 if (FAILED(rc)) return rc; … … 6691 6660 return setError(E_FAIL, 6692 6661 tr("Invalid saved state file path '%s' (%Rrc)"), 6693 config.strStateFile. raw(),6662 config.strStateFile.c_str(), 6694 6663 vrc); 6695 6664 mSSData->mStateFilePath = stateFilePathFull; 6696 6665 } 6697 6666 6698 / * snapshotFolder (optional) */6699 rc = COMSETTER(SnapshotFolder)(Bstr(config. strSnapshotFolder));6667 // snapshot folder needs special processing so set it again 6668 rc = COMSETTER(SnapshotFolder)(Bstr(config.machineUserData.strSnapshotFolder)); 6700 6669 if (FAILED(rc)) return rc; 6701 6670 … … 6704 6673 6705 6674 mData->mLastStateChange = config.timeLastStateChange; 6706 6707 /* teleportation */6708 mUserData->mTeleporterEnabled = config.fTeleporterEnabled;6709 mUserData->mTeleporterPort = config.uTeleporterPort;6710 mUserData->mTeleporterAddress = config.strTeleporterAddress;6711 mUserData->mTeleporterPassword = config.strTeleporterPassword;6712 6713 /* RTC */6714 mUserData->mRTCUseUTC = config.fRTCUseUTC;6715 6675 6716 6676 /* … … 6797 6757 return setError(E_FAIL, 6798 6758 tr("Invalid saved state file path '%s' (%Rrc)"), 6799 strStateFile. raw(),6759 strStateFile.c_str(), 6800 6760 vrc); 6801 6761 } … … 7078 7038 return setError(VBOX_E_OBJECT_IN_USE, 7079 7039 tr("Storage controller named '%s' already exists"), 7080 ctlData.strName. raw());7040 ctlData.strName.c_str()); 7081 7041 7082 7042 pCtl.createObject(); … … 7138 7098 ++it) 7139 7099 { 7100 const settings::AttachedDevice &ad = *it; 7101 7140 7102 for (settings::AttachedDevicesList::const_iterator it2 = it; 7141 7103 it2 != data.llAttachedDevices.end(); … … 7145 7107 continue; 7146 7108 7147 if ( (*it).lPort == (*it2).lPort 7148 && (*it).lDevice == (*it2).lDevice) 7109 const settings::AttachedDevice &ad2 = *it2; 7110 7111 if ( ad.lPort == ad2.lPort 7112 && ad.lDevice == ad2.lDevice) 7149 7113 { 7150 7114 return setError(E_FAIL, 7151 tr("Duplicate attachments for storage controller '%s', port %d, device %d of the virtual machine '%ls'"), 7152 aStorageController->getName().raw(), (*it).lPort, (*it).lDevice, mUserData->mName.raw()); 7115 tr("Duplicate attachments for storage controller '%s', port %d, device %d of the virtual machine '%s'"), 7116 aStorageController->getName().c_str(), 7117 ad.lPort, 7118 ad.lDevice, 7119 mUserData->s.strName.c_str()); 7153 7120 } 7154 7121 } … … 7198 7165 return setError(E_FAIL, 7199 7166 tr("Immutable hard disk '%s' with UUID {%RTuuid} cannot be directly attached to snapshot with UUID {%RTuuid} " 7200 "of the virtual machine '% ls' ('%s')"),7201 medium->getLocationFull(). raw(),7167 "of the virtual machine '%s' ('%s')"), 7168 medium->getLocationFull().c_str(), 7202 7169 dev.uuid.raw(), 7203 7170 aSnapshotId->raw(), 7204 mUserData-> mName.raw(),7205 mData->m_strConfigFileFull. raw());7171 mUserData->s.strName.c_str(), 7172 mData->m_strConfigFileFull.c_str()); 7206 7173 7207 7174 return setError(E_FAIL, 7208 tr("Immutable hard disk '%s' with UUID {%RTuuid} cannot be directly attached to the virtual machine '% ls' ('%s')"),7209 medium->getLocationFull(). raw(),7175 tr("Immutable hard disk '%s' with UUID {%RTuuid} cannot be directly attached to the virtual machine '%s' ('%s')"), 7176 medium->getLocationFull().c_str(), 7210 7177 dev.uuid.raw(), 7211 mUserData-> mName.raw(),7212 mData->m_strConfigFileFull. raw());7178 mUserData->s.strName.c_str(), 7179 mData->m_strConfigFileFull.c_str()); 7213 7180 } 7214 7181 … … 7217 7184 ) 7218 7185 return setError(E_FAIL, 7219 tr("Hard disk '%s' with UUID {%RTuuid} cannot be directly attached to the virtual machine '% ls' ('%s') "7186 tr("Hard disk '%s' with UUID {%RTuuid} cannot be directly attached to the virtual machine '%s' ('%s') " 7220 7187 "because it has %d differencing child hard disks"), 7221 medium->getLocationFull(). raw(),7188 medium->getLocationFull().c_str(), 7222 7189 dev.uuid.raw(), 7223 mUserData-> mName.raw(),7224 mData->m_strConfigFileFull. raw(),7190 mUserData->s.strName.c_str(), 7191 mData->m_strConfigFileFull.c_str(), 7225 7192 medium->getChildren().size()); 7226 7193 … … 7228 7195 medium)) 7229 7196 return setError(E_FAIL, 7230 tr("Hard disk '%s' with UUID {%RTuuid} is already attached to the virtual machine '% ls' ('%s')"),7231 medium->getLocationFull(). raw(),7197 tr("Hard disk '%s' with UUID {%RTuuid} is already attached to the virtual machine '%s' ('%s')"), 7198 medium->getLocationFull().c_str(), 7232 7199 dev.uuid.raw(), 7233 mUserData-> mName.raw(),7234 mData->m_strConfigFileFull. raw());7200 mUserData->s.strName.c_str(), 7201 mData->m_strConfigFileFull.c_str()); 7235 7202 7236 7203 break; … … 7239 7206 default: 7240 7207 return setError(E_FAIL, 7241 tr("Device with unknown type is attached to the virtual machine '%s' ('%s')"),7242 medium->getLocationFull(). raw(),7243 mUserData-> mName.raw(),7244 mData->m_strConfigFileFull. raw());7208 tr("Device '%s' with unknown type is attached to the virtual machine '%s' ('%s')"), 7209 medium->getLocationFull().c_str(), 7210 mUserData->s.strName.c_str(), 7211 mData->m_strConfigFileFull.c_str()); 7245 7212 } 7246 7213 … … 7314 7281 return setError(E_FAIL, 7315 7282 tr("Could not find a snapshot with UUID {%s}"), 7316 aId.toString(). raw());7283 aId.toString().c_str()); 7317 7284 return E_FAIL; 7318 7285 } … … 7384 7351 return setError(VBOX_E_OBJECT_NOT_FOUND, 7385 7352 tr("Could not find a storage controller named '%s'"), 7386 aName. raw());7353 aName.c_str()); 7387 7354 return VBOX_E_OBJECT_NOT_FOUND; 7388 7355 } … … 7437 7404 7438 7405 /* attempt to rename the settings file if machine name is changed */ 7439 if ( mUserData-> mNameSync7406 if ( mUserData->s.fNameSync 7440 7407 && mUserData.isBackedUp() 7441 && mUserData.backedUpData()-> mName != mUserData->mName7408 && mUserData.backedUpData()->s.strName != mUserData->s.strName 7442 7409 ) 7443 7410 { … … 7452 7419 int vrc = VINF_SUCCESS; 7453 7420 7454 Utf8Str name = mUserData.backedUpData()-> mName;7455 Utf8Str newName = mUserData-> mName;7421 Utf8Str name = mUserData.backedUpData()->s.strName; 7422 Utf8Str newName = mUserData->s.strName; 7456 7423 7457 7424 configFile = mData->m_strConfigFileFull; … … 7464 7431 { 7465 7432 newConfigDir.stripFilename(); 7466 newConfigDir = Utf8StrFmt("%s%c%s",7467 newConfigDir.raw(), RTPATH_DELIMITER, newName.raw());7433 newConfigDir.append(RTPATH_DELIMITER); 7434 newConfigDir.append(newName); 7468 7435 /* new dir and old dir cannot be equal here because of 'if' 7469 7436 * above and because name != newName */ … … 7472 7439 { 7473 7440 /* perform real rename only if the machine is not new */ 7474 vrc = RTPathRename(configDir. raw(), newConfigDir.raw(), 0);7441 vrc = RTPathRename(configDir.c_str(), newConfigDir.c_str(), 0); 7475 7442 if (RT_FAILURE(vrc)) 7476 7443 { 7477 7444 rc = setError(E_FAIL, 7478 7445 tr("Could not rename the directory '%s' to '%s' to save the settings file (%Rrc)"), 7479 configDir. raw(),7480 newConfigDir. raw(),7446 configDir.c_str(), 7447 newConfigDir.c_str(), 7481 7448 vrc); 7482 7449 break; … … 7487 7454 7488 7455 newConfigFile = Utf8StrFmt("%s%c%s.xml", 7489 newConfigDir. raw(), RTPATH_DELIMITER, newName.raw());7456 newConfigDir.c_str(), RTPATH_DELIMITER, newName.c_str()); 7490 7457 7491 7458 /* then try to rename the settings file itself */ … … 7494 7461 /* get the path to old settings file in renamed directory */ 7495 7462 configFile = Utf8StrFmt("%s%c%s", 7496 newConfigDir. raw(),7463 newConfigDir.c_str(), 7497 7464 RTPATH_DELIMITER, 7498 7465 RTPathFilename(configFile.c_str())); … … 7500 7467 { 7501 7468 /* perform real rename only if the machine is not new */ 7502 vrc = RTFileRename(configFile. raw(), newConfigFile.raw(), 0);7469 vrc = RTFileRename(configFile.c_str(), newConfigFile.c_str(), 0); 7503 7470 if (RT_FAILURE(vrc)) 7504 7471 { 7505 7472 rc = setError(E_FAIL, 7506 7473 tr("Could not rename the settings file '%s' to '%s' (%Rrc)"), 7507 configFile. raw(),7508 newConfigFile. raw(),7474 configFile.c_str(), 7475 newConfigFile.c_str(), 7509 7476 vrc); 7510 7477 break; … … 7531 7498 7532 7499 /* update the snapshot folder */ 7533 Utf8Str path = mUserData->mSnapshotFolderFull; 7500 if (RTPathStartsWith(mUserData->m_strSnapshotFolderFull.c_str(), 7501 configDir.c_str())) 7502 { 7503 mUserData->m_strSnapshotFolderFull = Utf8StrFmt("%s%s", 7504 newConfigDir.c_str(), 7505 mUserData->m_strSnapshotFolderFull.c_str() + configDir.length()); 7506 copyPathRelativeToMachine(mUserData->m_strSnapshotFolderFull, 7507 mUserData->s.strSnapshotFolder); 7508 } 7509 7510 /* update the saved state file path */ 7511 Utf8Str path = mSSData->mStateFilePath; 7534 7512 if (RTPathStartsWith(path.c_str(), configDir.c_str())) 7535 { 7536 path = Utf8StrFmt("%s%s", newConfigDir.raw(), 7537 path.raw() + configDir.length()); 7538 mUserData->mSnapshotFolderFull = path; 7539 Utf8Str strTemp; 7540 copyPathRelativeToMachine(path, strTemp); 7541 mUserData->mSnapshotFolder = strTemp; 7542 } 7543 7544 /* update the saved state file path */ 7545 path = mSSData->mStateFilePath; 7546 if (RTPathStartsWith(path.c_str(), configDir.c_str())) 7547 { 7548 path = Utf8StrFmt("%s%s", newConfigDir.raw(), 7549 path.raw() + configDir.length()); 7550 mSSData->mStateFilePath = path; 7551 } 7513 mSSData->mStateFilePath = Utf8StrFmt("%s%s", 7514 newConfigDir.c_str(), 7515 path.c_str() + configDir.length()); 7552 7516 7553 7517 /* Update saved state file paths of all online snapshots. … … 7564 7528 /* silently try to rename everything back */ 7565 7529 if (fileRenamed) 7566 RTFileRename(newConfigFile. raw(), configFile.raw(), 0);7530 RTFileRename(newConfigFile.c_str(), configFile.c_str(), 0); 7567 7531 if (dirRenamed) 7568 RTPathRename(newConfigDir. raw(), configDir.raw(), 0);7532 RTPathRename(newConfigDir.c_str(), configDir.c_str(), 0); 7569 7533 } 7570 7534 … … 7587 7551 return setError(E_FAIL, 7588 7552 tr("Could not create a directory '%s' to save the settings file (%Rrc)"), 7589 path. raw(),7553 path.c_str(), 7590 7554 vrc); 7591 7555 } … … 7600 7564 return setError(E_FAIL, 7601 7565 tr("Could not create the settings file '%s' (%Rrc)"), 7602 path. raw(),7566 path.c_str(), 7603 7567 vrc); 7604 7568 RTFileClose(f); … … 7775 7739 7776 7740 config.uuid = mData->mUuid; 7777 config.strName = mUserData->mName; 7778 config.fNameSync = !!mUserData->mNameSync; 7779 config.strDescription = mUserData->mDescription; 7780 config.strOsType = mUserData->mOSTypeId; 7741 7742 // copy name, description, OS type, teleport, UTC etc. 7743 config.machineUserData = mUserData->s; 7781 7744 7782 7745 if ( mData->mMachineState == MachineState_Saved … … 7806 7769 config.uuidCurrentSnapshot.clear(); 7807 7770 7808 config.strSnapshotFolder = mUserData->mSnapshotFolder;7809 // config.fCurrentStateModified is special, see below7810 7771 config.timeLastStateChange = mData->mLastStateChange; 7811 7772 config.fAborted = (mData->mMachineState == MachineState_Aborted); 7812 7773 /// @todo Live Migration: config.fTeleported = (mData->mMachineState == MachineState_Teleported); 7813 7814 config.fTeleporterEnabled = !!mUserData->mTeleporterEnabled;7815 config.uTeleporterPort = mUserData->mTeleporterPort;7816 config.strTeleporterAddress = mUserData->mTeleporterAddress;7817 config.strTeleporterPassword = mUserData->mTeleporterPassword;7818 7819 config.fRTCUseUTC = !!mUserData->mRTCUseUTC;7820 7774 7821 7775 HRESULT rc = saveHardware(config.hardwareMachine); … … 8367 8321 DeviceType_T devType = pAtt->getType(); 8368 8322 Medium* pMedium = pAtt->getMedium(); 8323 ComObjPtr<Medium> pBase = pMedium->getBase(); 8369 8324 8370 8325 if ( devType != DeviceType_HardDisk … … 8384 8339 else 8385 8340 aProgress->SetNextOperation(BstrFmt(tr("Skipping medium '%s'"), 8386 p Medium->getBase()->getName().raw()),8341 pBase->getName().c_str()), 8387 8342 aWeight); // weight 8388 8343 } … … 8394 8349 /* need a diff */ 8395 8350 aProgress->SetNextOperation(BstrFmt(tr("Creating differencing hard disk for '%s'"), 8396 p Medium->getBase()->getName().raw()),8351 pBase->getName().c_str()), 8397 8352 aWeight); // weight 8398 8353 … … 8401 8356 rc = diff->init(mParent, 8402 8357 pMedium->getPreferredDiffFormat(), 8403 Utf8StrFmt("%ls"RTPATH_SLASH_STR, 8404 mUserData->mSnapshotFolderFull.raw()).raw(), 8358 Utf8Str(mUserData->m_strSnapshotFolderFull).append(RTPATH_SLASH_STR), 8405 8359 pfNeedsSaveSettings); 8406 8360 if (FAILED(rc)) throw rc; … … 8842 8796 8843 8797 LogFlowThisFunc(("Examining current medium '%s' (implicit: %d)\n", 8844 (pMedium) ? pMedium->getName().raw() : "NULL",8845 8798 (pMedium) ? pMedium->getName().c_str() : "NULL", 8799 fImplicit)); 8846 8800 8847 8801 /** @todo convert all this Machine-based voodoo to MediumAttachment … … 8893 8847 if (pOldAttach->getMedium() == pMedium) 8894 8848 { 8895 LogFlowThisFunc(("--> medium '%s' was attached before, will not remove\n", pMedium->getName(). raw()));8849 LogFlowThisFunc(("--> medium '%s' was attached before, will not remove\n", pMedium->getName().c_str())); 8896 8850 8897 8851 /* yes: remove from old to avoid de-association */ … … 8916 8870 if (pAttach->getType() == DeviceType_HardDisk && pMedium) 8917 8871 { 8918 LogFlowThisFunc(("detaching medium '%s' from machine\n", pMedium->getName(). raw()));8872 LogFlowThisFunc(("detaching medium '%s' from machine\n", pMedium->getName().c_str())); 8919 8873 8920 8874 /* now de-associate from the current machine state */ … … 9039 8993 Utf8Str settingsDir = mData->m_strConfigFileFull; 9040 8994 settingsDir.stripFilename(); 9041 char *dirName = RTPathFilename(settingsDir.c_str());9042 9043 AssertReturn( dirName, false);8995 Utf8Str strDirName = RTPathFilename(settingsDir.c_str()); 8996 8997 AssertReturn(!strDirName.isEmpty(), false); 9044 8998 9045 8999 /* if we don't rename anything on name change, return false shorlty */ 9046 if (!mUserData-> mNameSync)9000 if (!mUserData->s.fNameSync) 9047 9001 return false; 9048 9002 … … 9050 9004 *aSettingsDir = settingsDir; 9051 9005 9052 return Bstr(dirName) == mUserData->mName;9006 return strDirName == mUserData->s.strName; 9053 9007 } 9054 9008 … … 9547 9501 { 9548 9502 LogFlowThisFuncEnter(); 9549 LogFlowThisFunc(("mName={% ls}\n", aMachine->mUserData->mName.raw()));9503 LogFlowThisFunc(("mName={%s}\n", aMachine->mUserData->s.strName.c_str())); 9550 9504 9551 9505 AssertReturn(aMachine, E_INVALIDARG); … … 10343 10297 if (mData->mMachineState == MachineState_Paused) 10344 10298 { 10345 stateFilePath = Utf8StrFmt("% ls%c{%RTuuid}.sav",10346 mUserData->m SnapshotFolderFull.raw(),10299 stateFilePath = Utf8StrFmt("%s%c{%RTuuid}.sav", 10300 mUserData->m_strSnapshotFolderFull.c_str(), 10347 10301 RTPATH_DELIMITER, mData->mUuid.raw()); 10348 10302 } … … 10507 10461 { 10508 10462 Utf8Str utf8Flags(aFlags); 10509 int vrc = validateFlags(utf8Flags. raw(), &fFlags);10463 int vrc = validateFlags(utf8Flags.c_str(), &fFlags); 10510 10464 AssertRCReturn(vrc, E_INVALIDARG); 10511 10465 } … … 10569 10523 */ 10570 10524 if ( mHWData->mGuestPropertyNotificationPatterns.isEmpty() 10571 || RTStrSimplePatternMultiMatch(mHWData->mGuestPropertyNotificationPatterns. raw(),10525 || RTStrSimplePatternMultiMatch(mHWData->mGuestPropertyNotificationPatterns.c_str(), 10572 10526 RTSTR_MAX, 10573 utf8Name. raw(),10527 utf8Name.c_str(), 10574 10528 RTSTR_MAX, NULL) 10575 10529 ) -
trunk/src/VBox/Main/MediumImpl.cpp
r31482 r31539 1012 1012 1013 1013 LogFlowThisFunc(("m->strLocationFull='%s', m->strFormat=%s, m->id={%RTuuid}\n", 1014 m->strLocationFull. raw(), m->strFormat.raw(), m->id.raw()));1014 m->strLocationFull.c_str(), m->strFormat.c_str(), m->id.raw())); 1015 1015 1016 1016 /* Don't call queryInfo() for registered media to prevent the calling … … 1085 1085 size_t lenLocation = aLocation.length(); 1086 1086 if (lenLocation > 12) 1087 memcpy(&uuid.au8[4], aLocation. raw() + (lenLocation - 12), 12);1087 memcpy(&uuid.au8[4], aLocation.c_str() + (lenLocation - 12), 12); 1088 1088 else 1089 memcpy(&uuid.au8[4 + 12 - lenLocation], aLocation. raw(), lenLocation);1089 memcpy(&uuid.au8[4 + 12 - lenLocation], aLocation.c_str(), lenLocation); 1090 1090 unconst(m->id) = uuid; 1091 1091 … … 1436 1436 return setError(VBOX_E_INVALID_OBJECT_STATE, 1437 1437 tr("Cannot change the type of medium '%s' because it is a differencing medium"), 1438 m->strLocationFull. raw());1438 m->strLocationFull.c_str()); 1439 1439 1440 1440 /* cannot change the type of a medium being in use by more than one VM */ … … 1442 1442 return setError(VBOX_E_INVALID_OBJECT_STATE, 1443 1443 tr("Cannot change the type of medium '%s' because it is attached to %d virtual machines"), 1444 m->strLocationFull. raw(), m->backRefs.size());1444 m->strLocationFull.c_str(), m->backRefs.size()); 1445 1445 1446 1446 switch (aType) … … 1461 1461 return setError(VBOX_E_OBJECT_IN_USE, 1462 1462 tr("Cannot change type for medium '%s' since it has %d child media"), 1463 m->strLocationFull. raw(), getChildren().size());1463 m->strLocationFull.c_str(), getChildren().size()); 1464 1464 if (aType == MediumType_Shareable) 1465 1465 { … … 1468 1468 return setError(VBOX_E_INVALID_OBJECT_STATE, 1469 1469 tr("Cannot change type for medium '%s' to 'Shareable' since it is a dynamic medium storage unit"), 1470 m->strLocationFull. raw());1470 m->strLocationFull.c_str()); 1471 1471 } 1472 1472 break; … … 1599 1599 return setError(VBOX_E_NOT_SUPPORTED, 1600 1600 tr("Medium '%s' is not differencing"), 1601 m->strLocationFull. raw());1601 m->strLocationFull.c_str()); 1602 1602 1603 1603 if (m->autoReset != !!aAutoReset) … … 1830 1830 rc = setError(VBOX_E_INVALID_OBJECT_STATE, 1831 1831 tr("Medium '%s' is not locked for reading"), 1832 m->strLocationFull. raw());1832 m->strLocationFull.c_str()); 1833 1833 break; 1834 1834 } … … 1920 1920 rc = setError(VBOX_E_INVALID_OBJECT_STATE, 1921 1921 tr("Medium '%s' is not locked for writing"), 1922 m->strLocationFull. raw());1922 m->strLocationFull.c_str()); 1923 1923 break; 1924 1924 } … … 2106 2106 throw setError(VBOX_E_NOT_SUPPORTED, 2107 2107 tr("Medium format '%s' does not support dynamic storage creation"), 2108 m->strFormat. raw());2108 m->strFormat.c_str()); 2109 2109 if ( (aVariant & MediumVariant_Fixed) 2110 2110 && !(m->formatObj->getCapabilities() & MediumFormatCapabilities_CreateDynamic)) 2111 2111 throw setError(VBOX_E_NOT_SUPPORTED, 2112 2112 tr("Medium format '%s' does not support fixed storage creation"), 2113 m->strFormat. raw());2113 m->strFormat.c_str()); 2114 2114 2115 2115 if (m->state != MediumState_NotCreated) … … 2120 2120 static_cast<IMedium*>(this), 2121 2121 (aVariant & MediumVariant_Fixed) 2122 ? BstrFmt(tr("Creating fixed medium storage unit '%s'"), m->strLocationFull. raw())2123 : BstrFmt(tr("Creating dynamic medium storage unit '%s'"), m->strLocationFull. raw()),2122 ? BstrFmt(tr("Creating fixed medium storage unit '%s'"), m->strLocationFull.c_str()) 2123 : BstrFmt(tr("Creating dynamic medium storage unit '%s'"), m->strLocationFull.c_str()), 2124 2124 TRUE /* aCancelable */); 2125 2125 if (FAILED(rc)) … … 2193 2193 return setError(VBOX_E_INVALID_OBJECT_STATE, 2194 2194 tr("Medium type of '%s' is Writethrough"), 2195 m->strLocationFull. raw());2195 m->strLocationFull.c_str()); 2196 2196 else if (m->type == MediumType_Shareable) 2197 2197 return setError(VBOX_E_INVALID_OBJECT_STATE, 2198 2198 tr("Medium type of '%s' is Shareable"), 2199 m->strLocationFull. raw());2199 m->strLocationFull.c_str()); 2200 2200 2201 2201 /* Apply the normal locking logic to the entire chain. */ … … 2322 2322 throw setError(rc, 2323 2323 tr("Failed to lock source media '%s'"), 2324 getLocationFull(). raw());2324 getLocationFull().c_str()); 2325 2325 } 2326 2326 rc = pTargetMediumLockList->Lock(); … … 2331 2331 throw setError(rc, 2332 2332 tr("Failed to lock target media '%s'"), 2333 pTarget->getLocationFull(). raw());2333 pTarget->getLocationFull().c_str()); 2334 2334 } 2335 2335 … … 2337 2337 rc = pProgress->init(m->pVirtualBox, 2338 2338 static_cast <IMedium *>(this), 2339 BstrFmt(tr("Creating clone medium '%s'"), pTarget->m->strLocationFull. raw()),2339 BstrFmt(tr("Creating clone medium '%s'"), pTarget->m->strLocationFull.c_str()), 2340 2340 TRUE /* aCancelable */); 2341 2341 if (FAILED(rc)) … … 2410 2410 throw setError(rc, 2411 2411 tr("Failed to lock media when compacting '%s'"), 2412 getLocationFull(). raw());2412 getLocationFull().c_str()); 2413 2413 } 2414 2414 … … 2416 2416 rc = pProgress->init(m->pVirtualBox, 2417 2417 static_cast <IMedium *>(this), 2418 BstrFmt(tr("Compacting medium '%s'"), m->strLocationFull. raw()),2418 BstrFmt(tr("Compacting medium '%s'"), m->strLocationFull.c_str()), 2419 2419 TRUE /* aCancelable */); 2420 2420 if (FAILED(rc)) … … 2481 2481 throw setError(VBOX_E_NOT_SUPPORTED, 2482 2482 tr("Medium type of '%s' is not differencing"), 2483 m->strLocationFull. raw());2483 m->strLocationFull.c_str()); 2484 2484 2485 2485 rc = canClose(); … … 2505 2505 throw setError(rc, 2506 2506 tr("Failed to lock media when resetting '%s'"), 2507 getLocationFull(). raw());2507 getLocationFull().c_str()); 2508 2508 } 2509 2509 … … 2511 2511 rc = pProgress->init(m->pVirtualBox, 2512 2512 static_cast<IMedium*>(this), 2513 BstrFmt(tr("Resetting differencing medium '%s'"), m->strLocationFull. raw()),2513 BstrFmt(tr("Resetting differencing medium '%s'"), m->strLocationFull.c_str()), 2514 2514 FALSE /* aCancelable */); 2515 2515 if (FAILED(rc)) … … 2701 2701 return setError(VBOX_E_OBJECT_IN_USE, 2702 2702 tr("Cannot attach medium '%s' {%RTuuid}: %u differencing child media are being created"), 2703 m->strLocationFull. raw(),2703 m->strLocationFull.c_str(), 2704 2704 m->id.raw(), 2705 2705 m->numCreateDiffTasks); … … 2744 2744 return setError(VBOX_E_OBJECT_IN_USE, 2745 2745 tr("Cannot attach medium '%s' {%RTuuid} from snapshot '%RTuuid': medium is already in use by this snapshot!"), 2746 m->strLocationFull. raw(),2746 m->strLocationFull.c_str(), 2747 2747 m->id.raw(), 2748 2748 aSnapshotId.raw(), … … 2838 2838 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 2839 2839 2840 LogFlowThisFunc(("Dumping backrefs for medium '%s':\n", m->strLocationFull. raw()));2840 LogFlowThisFunc(("Dumping backrefs for medium '%s':\n", m->strLocationFull.c_str())); 2841 2841 2842 2842 for (BackRefList::iterator it2 = m->backRefs.begin(); … … 2877 2877 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 2878 2878 2879 LogFlowThisFunc(("locationFull.before='%s'\n", m->strLocationFull. raw()));2879 LogFlowThisFunc(("locationFull.before='%s'\n", m->strLocationFull.c_str())); 2880 2880 2881 2881 const char *pcszMediumPath = m->strLocationFull.c_str(); … … 2891 2891 unconst(m->strLocation) = path; 2892 2892 2893 LogFlowThisFunc(("locationFull.after='%s'\n", m->strLocationFull. raw()));2893 LogFlowThisFunc(("locationFull.after='%s'\n", m->strLocationFull.c_str())); 2894 2894 } 2895 2895 … … 3093 3093 return setError(VBOX_E_FILE_ERROR, 3094 3094 tr("Invalid medium storage file location '%s' (%Rrc)"), 3095 location. raw(),3095 location.c_str(), 3096 3096 vrc); 3097 3097 … … 3319 3319 3320 3320 location = Utf8StrFmt("%s{%RTuuid}.%s", 3321 location. raw(), id.raw(), strExt.c_str());3321 location.c_str(), id.raw(), strExt.c_str()); 3322 3322 } 3323 3323 } … … 3339 3339 return setError(VBOX_E_FILE_ERROR, 3340 3340 tr("Invalid medium storage file location '%s' (%Rrc)"), 3341 location. raw(), vrc);3341 location.c_str(), vrc); 3342 3342 3343 3343 /* detect the backend from the storage unit if importing */ … … 3369 3369 return setError(VBOX_E_FILE_ERROR, 3370 3370 tr("Could not find file for the medium '%s' (%Rrc)"), 3371 locationFull. raw(), vrc);3371 locationFull.c_str(), vrc); 3372 3372 else if (aFormat.isEmpty()) 3373 3373 return setError(VBOX_E_IPRT_ERROR, 3374 3374 tr("Could not get the storage format of the medium '%s' (%Rrc)"), 3375 locationFull. raw(), vrc);3375 locationFull.c_str(), vrc); 3376 3376 else 3377 3377 { … … 3758 3758 rc = setError(VBOX_E_INVALID_OBJECT_STATE, 3759 3759 tr("Storage for the medium '%s' is not created"), 3760 m->strLocationFull. raw());3760 m->strLocationFull.c_str()); 3761 3761 break; 3762 3762 } … … 3765 3765 rc = setError(VBOX_E_INVALID_OBJECT_STATE, 3766 3766 tr("Storage for the medium '%s' is already created"), 3767 m->strLocationFull. raw());3767 m->strLocationFull.c_str()); 3768 3768 break; 3769 3769 } … … 3772 3772 rc = setError(VBOX_E_INVALID_OBJECT_STATE, 3773 3773 tr("Medium '%s' is locked for reading by another task"), 3774 m->strLocationFull. raw());3774 m->strLocationFull.c_str()); 3775 3775 break; 3776 3776 } … … 3779 3779 rc = setError(VBOX_E_INVALID_OBJECT_STATE, 3780 3780 tr("Medium '%s' is locked for writing by another task"), 3781 m->strLocationFull. raw());3781 m->strLocationFull.c_str()); 3782 3782 break; 3783 3783 } … … 3788 3788 rc = setError(VBOX_E_INVALID_OBJECT_STATE, 3789 3789 tr("Medium '%s' is not accessible. %s"), 3790 m->strLocationFull. raw(), m->strLastAccessError.c_str());3790 m->strLocationFull.c_str(), m->strLastAccessError.c_str()); 3791 3791 else 3792 3792 rc = setError(VBOX_E_INVALID_OBJECT_STATE, 3793 3793 tr("Medium '%s' is not accessible"), 3794 m->strLocationFull. raw());3794 m->strLocationFull.c_str()); 3795 3795 break; 3796 3796 } … … 3799 3799 rc = setError(VBOX_E_INVALID_OBJECT_STATE, 3800 3800 tr("Storage for the medium '%s' is being created"), 3801 m->strLocationFull. raw());3801 m->strLocationFull.c_str()); 3802 3802 break; 3803 3803 } … … 3806 3806 rc = setError(VBOX_E_INVALID_OBJECT_STATE, 3807 3807 tr("Storage for the medium '%s' is being deleted"), 3808 m->strLocationFull. raw());3808 m->strLocationFull.c_str()); 3809 3809 break; 3810 3810 } … … 3861 3861 return setError(VBOX_E_OBJECT_IN_USE, 3862 3862 tr("Medium '%s' cannot be closed because it is still attached to %d virtual machines"), 3863 m->strLocationFull.raw(), m->backRefs.size());3863 m->strLocationFull.c_str(), m->backRefs.size()); 3864 3864 3865 3865 // perform extra media-dependent close checks … … 3939 3939 throw setError(VBOX_E_NOT_SUPPORTED, 3940 3940 tr("Medium format '%s' does not support storage deletion"), 3941 m->strFormat. raw());3941 m->strFormat.c_str()); 3942 3942 3943 3943 /* Note that we are fine with Inaccessible state too: a) for symmetry … … 4011 4011 throw setError(rc, 4012 4012 tr("Failed to lock media when deleting '%s'"), 4013 getLocationFull(). raw());4013 getLocationFull().c_str()); 4014 4014 } 4015 4015 … … 4035 4035 rc = pProgress->init(m->pVirtualBox, 4036 4036 static_cast<IMedium*>(this), 4037 BstrFmt(tr("Deleting medium storage unit '%s'"), m->strLocationFull. raw()),4037 BstrFmt(tr("Deleting medium storage unit '%s'"), m->strLocationFull.c_str()), 4038 4038 FALSE /* aCancelable */); 4039 4039 if (FAILED(rc)) … … 4239 4239 throw setError(VBOX_E_INVALID_OBJECT_STATE, 4240 4240 tr("Medium '%s' is attached to a virtual machine with UUID {%RTuuid}. No differencing media based on it may be created until it is detached"), 4241 m->strLocationFull. raw(), it->machineId.raw());4241 m->strLocationFull.c_str(), it->machineId.raw()); 4242 4242 4243 4243 Assert(it->llSnapshotIds.size() == 1); … … 4256 4256 rc = pProgress->init(m->pVirtualBox, 4257 4257 static_cast<IMedium*>(this), 4258 BstrFmt(tr("Creating differencing medium storage unit '%s'"), aTarget->m->strLocationFull. raw()),4258 BstrFmt(tr("Creating differencing medium storage unit '%s'"), aTarget->m->strLocationFull.c_str()), 4259 4259 TRUE /* aCancelable */); 4260 4260 if (FAILED(rc)) … … 4377 4377 throw setError(VBOX_E_INVALID_OBJECT_STATE, 4378 4378 tr("Media '%s' and '%s' are unrelated"), 4379 m->strLocationFull. raw(), tgtLoc.raw());4379 m->strLocationFull.c_str(), tgtLoc.c_str()); 4380 4380 } 4381 4381 } … … 4423 4423 throw setError(VBOX_E_INVALID_OBJECT_STATE, 4424 4424 tr("Medium '%s' involved in the merge operation has more than one child medium (%d)"), 4425 m->strLocationFull. raw(), getChildren().size());4425 m->strLocationFull.c_str(), getChildren().size()); 4426 4426 } 4427 4427 /* One backreference is only allowed if the machine ID is not empty … … 4437 4437 throw setError(VBOX_E_OBJECT_IN_USE, 4438 4438 tr("Medium '%s' is attached to %d virtual machines"), 4439 m->strLocationFull. raw(), m->backRefs.size());4439 m->strLocationFull.c_str(), m->backRefs.size()); 4440 4440 if (m->type == MediumType_Immutable) 4441 4441 throw setError(VBOX_E_INVALID_OBJECT_STATE, 4442 4442 tr("Medium '%s' is immutable"), 4443 m->strLocationFull. raw());4443 m->strLocationFull.c_str()); 4444 4444 } 4445 4445 else … … 4450 4450 throw setError(VBOX_E_OBJECT_IN_USE, 4451 4451 tr("Medium '%s' involved in the merge operation has more than one child medium (%d)"), 4452 pTarget->m->strLocationFull. raw(),4452 pTarget->m->strLocationFull.c_str(), 4453 4453 pTarget->getChildren().size()); 4454 4454 } … … 4456 4456 throw setError(VBOX_E_INVALID_OBJECT_STATE, 4457 4457 tr("Medium '%s' is immutable"), 4458 pTarget->m->strLocationFull. raw());4458 pTarget->m->strLocationFull.c_str()); 4459 4459 } 4460 4460 ComObjPtr<Medium> pLast(fMergeForward ? (Medium *)pTarget : this); … … 4469 4469 throw setError(VBOX_E_OBJECT_IN_USE, 4470 4470 tr("Medium '%s' involved in the merge operation has more than one child medium (%d)"), 4471 pLast->m->strLocationFull. raw(),4471 pLast->m->strLocationFull.c_str(), 4472 4472 pLast->getChildren().size()); 4473 4473 } … … 4475 4475 throw setError(VBOX_E_OBJECT_IN_USE, 4476 4476 tr("Medium '%s' is attached to %d virtual machines"), 4477 pLast->m->strLocationFull. raw(),4477 pLast->m->strLocationFull.c_str(), 4478 4478 pLast->m->backRefs.size()); 4479 4479 … … 4574 4574 throw setError(rc, 4575 4575 tr("Failed to lock media when merging to '%s'"), 4576 pTarget->getLocationFull(). raw());4576 pTarget->getLocationFull().c_str()); 4577 4577 } 4578 4578 } … … 4715 4715 static_cast<IMedium*>(this), 4716 4716 BstrFmt(tr("Merging medium '%s' to '%s'"), 4717 getName(). raw(),4718 tgtName. raw()),4717 getName().c_str(), 4718 tgtName.c_str()), 4719 4719 TRUE /* aCancelable */); 4720 4720 if (FAILED(rc)) … … 4828 4828 return setError(VBOX_E_OBJECT_IN_USE, 4829 4829 tr("Cannot close medium '%s' because it has %d child media"), 4830 m->strLocationFull. raw(), getChildren().size());4830 m->strLocationFull.c_str(), getChildren().size()); 4831 4831 4832 4832 return S_OK; … … 4964 4964 error = Utf8StrFmt(" (%Rrc)", aVRC); 4965 4965 else 4966 error = Utf8StrFmt(".\n%s", m->vdError. raw());4966 error = Utf8StrFmt(".\n%s", m->vdError.c_str()); 4967 4967 4968 4968 m->vdError.setNull(); … … 4996 4996 if (that->m->vdError.isEmpty()) 4997 4997 that->m->vdError = 4998 Utf8StrFmt("%s (%Rrc)", Utf8StrFmtVA(pszFormat, va). raw(), rc);4998 Utf8StrFmt("%s (%Rrc)", Utf8StrFmtVA(pszFormat, va).c_str(), rc); 4999 4999 else 5000 5000 that->m->vdError = 5001 Utf8StrFmt("%s.\n%s (%Rrc)", that->m->vdError. raw(),5002 Utf8StrFmtVA(pszFormat, va). raw(), rc);5001 Utf8StrFmt("%s.\n%s (%Rrc)", that->m->vdError.c_str(), 5002 Utf8StrFmtVA(pszFormat, va).c_str(), rc); 5003 5003 } 5004 5004 … … 5269 5269 throw setError(E_FAIL, 5270 5270 tr("Could not update medium UUID references to parent '%s' (%s)"), 5271 m->strLocationFull. raw(),5272 vdError(aVRC). raw());5271 m->strLocationFull.c_str(), 5272 vdError(aVRC).c_str()); 5273 5273 } 5274 5274 … … 5384 5384 throw setError(VBOX_E_FILE_ERROR, 5385 5385 tr("Could not create the medium storage unit '%s'%s"), 5386 location. raw(), vdError(vrc).raw());5386 location.c_str(), vdError(vrc).c_str()); 5387 5387 5388 5388 size = VDGetFileSize(hdd, 0); … … 5530 5530 throw setError(VBOX_E_FILE_ERROR, 5531 5531 tr("Could not open the medium storage unit '%s'%s"), 5532 pMedium->m->strLocationFull. raw(),5533 vdError(vrc). raw());5532 pMedium->m->strLocationFull.c_str(), 5533 vdError(vrc).c_str()); 5534 5534 } 5535 5535 … … 5552 5552 throw setError(VBOX_E_FILE_ERROR, 5553 5553 tr("Could not create the differencing medium storage unit '%s'%s"), 5554 targetLocation. raw(), vdError(vrc).raw());5554 targetLocation.c_str(), vdError(vrc).c_str()); 5555 5555 5556 5556 size = VDGetFileSize(hdd, VD_LAST_IMAGE); … … 5785 5785 throw setError(VBOX_E_FILE_ERROR, 5786 5786 tr("Could not merge the medium '%s' to '%s'%s"), 5787 m->strLocationFull. raw(),5788 pTarget->m->strLocationFull. raw(),5789 vdError(aVRC). raw());5787 m->strLocationFull.c_str(), 5788 pTarget->m->strLocationFull.c_str(), 5789 vdError(aVRC).c_str()); 5790 5790 } 5791 5791 … … 6015 6015 throw setError(VBOX_E_FILE_ERROR, 6016 6016 tr("Could not open the medium storage unit '%s'%s"), 6017 pMedium->m->strLocationFull. raw(),6018 vdError(vrc). raw());6017 pMedium->m->strLocationFull.c_str(), 6018 vdError(vrc).c_str()); 6019 6019 } 6020 6020 … … 6079 6079 throw setError(VBOX_E_FILE_ERROR, 6080 6080 tr("Could not open the medium storage unit '%s'%s"), 6081 pMedium->m->strLocationFull. raw(),6082 vdError(vrc). raw());6081 pMedium->m->strLocationFull.c_str(), 6082 vdError(vrc).c_str()); 6083 6083 } 6084 6084 … … 6088 6088 targetHdd, 6089 6089 targetFormat.c_str(), 6090 (fCreatingTarget) ? targetLocation. raw() : (char *)NULL,6090 (fCreatingTarget) ? targetLocation.c_str() : (char *)NULL, 6091 6091 false, 6092 6092 0, … … 6099 6099 throw setError(VBOX_E_FILE_ERROR, 6100 6100 tr("Could not create the clone medium '%s'%s"), 6101 targetLocation. raw(), vdError(vrc).raw());6101 targetLocation.c_str(), vdError(vrc).c_str()); 6102 6102 6103 6103 size = VDGetFileSize(targetHdd, VD_LAST_IMAGE); … … 6234 6234 throw setError(VBOX_E_FILE_ERROR, 6235 6235 tr("Could not delete the medium storage unit '%s'%s"), 6236 location. raw(), vdError(vrc).raw());6236 location.c_str(), vdError(vrc).c_str()); 6237 6237 6238 6238 } … … 6329 6329 throw setError(VBOX_E_FILE_ERROR, 6330 6330 tr("Could not open the medium storage unit '%s'%s"), 6331 pMedium->m->strLocationFull. raw(),6332 vdError(vrc). raw());6331 pMedium->m->strLocationFull.c_str(), 6332 vdError(vrc).c_str()); 6333 6333 6334 6334 /* Done when we hit the media which should be reset */ … … 6342 6342 throw setError(VBOX_E_FILE_ERROR, 6343 6343 tr("Could not delete the medium storage unit '%s'%s"), 6344 location. raw(), vdError(vrc).raw());6344 location.c_str(), vdError(vrc).c_str()); 6345 6345 6346 6346 /* next, create it again */ … … 6353 6353 throw setError(VBOX_E_FILE_ERROR, 6354 6354 tr("Could not open the medium storage unit '%s'%s"), 6355 parentLocation. raw(), vdError(vrc).raw());6355 parentLocation.c_str(), vdError(vrc).c_str()); 6356 6356 6357 6357 vrc = VDCreateDiff(hdd, … … 6369 6369 throw setError(VBOX_E_FILE_ERROR, 6370 6370 tr("Could not create the differencing medium storage unit '%s'%s"), 6371 location. raw(), vdError(vrc).raw());6371 location.c_str(), vdError(vrc).c_str()); 6372 6372 6373 6373 size = VDGetFileSize(hdd, VD_LAST_IMAGE); … … 6459 6459 throw setError(VBOX_E_FILE_ERROR, 6460 6460 tr("Could not open the medium storage unit '%s'%s"), 6461 pMedium->m->strLocationFull. raw(),6462 vdError(vrc). raw());6461 pMedium->m->strLocationFull.c_str(), 6462 vdError(vrc).c_str()); 6463 6463 } 6464 6464 … … 6476 6476 throw setError(VBOX_E_NOT_SUPPORTED, 6477 6477 tr("Compacting is not yet supported for medium '%s'"), 6478 location. raw());6478 location.c_str()); 6479 6479 else if (vrc == VERR_NOT_IMPLEMENTED) 6480 6480 throw setError(E_NOTIMPL, 6481 6481 tr("Compacting is not implemented, medium '%s'"), 6482 location. raw());6482 location.c_str()); 6483 6483 else 6484 6484 throw setError(VBOX_E_FILE_ERROR, 6485 6485 tr("Could not compact medium '%s'%s"), 6486 location. raw(),6487 vdError(vrc). raw());6486 location.c_str(), 6487 vdError(vrc).c_str()); 6488 6488 } 6489 6489 } -
trunk/src/VBox/Main/NATEngineImpl.cpp
r30764 r31539 224 224 225 225 STDMETHODIMP 226 NATEngine::COMGETTER(Redirects) (ComSafeArrayOut(BSTR , aNatRules))226 NATEngine::COMGETTER(Redirects)(ComSafeArrayOut(BSTR , aNatRules)) 227 227 { 228 228 CheckComArgOutSafeArrayPointerValid(aNatRules); … … 241 241 { 242 242 settings::NATRule r = it->second; 243 Utf8Str utf = Utf8StrFmt("%s,%d,%s,%d,%s,%d", r.strName.raw(), r.u32Proto, 244 r.strHostIP.raw(), r.u16HostPort, r.strGuestIP.raw(), r.u16GuestPort); 245 utf.cloneTo(&sf[i]); 243 BstrFmt bstr("%s,%d,%s,%d,%s,%d", 244 r.strName.c_str(), 245 r.u32Proto, 246 r.strHostIP.c_str(), 247 r.u16HostPort, 248 r.strGuestIP.c_str(), 249 r.u16GuestPort); 250 bstr.detachTo(&sf[i]); 246 251 } 247 252 sf.detachTo(ComSafeArrayOutArg(aNatRules)); … … 276 281 name = Utf8StrFmt("%s_%d_%d", proto, aHostPort, aGuestPort); 277 282 } 278 r.strName = name. raw();283 r.strName = name.c_str(); 279 284 r.u32Proto = aProto; 280 285 r.strHostIP = aBindIp; … … 405 410 { 406 411 mData->mNetwork.cloneTo(aNetwork); 407 Log(("Getter (this:%p) Network: %s\n", this, mData->mNetwork. raw()));412 Log(("Getter (this:%p) Network: %s\n", this, mData->mNetwork.c_str())); 408 413 } 409 414 return S_OK; … … 463 468 { 464 469 mData->mTftpPrefix.cloneTo(aTftpPrefix); 465 Log(("Getter (this:%p) TftpPrefix: %s\n", this, mData->mTftpPrefix. raw()));470 Log(("Getter (this:%p) TftpPrefix: %s\n", this, mData->mTftpPrefix.c_str())); 466 471 } 467 472 return S_OK; … … 494 499 { 495 500 mData->mTftpBootFile.cloneTo(aTftpBootFile); 496 Log(("Getter (this:%p) BootFile: %s\n", this, mData->mTftpBootFile. raw()));501 Log(("Getter (this:%p) BootFile: %s\n", this, mData->mTftpBootFile.c_str())); 497 502 } 498 503 return S_OK; … … 525 530 { 526 531 mData->mTftpNextServer.cloneTo(aTftpNextServer); 527 Log(("Getter (this:%p) NextServer: %s\n", this, mData->mTftpNextServer. raw()));532 Log(("Getter (this:%p) NextServer: %s\n", this, mData->mTftpNextServer.c_str())); 528 533 } 529 534 return S_OK; -
trunk/src/VBox/Main/SessionImpl.cpp
r31332 r31539 1028 1028 # ifdef VBOX_WITH_NEW_SYS_V_KEYGEN 1029 1029 Utf8Str ipcKey = ipcId; 1030 key_t key = RTStrToUInt32(ipcKey. raw());1030 key_t key = RTStrToUInt32(ipcKey.c_str()); 1031 1031 AssertMsgReturn (key != 0, 1032 1032 ("Key value of 0 is not valid for IPC semaphore"), -
trunk/src/VBox/Main/SharedFolderImpl.cpp
r31002 r31539 218 218 return setError(E_INVALIDARG, 219 219 tr("Invalid shared folder path: '%s' (%Rrc)"), 220 hostPath. raw(), vrc);220 hostPath.c_str(), vrc); 221 221 222 222 if (RTPathCompare(hostPath.c_str(), hostPathFull) != 0) 223 223 return setError(E_INVALIDARG, 224 224 tr("Shared folder path '%s' is not absolute"), 225 hostPath. raw());225 hostPath.c_str()); 226 226 227 227 unconst(mParent) = aParent; … … 309 309 310 310 m.lastAccessError = BstrFmt ( 311 tr ("'%s' is not accessible (%Rrc)"), hostPath. raw(), vrc);311 tr ("'%s' is not accessible (%Rrc)"), hostPath.c_str(), vrc); 312 312 313 313 LogWarningThisFunc(("m.lastAccessError=\"%ls\"\n", m.lastAccessError.raw())); -
trunk/src/VBox/Main/SnapshotImpl.cpp
r31358 r31539 520 520 HRESULT Snapshot::deleteStateFile() 521 521 { 522 int vrc = RTFileDelete(m->pMachine->mSSData->mStateFilePath. raw());522 int vrc = RTFileDelete(m->pMachine->mSSData->mStateFilePath.c_str()); 523 523 if (RT_SUCCESS(vrc)) 524 524 m->pMachine->mSSData->mStateFilePath.setNull(); … … 688 688 * @param aNewPath 689 689 */ 690 void Snapshot::updateSavedStatePathsImpl(const char *aOldPath, const char *aNewPath) 690 void Snapshot::updateSavedStatePathsImpl(const Utf8Str &strOldPath, 691 const Utf8Str &strNewPath) 691 692 { 692 693 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 697 698 /* state file may be NULL (for offline snapshots) */ 698 699 if ( path.length() 699 && RTPathStartsWith(path.c_str(), aOldPath)700 && RTPathStartsWith(path.c_str(), strOldPath.c_str()) 700 701 ) 701 702 { 702 m->pMachine->mSSData->mStateFilePath = Utf8StrFmt("%s%s", aNewPath, path.raw() + strlen(aOldPath)); 703 704 LogFlowThisFunc(("-> updated: {%s}\n", path.raw())); 703 m->pMachine->mSSData->mStateFilePath = Utf8StrFmt("%s%s", 704 strNewPath.c_str(), 705 path.c_str() + strOldPath.length()); 706 LogFlowThisFunc(("-> updated: {%s}\n", path.c_str())); 705 707 } 706 708 … … 710 712 { 711 713 Snapshot *pChild = *it; 712 pChild->updateSavedStatePathsImpl( aOldPath, aNewPath);714 pChild->updateSavedStatePathsImpl(strOldPath, strNewPath); 713 715 } 714 716 } … … 725 727 * @note Locks the machine (for the snapshots tree) + this object + children for writing. 726 728 */ 727 void Snapshot::updateSavedStatePaths(const char *aOldPath, const char *aNewPath) 728 { 729 LogFlowThisFunc(("aOldPath={%s} aNewPath={%s}\n", aOldPath, aNewPath)); 730 731 AssertReturnVoid(aOldPath); 732 AssertReturnVoid(aNewPath); 729 void Snapshot::updateSavedStatePaths(const Utf8Str &strOldPath, 730 const Utf8Str &strNewPath) 731 { 732 LogFlowThisFunc(("aOldPath={%s} aNewPath={%s}\n", strOldPath.c_str(), strNewPath.c_str())); 733 733 734 734 AutoCaller autoCaller(this); … … 739 739 740 740 // call the implementation under the tree lock 741 updateSavedStatePathsImpl( aOldPath, aNewPath);741 updateSavedStatePathsImpl(strOldPath, strNewPath); 742 742 } 743 743 … … 926 926 { 927 927 LogFlowThisFuncEnter(); 928 LogFlowThisFunc(("mName={% ls}\n", aSessionMachine->mUserData->mName.raw()));928 LogFlowThisFunc(("mName={%s}\n", aSessionMachine->mUserData->s.strName.c_str())); 929 929 930 930 AssertReturn(aSessionMachine && !Guid(aSnapshotId).isEmpty(), E_INVALIDARG); … … 1061 1061 { 1062 1062 LogFlowThisFuncEnter(); 1063 LogFlowThisFunc(("mName={% ls}\n", aMachine->mUserData->mName.raw()));1063 LogFlowThisFunc(("mName={%s}\n", aMachine->mUserData->s.strName.c_str())); 1064 1064 1065 1065 AssertReturn(aMachine && !Guid(aSnapshotId).isEmpty(), E_INVALIDARG); … … 1388 1388 || mData->mMachineState == MachineState_Saved) 1389 1389 { 1390 strStateFilePath = Utf8StrFmt("% ls%c{%RTuuid}.sav",1391 mUserData->m SnapshotFolderFull.raw(),1390 strStateFilePath = Utf8StrFmt("%s%c{%RTuuid}.sav", 1391 mUserData->m_strSnapshotFolderFull.c_str(), 1392 1392 RTPATH_DELIMITER, 1393 1393 snapshotId.ptr()); … … 1450 1450 1451 1451 LogFlowThisFunc(("Copying the execution state from '%s' to '%s'...\n", 1452 stateFrom. raw(), stateTo.raw()));1452 stateFrom.c_str(), stateTo.c_str())); 1453 1453 1454 1454 aConsoleProgress->SetNextOperation(Bstr(tr("Copying the execution state")), … … 1471 1471 throw setError(E_FAIL, 1472 1472 tr("Could not copy the state file '%s' to '%s' (%Rrc)"), 1473 stateFrom. raw(),1474 stateTo. raw(),1473 stateFrom.c_str(), 1474 stateTo.c_str(), 1475 1475 vrc); 1476 1476 } … … 1702 1702 ulStateFileSizeMB = (ULONG)(ullSize / _1M); 1703 1703 LogFlowThisFunc(("op %d: saved state file '%s' has %RI64 bytes (%d MB)\n", 1704 ulOpCount, pSnapshot->stateFilePath(). raw(), ullSize, ulStateFileSizeMB));1704 ulOpCount, pSnapshot->stateFilePath().c_str(), ullSize, ulStateFileSizeMB)); 1705 1705 1706 1706 ulTotalWeight += ulStateFileSizeMB; … … 1857 1857 Utf8Str snapStateFilePath = aTask.pSnapshot->stateFilePath(); 1858 1858 1859 Utf8Str stateFilePath = Utf8StrFmt("% ls%c{%RTuuid}.sav",1860 mUserData->m SnapshotFolderFull.raw(),1859 Utf8Str stateFilePath = Utf8StrFmt("%s%c{%RTuuid}.sav", 1860 mUserData->m_strSnapshotFolderFull.c_str(), 1861 1861 RTPATH_DELIMITER, 1862 1862 mData->mUuid.raw()); 1863 1863 1864 1864 LogFlowThisFunc(("Copying saved state file from '%s' to '%s'...\n", 1865 snapStateFilePath. raw(), stateFilePath.raw()));1865 snapStateFilePath.c_str(), stateFilePath.c_str())); 1866 1866 1867 1867 aTask.pProgress->SetNextOperation(Bstr(tr("Restoring the execution state")), … … 1888 1888 throw setError(E_FAIL, 1889 1889 tr("Could not copy the state file '%s' to '%s' (%Rrc)"), 1890 snapStateFilePath. raw(),1891 stateFilePath. raw(),1890 snapStateFilePath.c_str(), 1891 stateFilePath.c_str(), 1892 1892 vrc); 1893 1893 } … … 1917 1917 ) 1918 1918 { 1919 LogFlowThisFunc(("Picked differencing image '%s' for deletion\n", pMedium->getName(). raw()));1919 LogFlowThisFunc(("Picked differencing image '%s' for deletion\n", pMedium->getName().c_str())); 1920 1920 1921 1921 llDiffAttachmentsToDelete.push_back(pAttach); … … 1953 1953 AutoWriteLock mlock(pMedium COMMA_LOCKVAL_SRC_POS); 1954 1954 1955 LogFlowThisFunc(("Detaching old current state in differencing image '%s'\n", pMedium->getName(). raw()));1955 LogFlowThisFunc(("Detaching old current state in differencing image '%s'\n", pMedium->getName().c_str())); 1956 1956 1957 1957 // Normally we "detach" the medium by removing the attachment object … … 1986 1986 { 1987 1987 ComObjPtr<Medium> &pMedium = *it; 1988 LogFlowThisFunc(("Deleting old current state in differencing image '%s'\n", pMedium->getName(). raw()));1988 LogFlowThisFunc(("Deleting old current state in differencing image '%s'\n", pMedium->getName().c_str())); 1989 1989 1990 1990 HRESULT rc2 = pMedium->deleteStorage(NULL /* aProgress */, … … 2094 2094 if (childrenCount > 1) 2095 2095 return setError(VBOX_E_INVALID_OBJECT_STATE, 2096 tr("Snapshot '%s' of the machine '% ls' cannot be deleted. because it has %d child snapshots, which is more than the one snapshot allowed for deletion"),2096 tr("Snapshot '%s' of the machine '%s' cannot be deleted. because it has %d child snapshots, which is more than the one snapshot allowed for deletion"), 2097 2097 pSnapshot->getName().c_str(), 2098 mUserData-> mName.raw(),2098 mUserData->s.strName.c_str(), 2099 2099 childrenCount); 2100 2100 … … 2536 2536 2537 2537 aTask.pProgress->SetNextOperation(BstrFmt(tr("Merging differencing image '%s'"), 2538 pMedium->getName(). raw()),2538 pMedium->getName().c_str()), 2539 2539 ulWeight); 2540 2540 … … 2582 2582 tr("Snapshot '%s' of the machine '%ls' cannot be deleted while a VM is running, as this case is not implemented yet. You can delete the snapshot when the VM is powered off"), 2583 2583 aTask.pSnapshot->getName().c_str(), 2584 mUserData-> mName.raw());2584 mUserData->s.strName.c_str()); 2585 2585 2586 2586 // online medium merge, in the direction decided earlier … … 2628 2628 const Utf8Str &loc = it->mpSource->getLocationFull(); 2629 2629 // Source medium is still there, so merge failed early. 2630 if (RTFileExists(loc. raw()))2630 if (RTFileExists(loc.c_str())) 2631 2631 throw rc; 2632 2632 … … 2870 2870 return setError(E_FAIL, 2871 2871 tr("Hard disk '%s' has more than one child hard disk (%d)"), 2872 aHD->getLocationFull(). raw(),2872 aHD->getLocationFull().c_str(), 2873 2873 aHD->getChildren().size()); 2874 2874 … … 2985 2985 rc = setError(rc, 2986 2986 tr("Cannot lock hard disk '%s' for a live merge"), 2987 aHD->getLocationFull(). raw());2987 aHD->getLocationFull().c_str()); 2988 2988 } 2989 2989 else … … 2999 2999 rc = setError(rc, 3000 3000 tr("Failed to construct lock list for a live merge of hard disk '%s'"), 3001 aHD->getLocationFull(). raw());3001 aHD->getLocationFull().c_str()); 3002 3002 } 3003 3003 … … 3028 3028 rc = setError(rc, 3029 3029 tr("Cannot lock hard disk '%s' for an offline merge"), 3030 aHD->getLocationFull(). raw());3030 aHD->getLocationFull().c_str()); 3031 3031 } 3032 3032 } -
trunk/src/VBox/Main/StorageControllerImpl.cpp
r31328 r31539 127 127 { 128 128 LogFlowThisFunc(("aParent=%p aName=\"%s\" aInstance=%u\n", 129 aParent, aName. raw(), aInstance));129 aParent, aName.c_str(), aInstance)); 130 130 131 131 ComAssertRet(aParent && !aName.isEmpty(), E_INVALIDARG); -
trunk/src/VBox/Main/SystemPropertiesImpl.cpp
r31358 r31539 868 868 return setError(E_FAIL, 869 869 tr("Invalid default machine folder '%s' (%Rrc)"), 870 path. raw(),870 path.c_str(), 871 871 vrc); 872 872 … … 889 889 return setError(E_FAIL, 890 890 tr("Invalid default hard disk folder '%s' (%Rrc)"), 891 path. raw(),891 path.c_str(), 892 892 vrc); 893 893 -
trunk/src/VBox/Main/USBControllerImpl.cpp
r30856 r31539 59 59 struct USBController::Data 60 60 { 61 Data() 62 : pParent(NULL) 63 {}; 61 Data(Machine *pMachine) 62 : pParent(pMachine), 63 pHost(pMachine->getVirtualBox()->host()) 64 { } 64 65 65 66 ~Data() 66 67 {}; 67 68 68 /** Parent object. */69 69 Machine * const pParent; 70 /** Peer object. */ 70 Host * const pHost; 71 72 // peer machine's USB controller 71 73 const ComObjPtr<USBController> pPeer; 72 74 … … 115 117 AssertReturn(autoInitSpan.isOk(), E_FAIL); 116 118 117 m = new Data(); 118 119 unconst(m->pParent) = aParent; 119 m = new Data(aParent); 120 120 121 /* mPeer is left null */ 121 122 … … 153 154 AssertReturn(autoInitSpan.isOk(), E_FAIL); 154 155 155 m = new Data(); 156 157 unconst(m->pParent) = aParent; 156 m = new Data(aParent); 157 158 158 unconst(m->pPeer) = aPeer; 159 159 … … 197 197 AssertReturn(autoInitSpan.isOk(), E_FAIL); 198 198 199 m = new Data(); 200 201 unconst(m->pParent) = aParent; 199 m = new Data(aParent); 200 202 201 /* mPeer is left null */ 203 202 … … 537 536 if (filter->getData().mActive && Global::IsOnline(adep.machineState())) 538 537 { 539 USBProxyService *service = m->p Parent->getVirtualBox()->host()->usbProxyService();538 USBProxyService *service = m->pHost->usbProxyService(); 540 539 ComAssertRet(service, E_FAIL); 541 540 … … 608 607 if (filter->getData().mActive && Global::IsOnline(adep.machineState())) 609 608 { 610 USBProxyService *service = m->p Parent->getVirtualBox()->host()->usbProxyService();609 USBProxyService *service = m->pHost->usbProxyService(); 611 610 ComAssertRet(service, E_FAIL); 612 611 … … 756 755 if (m->llDeviceFilters.isBackedUp()) 757 756 { 758 USBProxyService *service = m->p Parent->getVirtualBox()->host()->usbProxyService();757 USBProxyService *service = m->pHost->usbProxyService(); 759 758 Assert(service); 760 759 … … 1007 1006 /* we don't modify our data fields -- no need to lock */ 1008 1007 1009 if (aFilter->mInList && m->pParent->isRegistered()) 1010 { 1011 USBProxyService *service = m->pParent->getVirtualBox()->host()->usbProxyService(); 1008 if ( aFilter->mInList 1009 && m->pParent->isRegistered()) 1010 { 1011 USBProxyService *service = m->pHost->usbProxyService(); 1012 1012 ComAssertRet(service, E_FAIL); 1013 1013 … … 1201 1201 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1202 1202 1203 USBProxyService *service = m->p Parent->getVirtualBox()->host()->usbProxyService();1203 USBProxyService *service = m->pHost->usbProxyService(); 1204 1204 AssertReturn(service, E_FAIL); 1205 1205 -
trunk/src/VBox/Main/VFSExplorerImpl.cpp
r30716 r31539 536 536 { 537 537 Bstr progressDesc = BstrFmt(tr("Update directory info for '%s'"), 538 m->strPath. raw());538 m->strPath.c_str()); 539 539 /* Create the progress object */ 540 540 progress.createObject(); 541 541 542 rc = progress->init(mVirtualBox, static_cast<IVFSExplorer*>(this), 542 rc = progress->init(mVirtualBox, 543 static_cast<IVFSExplorer*>(this), 543 544 progressDesc, 544 545 TRUE /* aCancelable */); -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r31482 r31539 387 387 /* compose the VirtualBox.xml file name */ 388 388 unconst(m->strSettingsFilePath) = Utf8StrFmt("%s%c%s", 389 m->strHomeDir.raw(),390 RTPATH_DELIMITER,391 VBOX_GLOBAL_SETTINGS_FILE);389 m->strHomeDir.c_str(), 390 RTPATH_DELIMITER, 391 VBOX_GLOBAL_SETTINGS_FILE); 392 392 HRESULT rc = S_OK; 393 393 bool fCreate = false; … … 1073 1073 firmwareDesc[i].fileName); 1074 1074 rc = calculateFullPath(shortName, fullName); AssertRCReturn(rc, rc); 1075 if (RTFileExists(fullName. raw()))1075 if (RTFileExists(fullName.c_str())) 1076 1076 { 1077 1077 *aResult = TRUE; … … 1087 1087 RTPATH_DELIMITER, 1088 1088 firmwareDesc[i].fileName); 1089 if (RTFileExists(fullName. raw()))1089 if (RTFileExists(fullName.c_str())) 1090 1090 { 1091 1091 *aResult = TRUE; … … 1142 1142 1143 1143 strSettingsFile = Utf8StrFmt("%s%c%ls%c%ls.xml", 1144 strSettingsFile. raw(),1144 strSettingsFile.c_str(), 1145 1145 RTPATH_DELIMITER, 1146 1146 aName, … … 1203 1203 /* append the default extension if none */ 1204 1204 if (!RTPathHaveExt(settingsFile.c_str())) 1205 settingsFile = Utf8StrFmt("%s.xml", settingsFile. raw());1205 settingsFile = Utf8StrFmt("%s.xml", settingsFile.c_str()); 1206 1206 1207 1207 /* create a new object */ … … 1331 1331 /* start with not found */ 1332 1332 ComObjPtr<Machine> pMachineFound; 1333 Utf8Str strName(aName); 1333 1334 1334 1335 AutoReadLock al(m->allMachines.getLockHandle() COMMA_LOCKVAL_SRC_POS); … … 1344 1345 1345 1346 AutoReadLock machLock(pMachine2 COMMA_LOCKVAL_SRC_POS); 1346 if (pMachine2->getName() == aName)1347 if (pMachine2->getName() == strName) 1347 1348 { 1348 1349 pMachineFound = pMachine2; … … 2362 2363 { 2363 2364 LogFlowThisFunc(("machine={%s} aKey={%ls} aValue={%ls}\n", 2364 aId.toString(). raw(), aKey, aValue));2365 aId.toString().c_str(), aKey, aValue)); 2365 2366 2366 2367 AutoCaller autoCaller(this); … … 2765 2766 tr("Could not find a hard disk with UUID {%RTuuid} in the media registry ('%s')"), 2766 2767 aId->raw(), 2767 m->strSettingsFilePath. raw());2768 m->strSettingsFilePath.c_str()); 2768 2769 else 2769 2770 setError(rc, 2770 2771 tr("Could not find a hard disk with location '%ls' in the media registry ('%s')"), 2771 2772 aLocation, 2772 m->strSettingsFilePath. raw());2773 m->strSettingsFilePath.c_str()); 2773 2774 } 2774 2775 … … 2872 2873 tr("Could not find an image file with UUID {%RTuuid} in the media registry ('%s')"), 2873 2874 aId->raw(), 2874 m->strSettingsFilePath. raw());2875 m->strSettingsFilePath.c_str()); 2875 2876 else 2876 2877 setError(rc, 2877 2878 tr("Could not find an image file with location '%ls' in the media registry ('%s')"), 2878 2879 aLocation.c_str(), 2879 m->strSettingsFilePath. raw());2880 m->strSettingsFilePath.c_str()); 2880 2881 } 2881 2882 … … 3102 3103 AutoReadLock mediaLock(hardDisk COMMA_LOCKVAL_SRC_POS); 3103 3104 aConflict = Utf8StrFmt(tr("hard disk '%s' with UUID {%RTuuid}"), 3104 hardDisk->getLocationFull(). raw(),3105 hardDisk->getLocationFull().c_str(), 3105 3106 hardDisk->getId().raw()); 3106 3107 return S_OK; … … 3116 3117 AutoReadLock mediaLock(image COMMA_LOCKVAL_SRC_POS); 3117 3118 aConflict = Utf8StrFmt(tr("CD/DVD image '%s' with UUID {%RTuuid}"), 3118 image->getLocationFull(). raw(),3119 image->getLocationFull().c_str(), 3119 3120 image->getId().raw()); 3120 3121 return S_OK; … … 3130 3131 AutoReadLock mediaLock(image COMMA_LOCKVAL_SRC_POS); 3131 3132 aConflict = Utf8StrFmt(tr("floppy image '%s' with UUID {%RTuuid}"), 3132 image->getLocationFull(). raw(),3133 image->getLocationFull().c_str(), 3133 3134 image->getId().raw()); 3134 3135 return S_OK; … … 3352 3353 3353 3354 return setError(E_INVALIDARG, 3354 tr("Registered machine with UUID {%RTuuid} ('% ls') already exists"),3355 tr("Registered machine with UUID {%RTuuid} ('%s') already exists"), 3355 3356 aMachine->getId().raw(), 3356 pMachine->getSettingsFileFull(). raw());3357 pMachine->getSettingsFileFull().c_str()); 3357 3358 } 3358 3359 … … 3420 3421 return setError(E_INVALIDARG, 3421 3422 tr("Cannot register the hard disk '%s' with UUID {%RTuuid} because a %s already exists in the media registry ('%s')"), 3422 strLocationFull. raw(),3423 strLocationFull.c_str(), 3423 3424 id.raw(), 3424 strConflict. raw(),3425 m->strSettingsFilePath. raw());3425 strConflict.c_str(), 3426 m->strSettingsFilePath.c_str()); 3426 3427 3427 3428 // store base (root) hard disks in the list … … 3537 3538 return setError(VBOX_E_INVALID_OBJECT_STATE, 3538 3539 tr("Cannot register the image '%s' with UUID {%RTuuid} because a %s already exists in the media registry ('%s')"), 3539 strLocationFull. raw(),3540 strLocationFull.c_str(), 3540 3541 id.raw(), 3541 strConflict. raw(),3542 m->strSettingsFilePath. raw());3542 strConflict.c_str(), 3543 m->strSettingsFilePath.c_str()); 3543 3544 3544 3545 // add to the collection -
trunk/src/VBox/Main/include/ConsoleImpl.h
r31332 r31539 229 229 230 230 static HRESULT setErrorStatic(HRESULT aResultCode, const char *pcsz, ...); 231 HRESULT setAuthLibraryError(const char *filename, int rc);232 231 HRESULT setInvalidMachineStateError(); 233 232 -
trunk/src/VBox/Main/include/MachineImpl.h
r31333 r31539 214 214 struct UserData 215 215 { 216 UserData(); 217 ~UserData(); 218 219 Bstr mName; 220 BOOL mNameSync; 221 Bstr mDescription; 222 Bstr mOSTypeId; 223 Bstr mSnapshotFolder; 224 Bstr mSnapshotFolderFull; 225 BOOL mTeleporterEnabled; 226 ULONG mTeleporterPort; 227 Bstr mTeleporterAddress; 228 Bstr mTeleporterPassword; 229 BOOL mRTCUseUTC; 216 settings::MachineUserData s; 217 Utf8Str m_strSnapshotFolderFull; 230 218 }; 231 219 … … 592 580 * for reading. 593 581 */ 594 const Bstr& getName() const { return mUserData->mName; }582 const Utf8Str& getName() const { return mUserData->s.strName; } 595 583 596 584 enum -
trunk/src/VBox/Main/include/SnapshotImpl.h
r31333 r31539 116 116 ComObjPtr<Snapshot> findChildOrSelf(const Utf8Str &aName); 117 117 118 void updateSavedStatePaths(const char *aOldPath,119 const char *aNewPath);120 void updateSavedStatePathsImpl(const char *aOldPath,121 const char *aNewPath);118 void updateSavedStatePaths(const Utf8Str &strOldPath, 119 const Utf8Str &strNewPath); 120 void updateSavedStatePathsImpl(const Utf8Str &strOldPath, 121 const Utf8Str &strNewPath); 122 122 123 123 HRESULT saveSnapshot(settings::Snapshot &data, bool aAttrsOnly); -
trunk/src/VBox/Main/include/VirtualBoxBase.h
r30782 r31539 343 343 if (RT_UNLIKELY(!(expr))) \ 344 344 return setError(E_INVALIDARG, tr ("Argument %s %s"), \ 345 #arg, Utf8StrFmt msg . raw()); \345 #arg, Utf8StrFmt msg .c_str()); \ 346 346 } while (0) 347 347 -
trunk/src/VBox/Main/include/netif.h
r29250 r31539 147 147 /* Get the index from the name */ 148 148 int iInstance; 149 if (sscanf(Utf8Str(bstrIfName). raw(), "vboxnet%d", &iInstance) != 1)149 if (sscanf(Utf8Str(bstrIfName).c_str(), "vboxnet%d", &iInstance) != 1) 150 150 return Bstr("0.0.0.0"); 151 151 -
trunk/src/VBox/Main/webservice/vboxweb.cpp
r31231 r31539 205 205 pcszDescr = "Maximum number of worker threads to run in parallel (100)."; 206 206 break; 207 207 208 208 case 'k': 209 209 pcszDescr = "Maximum number of requests before a socket will be closed (100)."; … … 931 931 { 932 932 com::Utf8Str ustr(bstr); 933 const char *pcsz; 934 if ((pcsz = ustr.raw())) 935 return pcsz; 936 return ""; 933 return ustr.c_str(); // @todo r=dj since the length is known, we can probably use a better std::string allocator 937 934 } 938 935 … … 946 943 { 947 944 com::Utf8Str ustr(uuid.toString()); 948 const char *pcsz; 949 if ((pcsz = ustr.raw())) 950 return pcsz; 951 return ""; 945 return ustr.c_str(); // @todo r=dj since the length is known, we can probably use a better std::string allocator 952 946 } 953 947 … … 1163 1157 do 1164 1158 { 1165 rc = RTLdrLoad(filename. raw(), &hlibAuth);1159 rc = RTLdrLoad(filename.c_str(), &hlibAuth); 1166 1160 if (RT_FAILURE(rc)) 1167 1161 { … … 1645 1639 WEBDEBUG(("-- entering %s\n", __FUNCTION__)); 1646 1640 1647 do 1641 do 1648 1642 { 1649 1643 // WebServiceSession constructor tinkers with global MOR map and requires a write lock -
trunk/src/VBox/Main/xml/Settings.cpp
r31481 r31539 1718 1718 MachineConfigFile::MachineConfigFile(const Utf8Str *pstrFilename) 1719 1719 : ConfigFileBase(pstrFilename), 1720 fNameSync(true),1721 fTeleporterEnabled(false),1722 uTeleporterPort(0),1723 fRTCUseUTC(false),1724 1720 fCurrentStateModified(true), 1725 1721 fAborted(false) … … 1778 1774 return ( (this == &c) 1779 1775 || ( (uuid == c.uuid) 1780 && (strName == c.strName) 1781 && (fNameSync == c.fNameSync) 1782 && (strDescription == c.strDescription) 1783 && (strOsType == c.strOsType) 1776 && (machineUserData == c.machineUserData) 1784 1777 && (strStateFile == c.strStateFile) 1785 1778 && (uuidCurrentSnapshot == c.uuidCurrentSnapshot) 1786 && (strSnapshotFolder == c.strSnapshotFolder)1787 && (fTeleporterEnabled == c.fTeleporterEnabled)1788 && (uTeleporterPort == c.uTeleporterPort)1789 && (strTeleporterAddress == c.strTeleporterAddress)1790 && (strTeleporterPassword == c.strTeleporterPassword)1791 && (fRTCUseUTC == c.fRTCUseUTC)1792 1779 // skip fCurrentStateModified! 1793 1780 && (RTTimeSpecIsEqual(&timeLastStateChange, &c.timeLastStateChange)) … … 2536 2523 { 2537 2524 Utf8Str strLocalOrUTC; 2538 fRTCUseUTC = pelmHwChild->getAttributeValue("localOrUTC", strLocalOrUTC)2539 && strLocalOrUTC == "UTC";2525 machineUserData.fRTCUseUTC = pelmHwChild->getAttributeValue("localOrUTC", strLocalOrUTC) 2526 && strLocalOrUTC == "UTC"; 2540 2527 } 2541 2528 else if ( (pelmHwChild->nameEquals("UART")) … … 3049 3036 Utf8Str strUUID; 3050 3037 if ( (elmMachine.getAttributeValue("uuid", strUUID)) 3051 && (elmMachine.getAttributeValue("name", strName))3038 && (elmMachine.getAttributeValue("name", machineUserData.strName)) 3052 3039 ) 3053 3040 { 3054 3041 parseUUID(uuid, strUUID); 3055 3042 3056 if (!elmMachine.getAttributeValue("nameSync", fNameSync)) 3057 fNameSync = true; 3043 elmMachine.getAttributeValue("nameSync", machineUserData.fNameSync); 3058 3044 3059 3045 Utf8Str str; 3060 elmMachine.getAttributeValue("Description", strDescription);3061 3062 elmMachine.getAttributeValue("OSType", strOsType);3046 elmMachine.getAttributeValue("Description", machineUserData.strDescription); 3047 3048 elmMachine.getAttributeValue("OSType", machineUserData.strOsType); 3063 3049 if (m->sv < SettingsVersion_v1_5) 3064 convertOldOSType_pre1_5( strOsType);3050 convertOldOSType_pre1_5(machineUserData.strOsType); 3065 3051 3066 3052 elmMachine.getAttributeValue("stateFile", strStateFile); 3067 3053 if (elmMachine.getAttributeValue("currentSnapshot", str)) 3068 3054 parseUUID(uuidCurrentSnapshot, str); 3069 elmMachine.getAttributeValue("snapshotFolder", strSnapshotFolder);3055 elmMachine.getAttributeValue("snapshotFolder", machineUserData.strSnapshotFolder); 3070 3056 if (!elmMachine.getAttributeValue("currentStateModified", fCurrentStateModified)) 3071 3057 fCurrentStateModified = true; … … 3103 3089 } 3104 3090 else if (pelmMachineChild->nameEquals("Description")) 3105 strDescription = pelmMachineChild->getValue();3091 machineUserData.strDescription = pelmMachineChild->getValue(); 3106 3092 else if (pelmMachineChild->nameEquals("Teleporter")) 3107 3093 { 3108 if (!pelmMachineChild->getAttributeValue("enabled", fTeleporterEnabled)) 3109 fTeleporterEnabled = false; 3110 if (!pelmMachineChild->getAttributeValue("port", uTeleporterPort)) 3111 uTeleporterPort = 0; 3112 if (!pelmMachineChild->getAttributeValue("address", strTeleporterAddress)) 3113 strTeleporterAddress = ""; 3114 if (!pelmMachineChild->getAttributeValue("password", strTeleporterPassword)) 3115 strTeleporterPassword = ""; 3094 pelmMachineChild->getAttributeValue("enabled", machineUserData.fTeleporterEnabled); 3095 pelmMachineChild->getAttributeValue("port", machineUserData.uTeleporterPort); 3096 pelmMachineChild->getAttributeValue("address", machineUserData.strTeleporterAddress); 3097 pelmMachineChild->getAttributeValue("password", machineUserData.strTeleporterPassword); 3116 3098 } 3117 3099 } … … 3574 3556 { 3575 3557 xml::ElementNode *pelmRTC = pelmHardware->createChild("RTC"); 3576 pelmRTC->setAttribute("localOrUTC", fRTCUseUTC ? "UTC" : "local");3558 pelmRTC->setAttribute("localOrUTC", machineUserData.fRTCUseUTC ? "UTC" : "local"); 3577 3559 } 3578 3560 … … 3782 3764 3783 3765 xml::ElementNode *pelmController = pelmStorageControllers->createChild("StorageController"); 3784 com::Utf8Str name = sc.strName.raw(); 3785 // 3766 com::Utf8Str name = sc.strName; 3786 3767 if (m->sv < SettingsVersion_v1_8) 3787 3768 { … … 3984 3965 3985 3966 elmMachine.setAttribute("uuid", uuid.toStringCurly()); 3986 elmMachine.setAttribute("name", strName);3987 if (! fNameSync)3988 elmMachine.setAttribute("nameSync", fNameSync);3989 if ( strDescription.length())3990 elmMachine.createChild("Description")->addContent( strDescription);3991 elmMachine.setAttribute("OSType", strOsType);3967 elmMachine.setAttribute("name", machineUserData.strName); 3968 if (!machineUserData.fNameSync) 3969 elmMachine.setAttribute("nameSync", machineUserData.fNameSync); 3970 if (machineUserData.strDescription.length()) 3971 elmMachine.createChild("Description")->addContent(machineUserData.strDescription); 3972 elmMachine.setAttribute("OSType", machineUserData.strOsType); 3992 3973 if (strStateFile.length()) 3993 3974 elmMachine.setAttribute("stateFile", strStateFile); … … 3995 3976 && !uuidCurrentSnapshot.isEmpty()) 3996 3977 elmMachine.setAttribute("currentSnapshot", uuidCurrentSnapshot.toStringCurly()); 3997 if ( strSnapshotFolder.length())3998 elmMachine.setAttribute("snapshotFolder", strSnapshotFolder);3978 if (machineUserData.strSnapshotFolder.length()) 3979 elmMachine.setAttribute("snapshotFolder", machineUserData.strSnapshotFolder); 3999 3980 if (!fCurrentStateModified) 4000 3981 elmMachine.setAttribute("currentStateModified", fCurrentStateModified); … … 4003 3984 elmMachine.setAttribute("aborted", fAborted); 4004 3985 if ( m->sv >= SettingsVersion_v1_9 4005 && ( fTeleporterEnabled4006 || uTeleporterPort4007 || ! strTeleporterAddress.isEmpty()4008 || ! strTeleporterPassword.isEmpty()3986 && ( machineUserData.fTeleporterEnabled 3987 || machineUserData.uTeleporterPort 3988 || !machineUserData.strTeleporterAddress.isEmpty() 3989 || !machineUserData.strTeleporterPassword.isEmpty() 4009 3990 ) 4010 3991 ) 4011 3992 { 4012 3993 xml::ElementNode *pelmTeleporter = elmMachine.createChild("Teleporter"); 4013 pelmTeleporter->setAttribute("enabled", fTeleporterEnabled);4014 pelmTeleporter->setAttribute("port", uTeleporterPort);4015 pelmTeleporter->setAttribute("address", strTeleporterAddress);4016 pelmTeleporter->setAttribute("password", strTeleporterPassword);3994 pelmTeleporter->setAttribute("enabled", machineUserData.fTeleporterEnabled); 3995 pelmTeleporter->setAttribute("port", machineUserData.uTeleporterPort); 3996 pelmTeleporter->setAttribute("address", machineUserData.strTeleporterAddress); 3997 pelmTeleporter->setAttribute("password", machineUserData.strTeleporterPassword); 4017 3998 } 4018 3999 … … 4244 4225 || (hardwareMachine.fPageFusionEnabled) 4245 4226 // and CPU hotplug, RTC timezone control, HID type and HPET 4246 || fRTCUseUTC4227 || machineUserData.fRTCUseUTC 4247 4228 || hardwareMachine.fCpuHotPlug 4248 4229 || hardwareMachine.pointingHidType != PointingHidType_PS2Mouse … … 4308 4289 && ( (hardwareMachine.firmwareType >= FirmwareType_EFI) 4309 4290 || (hardwareMachine.fHardwareVirtExclusive != HWVIRTEXCLUSIVEDEFAULT) 4310 || fTeleporterEnabled4311 || uTeleporterPort4312 || ! strTeleporterAddress.isEmpty()4313 || ! strTeleporterPassword.isEmpty()4291 || machineUserData.fTeleporterEnabled 4292 || machineUserData.uTeleporterPort 4293 || !machineUserData.strTeleporterAddress.isEmpty() 4294 || !machineUserData.strTeleporterPassword.isEmpty() 4314 4295 || !hardwareMachine.uuid.isEmpty() 4315 4296 )
Note:
See TracChangeset
for help on using the changeset viewer.