Changeset 65530 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jan 31, 2017 10:13:27 AM (8 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ApplianceImplPrivate.h
r63184 r65530 236 236 { 237 237 std::map<Utf8Str, const VirtualSystemDescriptionEntry*> mapDisks; 238 std::list<Utf8Str> mapDiskSequence; 238 239 std::map<Utf8Str, bool> mapNetworks; 239 240 }; -
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r65120 r65530 350 350 351 351 Utf8Str strName = Utf8Str(locInfo.strPath).stripPath().stripSuffix(); 352 strTargetImageName = Utf8StrFmt("%s-disk% d.vmdk", strName.c_str(), ++pAppliance->m->cDisks);352 strTargetImageName = Utf8StrFmt("%s-disk%.3d.vmdk", strName.c_str(), ++pAppliance->m->cDisks); 353 353 if (strTargetImageName.length() > RTTAR_NAME_MAX) 354 354 throw setError(VBOX_E_NOT_SUPPORTED, … … 442 442 443 443 Utf8Str strName = Utf8Str(locInfo.strPath).stripPath().stripSuffix(); 444 strTargetImageName = Utf8StrFmt("%s-disk% d.iso", strName.c_str(), ++pAppliance->m->cDisks);444 strTargetImageName = Utf8StrFmt("%s-disk%.3d.iso", strName.c_str(), ++pAppliance->m->cDisks); 445 445 if (strTargetImageName.length() > RTTAR_NAME_MAX) 446 446 throw setError(VBOX_E_NOT_SUPPORTED, … … 936 936 // Finally, write out the disk info 937 937 list<Utf8Str> diskList; 938 map<Utf8Str, const VirtualSystemDescriptionEntry*>::const_iterator itS;939 938 uint32_t ulFile = 1; 940 for (itS = stack.mapDisks.begin(); 941 itS != stack.mapDisks.end(); 939 list<Utf8Str>::const_iterator itS; 940 941 for (itS = stack.mapDiskSequence.begin(); 942 itS != stack.mapDiskSequence.end(); 942 943 ++itS) 943 944 { 944 const Utf8Str &strDiskID = itS->first;945 const VirtualSystemDescriptionEntry *pDiskEntry = itS->second;945 const Utf8Str &strDiskID = *itS; 946 const VirtualSystemDescriptionEntry *pDiskEntry = stack.mapDisks[strDiskID]; 946 947 947 948 // source path: where the VBox image is … … 1019 1020 // <File ovf:href="WindowsXpProfessional-disk1.vmdk" ovf:id="file1" ovf:size="1710381056"/> 1020 1021 xml::ElementNode *pelmFile = pelmReferences->createChild("File"); 1022 pelmFile->setAttribute("ovf:id", strFileRef); 1021 1023 pelmFile->setAttribute("ovf:href", strTargetFileNameOnly); 1022 pelmFile->setAttribute("ovf:id", strFileRef);1023 1024 /// @todo the actual size is not available at this point of time, 1024 1025 // cause the disk will be compressed. The 1.0 standard says this is … … 1548 1549 1549 1550 stack.mapDisks[strDiskID] = &desc; 1551 1552 //use the list stack.mapDiskSequence where the disks go as the "VirtualSystem" should be placed 1553 //in the OVF description file. 1554 stack.mapDiskSequence.push_back(strDiskID); 1550 1555 } 1551 1556 break; … … 1573 1578 if (uLoop == 2) 1574 1579 { 1575 //uint32_t cDisks =stack.mapDisks.size();1576 Utf8Str strDiskID = Utf8StrFmt("iso%RI32", ++cD VDs);1577 1580 uint32_t cDisks = (uint32_t)stack.mapDisks.size(); 1581 Utf8Str strDiskID = Utf8StrFmt("iso%RI32", ++cDisks); 1582 ++cDVDs; 1578 1583 strDescription = "CD-ROM Drive"; 1579 1584 strCaption = Utf8StrFmt("cdrom%RI32", cDVDs); // OVFTool starts with 1 … … 1620 1625 1621 1626 stack.mapDisks[strDiskID] = &desc; 1627 1628 //use the list stack.mapDiskSequence where the disks go as the "VirtualSystem" should be placed 1629 //in the OVF description file. 1630 stack.mapDiskSequence.push_back(strDiskID); 1622 1631 // there is no DVD drive map to update because it is 1623 1632 // handled completely with this entry. … … 2149 2158 2150 2159 // Finally, write out the disks! 2151 map<Utf8Str, const VirtualSystemDescriptionEntry*>::const_iterator itS; 2152 for (itS = stack.mapDisks.begin(); 2153 itS != stack.mapDisks.end(); 2154 ++itS) 2155 { 2156 const VirtualSystemDescriptionEntry *pDiskEntry = itS->second; 2160 //use the list stack.mapDiskSequence where the disks were put as the "VirtualSystem"s had been placed 2161 //in the OVF description file. I.e. we have one "VirtualSystem" in the OVF file, we extract all disks 2162 //attached to it. And these disks are stored in the stack.mapDiskSequence. Next we shift to the next 2163 //"VirtualSystem" and repeat the operation. 2164 //And here we go through the list and extract all disks in the same sequence 2165 list<Utf8Str>::const_iterator itS; 2166 for (itS = stack.mapDiskSequence.begin(); 2167 itS != stack.mapDiskSequence.end(); 2168 ++itS) 2169 { 2170 const Utf8Str &strDiskID = *itS; 2171 const VirtualSystemDescriptionEntry *pDiskEntry = stack.mapDisks[strDiskID]; 2157 2172 2158 2173 // source path: where the VBox image is -
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r65186 r65530 3758 3758 * disks description using the found disk image 3759 3759 */ 3760 vsdeTargetHD = NULL; 3760 3761 for (list<VirtualSystemDescriptionEntry*>::const_iterator itHD = avsdeHDs.begin(); 3761 3762 itHD != avsdeHDs.end();
Note:
See TracChangeset
for help on using the changeset viewer.