Changeset 25786 in vbox
- Timestamp:
- Jan 12, 2010 6:01:05 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56544
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r25310 r25786 68 68 struct Appliance::Data 69 69 { 70 71 72 73 74 75 76 77 78 79 80 70 Data() 71 : pReader(NULL) {} 72 73 ~Data() 74 { 75 if (pReader) 76 { 77 delete pReader; 78 pReader = NULL; 79 } 80 } 81 81 82 82 LocationInfo locInfo; /* The location info for the currently processed OVF */ … … 757 757 struct MyHardDiskAttachment 758 758 { 759 Guid uuid;759 Bstr bstrUuid; 760 760 ComPtr<IMachine> pMachine; 761 761 Bstr controllerType; … … 1098 1098 list<MyHardDiskAttachment> llHardDiskAttachments; 1099 1099 list< ComPtr<IMedium> > llHardDisksCreated; 1100 list< Guid> llMachinesRegistered;1100 list<Bstr> llMachinesRegistered; // list of string UUIDs 1101 1101 1102 1102 ComPtr<ISession> session; … … 1109 1109 // if pReader != NULL 1110 1110 1111 /* If an manifest file exists, verify the content. Therefor we need all1111 /* If an manifest file exists, verify the content. Therefore we need all 1112 1112 * files which are referenced by the OVF & the OVF itself */ 1113 1113 Utf8Str strMfFile = manifestFileName(pTask->locInfo.strPath); … … 1507 1507 if (FAILED(rc)) throw rc; 1508 1508 1509 Bstr newMachineId_;1510 rc = pNewMachine->COMGETTER(Id)( newMachineId_.asOutParam());1509 Bstr bstrNewMachineId; 1510 rc = pNewMachine->COMGETTER(Id)(bstrNewMachineId.asOutParam()); 1511 1511 if (FAILED(rc)) throw rc; 1512 Guid newMachineId(newMachineId_);1513 1512 1514 1513 // store new machine for roll-back in case of errors 1515 llMachinesRegistered.push_back( newMachineId);1514 llMachinesRegistered.push_back(bstrNewMachineId); 1516 1515 1517 1516 // Add floppies and CD-ROMs to the appropriate controllers. … … 1532 1531 /* In order to attach things we need to open a session 1533 1532 * for the new machine */ 1534 rc = mVirtualBox->OpenSession(session, newMachineId_);1533 rc = mVirtualBox->OpenSession(session, bstrNewMachineId); 1535 1534 if (FAILED(rc)) throw rc; 1536 1535 fSessionOpen = true; … … 1553 1552 // this is for rollback later 1554 1553 MyHardDiskAttachment mhda; 1555 mhda. uuid = newMachineId;1554 mhda.bstrUuid = bstrNewMachineId; 1556 1555 mhda.pMachine = pNewMachine; 1557 1556 mhda.controllerType = bstrName; … … 1599 1598 // this is for rollback later 1600 1599 MyHardDiskAttachment mhda; 1601 mhda. uuid = newMachineId;1600 mhda.bstrUuid = bstrNewMachineId; 1602 1601 mhda.pMachine = pNewMachine; 1603 1602 … … 1650 1649 /* In order to attach hard disks we need to open a session 1651 1650 * for the new machine */ 1652 rc = mVirtualBox->OpenSession(session, newMachineId_);1651 rc = mVirtualBox->OpenSession(session, bstrNewMachineId); 1653 1652 if (FAILED(rc)) throw rc; 1654 1653 fSessionOpen = true; … … 1786 1785 // this is for rollback later 1787 1786 MyHardDiskAttachment mhda; 1788 mhda. uuid = newMachineId;1787 mhda.bstrUuid = bstrNewMachineId; 1789 1788 mhda.pMachine = pNewMachine; 1790 1789 … … 1851 1850 { 1852 1851 const MyHardDiskAttachment &mhda = *itM; 1853 rc2 = mVirtualBox->OpenSession(session, Bstr(mhda.uuid));1852 rc2 = mVirtualBox->OpenSession(session, mhda.bstrUuid); 1854 1853 if (SUCCEEDED(rc2)) 1855 1854 { … … 1878 1877 1879 1878 // finally, deregister and remove all machines 1880 list< Guid>::iterator itID;1879 list<Bstr>::iterator itID; 1881 1880 for (itID = llMachinesRegistered.begin(); 1882 1881 itID != llMachinesRegistered.end(); 1883 1882 ++itID) 1884 1883 { 1885 const Guid &guid = *itID;1884 const Bstr &bstrGuid = *itID; 1886 1885 ComPtr<IMachine> failedMachine; 1887 rc2 = mVirtualBox->UnregisterMachine( guid.toUtf16(), failedMachine.asOutParam());1886 rc2 = mVirtualBox->UnregisterMachine(bstrGuid, failedMachine.asOutParam()); 1888 1887 if (SUCCEEDED(rc2)) 1889 1888 rc2 = failedMachine->DeleteSettings();
Note:
See TracChangeset
for help on using the changeset viewer.