- Timestamp:
- Nov 8, 2013 8:05:09 AM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 90475
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r49039 r49416 2107 2107 } 2108 2108 2109 2110 2109 /** 2111 2110 * Helper that converts VirtualSystem attachment values into VirtualBox attachment values. … … 3396 3395 settings::StorageControllersList &llControllers = config.storageMachine.llStorageControllers; 3397 3396 Guid hdUuid; 3398 uint32_t c HardDisks = 0;3397 uint32_t cDisks = 0; 3399 3398 bool fInconsistent = false; 3400 3399 bool fRepairDuplicate = false; … … 3420 3419 { 3421 3420 const Guid &thisUuid = it4->uuid; 3422 c HardDisks++;3423 if (c HardDisks == 1)3421 cDisks++; 3422 if (cDisks == 1) 3424 3423 { 3425 3424 if (hdUuid.isZero()) … … 3440 3439 } 3441 3440 /* paranoia... */ 3442 if (fInconsistent || c HardDisks == 1)3441 if (fInconsistent || cDisks == 1) 3443 3442 fRepairDuplicate = false; 3444 3443 … … 3446 3445 * step 2: scan the machine config for media attachments 3447 3446 */ 3447 3448 /* get VM name from virtual system description. Only one record is possible (size of list is equal 1). */ 3449 std::list<VirtualSystemDescriptionEntry*> vmName = vsdescThis->findByType(VirtualSystemDescriptionType_Name); 3450 std::list<VirtualSystemDescriptionEntry*>::iterator vmNameIt = vmName.begin(); 3451 VirtualSystemDescriptionEntry* vmNameEntry = *vmNameIt; 3448 3452 3449 3453 /* Get all hard disk descriptions. */ … … 3451 3455 std::list<VirtualSystemDescriptionEntry*>::iterator avsdeHDsIt = avsdeHDs.begin(); 3452 3456 /* paranoia - if there is no 1:1 match do not try to repair. */ 3453 if (c HardDisks != avsdeHDs.size())3457 if (cDisks != avsdeHDs.size()) 3454 3458 fRepairDuplicate = false; 3455 3459 … … 3459 3463 std::set<RTCString> disksResolvedNames; 3460 3464 3461 while(oit != stack.mapDisks.end()) 3465 uint32_t cImportedDisks = 0; 3466 3467 while(oit != stack.mapDisks.end() && cImportedDisks != avsdeHDs.size()) 3462 3468 { 3463 3469 ovf::DiskImage diCurrent = oit->second; … … 3481 3487 } 3482 3488 } 3489 3483 3490 if (!vsdeTargetHD) 3484 throw setError(E_FAIL, 3485 tr("Internal inconsistency looking up disk image '%s'"), 3486 oit->first.c_str()); 3491 { 3492 /* possible case if a disk image belongs to other virtual system (OVF package with multiple VMs inside) */ 3493 LogWarning(("OVA/OVF import: Disk image %s was missed during import of VM %s\n", 3494 oit->first.c_str(), vmNameEntry->strOvf.c_str())); 3495 ++oit; 3496 continue; 3497 3498 } 3487 3499 } 3488 3500 … … 3554 3566 } 3555 3567 if (!vsdeTargetHD) 3568 /* 3569 * in this case it's an error because something wrong with OVF description file. 3570 * May be VB imports OVA package with wrong file sequence inside the archive. 3571 */ 3556 3572 throw setError(E_FAIL, 3557 3573 tr("Internal inconsistency looking up disk image '%s'"), … … 3693 3709 strUuid.c_str()); 3694 3710 3711 ++cImportedDisks; 3712 3695 3713 }// while(oit != stack.mapDisks.end()) 3714 3715 /* 3716 * quantity of the imported disks isn't equal to the size of the avsdeHDs list. 3717 */ 3718 if(cImportedDisks < avsdeHDs.size()) 3719 { 3720 LogWarning(("Not all disk images were imported for VM %s. Check OVF description file.", 3721 vmNameEntry->strOvf.c_str())); 3722 } 3696 3723 3697 3724 /*
Note:
See TracChangeset
for help on using the changeset viewer.