- Timestamp:
- May 26, 2020 11:05:07 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r84532 r84535 1454 1454 { 1455 1455 /* what to do? create a new name from the old one with some suffix? */ 1456 uint64_t suff = RTRandU64(); 1457 strVMName.append("__").appendPrintfNoThrow("%ul", suff); 1456 uint64_t uRndSuff = RTRandU64(); 1457 vrc = strVMName.appendPrintfNoThrow("__%RU64", uRndSuff); 1458 AssertRCBreakStmt(vrc, hrc = E_OUTOFMEMORY); 1458 1459 1459 1460 vsd->RemoveDescriptionByType(VirtualSystemDescriptionType_Name); … … 1546 1547 1547 1548 1548 HRESULT original_hrc = hrc;//save the original result1549 1550 1549 /* In any case we delete the cloud leavings which may exist after the first phase (cloud phase). 1551 1550 * Should they be deleted in the OCICloudClient::importInstance()? 1552 1551 * Because deleting them here is not easy as it in the importInstance(). */ 1553 1552 { 1553 ErrorInfoKeeper eik; /* save the error info */ 1554 HRESULT const hrcSaved = hrc; 1555 1554 1556 GET_VSD_DESCRIPTION_BY_TYPE(VirtualSystemDescriptionType_CloudInstanceId)//aVBoxValues is set in this #define 1555 1557 if (aVBoxValues.size() == 0) … … 1580 1582 * Thus we restore the original error in the case when the cleanup phase was successful 1581 1583 * Otherwise we return not the original error but the last error in the cleanup phase */ 1582 hrc = original_hrc; 1584 /** @todo r=bird: do this conditionally perhaps? 1585 * if (FAILED(hrcSaved)) 1586 * hrc = hrcSaved; 1587 * else 1588 * eik.forget(); 1589 */ 1590 hrc = hrcSaved; 1583 1591 } 1584 1592 1585 1593 if (FAILED(hrc)) 1586 1594 { 1595 /** @todo r=bird: Using heap to keep a readonly C-string is a real wonderful 1596 * way to doing things. */ 1587 1597 Utf8Str generalRollBackErrorMessage("Rollback action for Import Cloud operation failed. " 1588 1598 "Some leavings may exist on the local disk or in the Cloud."); … … 1597 1607 */ 1598 1608 1599 { 1609 { /** @todo r=bird: Pointless {}. */ 1600 1610 if (!fKeepDownloadedObject) 1601 1611 { 1612 ErrorInfoKeeper eik; /* save the error info */ 1613 HRESULT const hrcSaved = hrc; 1614 1602 1615 /* small explanation here, the image here points out to the whole downloaded object (not to the image only) 1603 1616 * filled during the first cloud import stage (in the ICloudClient::importInstance()) */ … … 1622 1635 } 1623 1636 } 1624 } 1625 }1626 1627 /* Because during the rollback phase the hrc may have the good result1628 * Thus we restore the original error in the case when the rollback phase was successful1629 * Otherwise we return not the original error but the last error in the rollback phase */1630 hrc = original_hrc;1637 1638 /* Because during the rollback phase the hrc may have the good result 1639 * Thus we restore the original error in the case when the rollback phase was successful 1640 * Otherwise we return not the original error but the last error in the rollback phase */ 1641 hrc = hrcSaved; 1642 } 1643 } 1631 1644 } 1632 1645 else
Note:
See TracChangeset
for help on using the changeset viewer.