Changeset 35164 in vbox
- Timestamp:
- Dec 16, 2010 8:17:52 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImplExport.cpp
r34505 r35164 1087 1087 uint32_t ulInstanceID = 1; 1088 1088 1089 uint32_t cDVDs = 0; 1090 1089 1091 for (size_t uLoop = 1; uLoop <= 2; ++uLoop) 1090 1092 { … … 1354 1356 if (uLoop == 2) 1355 1357 { 1356 // we can't have a CD without an IDE controller1357 if (!idIDESecondaryController)1358 throw setError(VBOX_E_NOT_SUPPORTED,1359 tr("Can't have CD-ROM without secondary IDE controller"));1360 1361 1358 strDescription = "CD-ROM Drive"; 1362 strCaption = "cdrom1"; // this is what OVFTool writes1359 strCaption = Utf8StrFmt("cdrom%RI32", ++cDVDs); // OVFTool starts with 1 1363 1360 type = ovf::ResourceType_CDDrive; // 15 1364 1361 lAutomaticAllocation = 1; 1365 ulParent = idIDESecondaryController; 1366 lAddressOnParent = 0; // this is what OVFTool writes 1362 1363 // controller=<index>;channel=<c> 1364 size_t pos1 = desc.strExtraConfigCurrent.find("controller="); 1365 size_t pos2 = desc.strExtraConfigCurrent.find("channel="); 1366 int32_t lControllerIndex = -1; 1367 if (pos1 != Utf8Str::npos) 1368 { 1369 RTStrToInt32Ex(desc.strExtraConfigCurrent.c_str() + pos1 + 11, NULL, 0, &lControllerIndex); 1370 if (lControllerIndex == lIDEPrimaryControllerIndex) 1371 ulParent = idIDEPrimaryController; 1372 else if (lControllerIndex == lIDESecondaryControllerIndex) 1373 ulParent = idIDESecondaryController; 1374 else if (lControllerIndex == lSCSIControllerIndex) 1375 ulParent = idSCSIController; 1376 else if (lControllerIndex == lSATAControllerIndex) 1377 ulParent = idSATAController; 1378 } 1379 if (pos2 != Utf8Str::npos) 1380 RTStrToInt32Ex(desc.strExtraConfigCurrent.c_str() + pos2 + 8, NULL, 0, &lAddressOnParent); 1381 1382 LogFlowFunc(("DVD drive details: pos1=%d, pos2=%d, lControllerIndex=%d, lIDEPrimaryControllerIndex=%d, lIDESecondaryControllerIndex=%d, ulParent=%d, lAddressOnParent=%d\n", 1383 pos1, pos2, lControllerIndex, lIDEPrimaryControllerIndex, lIDESecondaryControllerIndex, ulParent, lAddressOnParent)); 1384 1385 if ( !ulParent 1386 || lAddressOnParent == -1 1387 ) 1388 throw setError(VBOX_E_NOT_SUPPORTED, 1389 tr("Missing or bad extra config string in DVD drive medium: \"%s\""), desc.strExtraConfigCurrent.c_str()); 1390 1391 // there is no DVD drive map to update because it is 1392 // handled completely with this entry. 1367 1393 } 1368 1394 break;
Note:
See TracChangeset
for help on using the changeset viewer.