Changeset 37522 in vbox
- Timestamp:
- Jun 17, 2011 7:26:09 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp
r37521 r37522 399 399 /* 400 400 * Todo: 401 * - Regardless where the old media comes from (e.g. snapshots folder) it402 * goes to the new main VM folder. Maybe we like to be a little bit403 * smarter here.404 401 * - Snapshot diffs (can) have the uuid as name. After cloning this isn't 405 402 * right anymore. Is it worth to change to the new uuid? Or should the … … 470 467 if (FAILED(rc)) throw rc; 471 468 /* The absolute name of the snapshot folder. */ 472 strTrgSnapshotFolder = Utf8StrFmt("%s%c%s %c", strTrgMachineFolder.c_str(), RTPATH_DELIMITER, trgMCF.machineUserData.strSnapshotFolder.c_str(), RTPATH_DELIMITER);469 strTrgSnapshotFolder = Utf8StrFmt("%s%c%s", strTrgMachineFolder.c_str(), RTPATH_DELIMITER, trgMCF.machineUserData.strSnapshotFolder.c_str()); 473 470 474 471 /* We need to create a map with the already created medias. This is … … 529 526 if (FAILED(rc)) throw rc; 530 527 528 /* Check if this medium comes from the snapshot folder, if 529 * so, put it there in the cloned machine as well. 530 * Otherwise it goes to the machine folder. */ 531 531 Utf8Str strFile = Utf8StrFmt("%s%c%lS", strTrgMachineFolder.c_str(), RTPATH_DELIMITER, bstrSrcName.raw()); 532 Bstr bstrSrcPath; 533 rc = pMedium->COMGETTER(Location)(bstrSrcPath.asOutParam()); 534 if (FAILED(rc)) throw rc; 535 if ( !bstrSrcPath.isEmpty() 536 && RTPathStartsWith(Utf8Str(bstrSrcPath).c_str(), Utf8Str(bstrSrcSnapshotFolder).c_str())) 537 strFile = Utf8StrFmt("%s%c%lS", strTrgSnapshotFolder.c_str(), RTPATH_DELIMITER, bstrSrcName.raw()); 538 else 539 strFile = Utf8StrFmt("%s%c%lS", strTrgMachineFolder.c_str(), RTPATH_DELIMITER, bstrSrcName.raw()); 540 532 541 rc = pTarget->init(p->mParent, 533 542 Utf8Str(bstrSrcFormat), … … 584 593 rc = diff->init(p->mParent, 585 594 pNewParent->getPreferredDiffFormat(), 586 strTrgSnapshotFolder,595 Utf8StrFmt("%s%c", strTrgSnapshotFolder.c_str(), RTPATH_DELIMITER), 587 596 d->pTrgMachine->mData->mUuid, 588 597 NULL); // pllRegistriesThatNeedSaving … … 621 630 { 622 631 SAVESTATETASK sst = d->llSaveStateFiles.at(i); 623 const Utf8Str &strTrgSaveState = Utf8StrFmt("%s% s", strTrgSnapshotFolder.c_str(), RTPathFilename(sst.strSaveStateFile.c_str()));632 const Utf8Str &strTrgSaveState = Utf8StrFmt("%s%c%s", strTrgSnapshotFolder.c_str(), RTPATH_DELIMITER, RTPathFilename(sst.strSaveStateFile.c_str())); 624 633 625 634 /* Move to next sub-operation. */
Note:
See TracChangeset
for help on using the changeset viewer.