Changeset 79584 in vbox
- Timestamp:
- Jul 8, 2019 7:40:46 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r79306 r79584 1477 1477 } 1478 1478 1479 1480 HRESULT original_hrc = hrc;//save the original result 1481 1482 /* In any case we delete the cloud leavings which may exist after the first phase (cloud phase). 1483 * Should they be deleted in the OCICloudClient::importInstance()? 1484 * Because deleting them here is not easy as it in the importInstance(). */ 1485 { 1486 GET_VSD_DESCRIPTION_BY_TYPE(VirtualSystemDescriptionType_CloudInstanceId)//aVBoxValues is set in this #define 1487 if (aVBoxValues.size() == 0) 1488 hrc = setErrorVrc(VERR_NOT_FOUND, tr("%s: Cloud cleanup action - the instance wasn't found", __FUNCTION__)); 1489 else 1490 { 1491 vsdData = aVBoxValues[0]; 1492 1493 /** @todo 1494 * future function which will eliminate the temporary objects created during the first phase. 1495 * hrc = cloud.EliminateImportLeavings(aVBoxValues[0], pProgress); */ 1496 if (FAILED(hrc)) 1497 { 1498 hrc = setErrorVrc(VERR_INVALID_STATE, tr("Some leavings may exist in the Cloud.")); 1499 LogRel(("%s: Cleanup action - the leavings in the %s after import the " 1500 "instance %s may not have been deleted\n", 1501 __FUNCTION__, strProviderName.c_str(), vsdData.c_str())); 1502 } 1503 else 1504 LogRel(("%s: Cleanup action - the leavings in the %s after import the " 1505 "instance %s have been deleted\n", 1506 __FUNCTION__, strProviderName.c_str(), vsdData.c_str())); 1507 } 1508 1509 /* Because during the cleanup phase the hrc may have the good result 1510 * Thus we restore the original error in the case when the cleanup phase was successful 1511 * Otherwise we return not the original error but the last error in the cleanup phase */ 1512 hrc = original_hrc; 1513 } 1514 1479 1515 if (FAILED(hrc)) 1480 1516 { 1481 HRESULT temp_hrc = hrc;//save the original result1482 1517 Utf8Str generalRollBackErrorMessage("Rollback action for Import Cloud operation failed." 1483 1518 "Some leavings may exist on the local disk or in the Cloud."); … … 1490 1525 * Maximum what we have there are: 1491 1526 * 1. The downloaded object, so just check the presence and delete it if one exists 1492 * 2. Some leftovers in the Cloud. Also delete them too if it's possible.1493 * Should they be deleted in the OCICloudClient::importInstance()?1494 * Because deleting them here is not easy as it in the importInstance().1495 1527 */ 1496 1528 … … 1523 1555 } 1524 1556 1525 {1526 GET_VSD_DESCRIPTION_BY_TYPE(VirtualSystemDescriptionType_CloudInstanceId)//aVBoxValues is set in this #define1527 if (aVBoxValues.size() == 0)1528 hrc = setErrorVrc(VERR_NOT_FOUND, generalRollBackErrorMessage.c_str());1529 else1530 {1531 vsdData = aVBoxValues[0];1532 1533 /** @todo1534 * future function which will eliminate the temporary objects created during the first phase.1535 * hrc = cloud.EliminateImportLeavings(aVBoxValues[0], pProgress); */1536 if (FAILED(hrc))1537 {1538 hrc = setErrorVrc(VERR_INVALID_STATE, generalRollBackErrorMessage.c_str());1539 LogRel(("%s: Rollback action - the leavings in the %s after import the "1540 "instance %s may not have been deleted\n",1541 __FUNCTION__, strProviderName.c_str(), vsdData.c_str()));1542 }1543 else1544 LogRel(("%s: Rollback action - the leavings in the %s after import the "1545 "instance %s have been deleted\n",1546 __FUNCTION__, strProviderName.c_str(), vsdData.c_str()));1547 }1548 }1549 1550 1557 /* Because during the rollback phase the hrc may have the good result 1551 1558 * Thus we restore the original error in the case when the rollback phase was successful 1552 1559 * Otherwise we return not the original error but the last error in the rollback phase */ 1553 if (SUCCEEDED(hrc)) 1554 hrc = setError(temp_hrc, strLastActualErrorDesc.c_str());//restore the original result 1560 hrc = original_hrc; 1555 1561 } 1556 1562 else … … 2036 2042 } 2037 2043 2044 hrc = E_FAIL; 2038 2045 if (FAILED(hrc)) 2039 2046 {
Note:
See TracChangeset
for help on using the changeset viewer.