Changeset 37603 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jun 23, 2011 8:18:49 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp
r37590 r37603 580 580 if (FAILED(rc)) throw rc; 581 581 582 Bstr bstrSrcFormat = "VDI"; 582 /* Default format? */ 583 Utf8Str strDefaultFormat; 584 p->mParent->getDefaultHardDiskFormat(strDefaultFormat); 585 Bstr bstrSrcFormat(strDefaultFormat); 583 586 ULONG srcVar = MediumVariant_Standard; 584 587 /* Is the source file based? */ … … 614 617 Utf8Str(bstrSrcFormat), 615 618 strFile, 616 Guid (), /* empty media registry */617 NULL /* llRegistriesThatNeedSaving */);619 Guid::Empty, /* empty media registry */ 620 NULL /* llRegistriesThatNeedSaving */); 618 621 if (FAILED(rc)) throw rc; 619 622 … … 643 646 throw p->setError(iRc, Utf8Str(info.getText()).c_str()); 644 647 } 645 648 /* Remember created medias. */ 649 newMedias.append(pTarget); 646 650 /* Get the medium type from the source and set it to the 647 651 * new medium. */ … … 652 656 if (FAILED(rc)) throw rc; 653 657 map.insert(TStrMediumPair(Utf8Str(bstrSrcId), pTarget)); 654 655 /* Remember created medias. */656 newMedias.append(pTarget);658 /* Global register the new harddisk */ 659 rc = p->mParent->registerHardDisk(pTarget, NULL /* pllRegistriesThatNeedSaving */); 660 if (FAILED(rc)) return rc; 657 661 /* This medium becomes the parent of the next medium in the 658 662 * chain. */ … … 672 676 pNewParent->getPreferredDiffFormat(), 673 677 Utf8StrFmt("%s%c", strTrgSnapshotFolder.c_str(), RTPATH_DELIMITER), 674 Guid (), /* empty media registry */675 NULL); /* pllRegistriesThatNeedSaving */678 Guid::Empty, /* empty media registry */ 679 NULL); /* pllRegistriesThatNeedSaving */ 676 680 if (FAILED(rc)) throw rc; 677 681 MediumLockList *pMediumLockList(new MediumLockList()); … … 690 694 delete pMediumLockList; 691 695 if (FAILED(rc)) throw rc; 696 /* Remember created medias. */ 697 newMedias.append(diff); 698 /* Global register the new harddisk */ 699 rc = p->mParent->registerHardDisk(diff, NULL /* pllRegistriesThatNeedSaving */); 700 if (FAILED(rc)) return rc; 701 /* This medium becomes the parent of the next medium in the 702 * chain. */ 692 703 pNewParent = diff; 693 newMedias.append(diff);694 704 } 695 705 Bstr bstrSrcId; … … 703 713 d->updateStorageLists(trgMCF.storageMachine.llStorageControllers, bstrSrcId, bstrTrgId); 704 714 d->updateSnapshotStorageLists(trgMCF.llFirstSnapshot, bstrSrcId, bstrTrgId); 705 /* Make sure all disks know of the new machine uuid. We do this706 * last to be able to change the medium type above. */707 rc = pNewParent->addRegistry(d->pTrgMachine->mData->mUuid, true /* fRecursive */);715 /* Make sure all parent disks know of the new machine uuid. We do 716 * this last to be able to change the medium type above. */ 717 rc = pNewParent->addRegistry(d->pTrgMachine->mData->mUuid, false /* fRecursive */); 708 718 if (FAILED(rc)) throw rc; 709 719 }
Note:
See TracChangeset
for help on using the changeset viewer.