Changeset 31239 in vbox
- Timestamp:
- Jul 30, 2010 11:58:45 AM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r31236 r31239 9007 9007 /* enumerate new attachments */ 9008 9008 for (MediaData::AttachmentList::const_iterator it = mMediaData->mAttachments.begin(); 9009 9010 9009 it != mMediaData->mAttachments.end(); 9010 ++it) 9011 9011 { 9012 9012 MediumAttachment *pAttach = *it; -
trunk/src/VBox/Main/MediumImpl.cpp
r31236 r31239 1431 1431 /* cannot change the type of a differencing medium */ 1432 1432 if (m->pParent) 1433 return setError( E_FAIL,1433 return setError(VBOX_E_INVALID_OBJECT_STATE, 1434 1434 tr("Cannot change the type of medium '%s' because it is a differencing medium"), 1435 1435 m->strLocationFull.raw()); … … 1437 1437 /* cannot change the type of a medium being in use by more than one VM */ 1438 1438 if (m->backRefs.size() > 1) 1439 return setError( E_FAIL,1439 return setError(VBOX_E_INVALID_OBJECT_STATE, 1440 1440 tr("Cannot change the type of medium '%s' because it is attached to %d virtual machines"), 1441 1441 m->strLocationFull.raw(), m->backRefs.size()); … … 1456 1456 /* cannot change to writethrough or shareable if there are children */ 1457 1457 if (getChildren().size() != 0) 1458 return setError( E_FAIL,1458 return setError(VBOX_E_OBJECT_IN_USE, 1459 1459 tr("Cannot change type for medium '%s' since it has %d child media"), 1460 1460 m->strLocationFull.raw(), getChildren().size()); … … 1463 1463 MediumVariant_T variant = getVariant(); 1464 1464 if (!(variant & MediumVariant_Fixed)) 1465 return setError( E_FAIL,1465 return setError(VBOX_E_INVALID_OBJECT_STATE, 1466 1466 tr("Cannot change type for medium '%s' to 'Shareable' since it is a dynamic medium storage unit"), 1467 1467 m->strLocationFull.raw()); 1468 1469 1468 } 1470 1469 break; … … 2195 2194 2196 2195 if (m->type == MediumType_Writethrough) 2197 return setError( E_FAIL,2196 return setError(VBOX_E_INVALID_OBJECT_STATE, 2198 2197 tr("Medium type of '%s' is Writethrough"), 2199 2198 m->strLocationFull.raw()); 2200 2199 else if (m->type == MediumType_Shareable) 2201 return setError( E_FAIL,2200 return setError(VBOX_E_INVALID_OBJECT_STATE, 2202 2201 tr("Medium type of '%s' is Shareable"), 2203 2202 m->strLocationFull.raw()); … … 2681 2680 2682 2681 if (m->numCreateDiffTasks > 0) 2683 return setError( E_FAIL,2682 return setError(VBOX_E_OBJECT_IN_USE, 2684 2683 tr("Cannot attach medium '%s' {%RTuuid}: %u differencing child media are being created"), 2685 2684 m->strLocationFull.raw(), … … 2724 2723 dumpBackRefs(); 2725 2724 #endif 2726 return setError( E_FAIL,2725 return setError(VBOX_E_OBJECT_IN_USE, 2727 2726 tr("Cannot attach medium '%s' {%RTuuid} from snapshot '%RTuuid': medium is already in use by this snapshot!"), 2728 2727 m->strLocationFull.raw(), … … 3107 3106 int vrc = m->pVirtualBox->calculateFullPath(location, location); 3108 3107 if (RT_FAILURE(vrc)) 3109 return setError( E_FAIL,3108 return setError(VBOX_E_FILE_ERROR, 3110 3109 tr("Invalid medium storage file location '%s' (%Rrc)"), 3111 3110 location.raw(), … … 4381 4380 4382 4381 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 4383 throw setError( E_FAIL,4382 throw setError(VBOX_E_INVALID_OBJECT_STATE, 4384 4383 tr("Media '%s' and '%s' are unrelated"), 4385 4384 m->strLocationFull.raw(), tgtLoc.raw()); … … 4427 4426 if (getChildren().size() > 1) 4428 4427 { 4429 throw setError( E_FAIL,4428 throw setError(VBOX_E_INVALID_OBJECT_STATE, 4430 4429 tr("Medium '%s' involved in the merge operation has more than one child medium (%d)"), 4431 4430 m->strLocationFull.raw(), getChildren().size()); … … 4441 4440 || ( (!aSnapshotId || !aSnapshotId->isEmpty()) 4442 4441 && *getFirstMachineBackrefSnapshotId() != *aSnapshotId))) 4443 throw setError( E_FAIL,4442 throw setError(VBOX_E_OBJECT_IN_USE, 4444 4443 tr("Medium '%s' is attached to %d virtual machines"), 4445 4444 m->strLocationFull.raw(), m->backRefs.size()); 4446 4445 if (m->type == MediumType_Immutable) 4447 throw setError( E_FAIL,4446 throw setError(VBOX_E_INVALID_OBJECT_STATE, 4448 4447 tr("Medium '%s' is immutable"), 4449 4448 m->strLocationFull.raw()); … … 4454 4453 if (pTarget->getChildren().size() > 1) 4455 4454 { 4456 throw setError( E_FAIL,4455 throw setError(VBOX_E_OBJECT_IN_USE, 4457 4456 tr("Medium '%s' involved in the merge operation has more than one child medium (%d)"), 4458 4457 pTarget->m->strLocationFull.raw(), … … 4460 4459 } 4461 4460 if (pTarget->m->type == MediumType_Immutable) 4462 throw setError( E_FAIL,4461 throw setError(VBOX_E_INVALID_OBJECT_STATE, 4463 4462 tr("Medium '%s' is immutable"), 4464 4463 pTarget->m->strLocationFull.raw()); … … 4473 4472 if (pLast->getChildren().size() > 1) 4474 4473 { 4475 throw setError( E_FAIL,4474 throw setError(VBOX_E_OBJECT_IN_USE, 4476 4475 tr("Medium '%s' involved in the merge operation has more than one child medium (%d)"), 4477 4476 pLast->m->strLocationFull.raw(), … … 4479 4478 } 4480 4479 if (pLast->m->backRefs.size() != 0) 4481 throw setError( E_FAIL,4480 throw setError(VBOX_E_OBJECT_IN_USE, 4482 4481 tr("Medium '%s' is attached to %d virtual machines"), 4483 4482 pLast->m->strLocationFull.raw(), … … 4873 4872 4874 4873 if (getChildren().size() != 0) 4875 return setError( E_FAIL,4874 return setError(VBOX_E_OBJECT_IN_USE, 4876 4875 tr("Cannot close medium '%s' because it has %d child media"), 4877 4876 m->strLocationFull.raw(), getChildren().size()); … … 5382 5381 task.mVDOperationIfaces); 5383 5382 if (RT_FAILURE(vrc)) 5384 throw setError( E_FAIL,5385 tr("Could not create the medium storage unit '%s'%s"),5386 location.raw(), vdError(vrc).raw());5383 throw setError(VBOX_E_FILE_ERROR, 5384 tr("Could not create the medium storage unit '%s'%s"), 5385 location.raw(), vdError(vrc).raw()); 5387 5386 5388 5387 size = VDGetFileSize(hdd, 0); … … 5528 5527 pMedium->m->vdDiskIfaces); 5529 5528 if (RT_FAILURE(vrc)) 5530 throw setError( E_FAIL,5529 throw setError(VBOX_E_FILE_ERROR, 5531 5530 tr("Could not open the medium storage unit '%s'%s"), 5532 5531 pMedium->m->strLocationFull.raw(), … … 5550 5549 task.mVDOperationIfaces); 5551 5550 if (RT_FAILURE(vrc)) 5552 throw setError( E_FAIL,5551 throw setError(VBOX_E_FILE_ERROR, 5553 5552 tr("Could not create the differencing medium storage unit '%s'%s"), 5554 5553 targetLocation.raw(), vdError(vrc).raw()); … … 5783 5782 catch (int aVRC) 5784 5783 { 5785 throw setError( E_FAIL,5784 throw setError(VBOX_E_FILE_ERROR, 5786 5785 tr("Could not merge the medium '%s' to '%s'%s"), 5787 5786 m->strLocationFull.raw(), … … 6013 6012 pMedium->m->vdDiskIfaces); 6014 6013 if (RT_FAILURE(vrc)) 6015 throw setError( E_FAIL,6016 6017 6018 6014 throw setError(VBOX_E_FILE_ERROR, 6015 tr("Could not open the medium storage unit '%s'%s"), 6016 pMedium->m->strLocationFull.raw(), 6017 vdError(vrc).raw()); 6019 6018 } 6020 6019 … … 6077 6076 pMedium->m->vdDiskIfaces); 6078 6077 if (RT_FAILURE(vrc)) 6079 throw setError( E_FAIL,6078 throw setError(VBOX_E_FILE_ERROR, 6080 6079 tr("Could not open the medium storage unit '%s'%s"), 6081 6080 pMedium->m->strLocationFull.raw(), … … 6097 6096 task.mVDOperationIfaces); 6098 6097 if (RT_FAILURE(vrc)) 6099 throw setError( E_FAIL,6100 6101 6098 throw setError(VBOX_E_FILE_ERROR, 6099 tr("Could not create the clone medium '%s'%s"), 6100 targetLocation.raw(), vdError(vrc).raw()); 6102 6101 6103 6102 size = VDGetFileSize(targetHdd, VD_LAST_IMAGE); … … 6232 6231 6233 6232 if (RT_FAILURE(vrc)) 6234 throw setError( E_FAIL,6235 6236 6233 throw setError(VBOX_E_FILE_ERROR, 6234 tr("Could not delete the medium storage unit '%s'%s"), 6235 location.raw(), vdError(vrc).raw()); 6237 6236 6238 6237 } … … 6327 6326 pMedium->m->vdDiskIfaces); 6328 6327 if (RT_FAILURE(vrc)) 6329 throw setError( E_FAIL,6328 throw setError(VBOX_E_FILE_ERROR, 6330 6329 tr("Could not open the medium storage unit '%s'%s"), 6331 6330 pMedium->m->strLocationFull.raw(), … … 6340 6339 vrc = VDClose(hdd, true /* fDelete */); 6341 6340 if (RT_FAILURE(vrc)) 6342 throw setError( E_FAIL,6341 throw setError(VBOX_E_FILE_ERROR, 6343 6342 tr("Could not delete the medium storage unit '%s'%s"), 6344 6343 location.raw(), vdError(vrc).raw()); … … 6351 6350 m->vdDiskIfaces); 6352 6351 if (RT_FAILURE(vrc)) 6353 throw setError( E_FAIL,6354 6355 6352 throw setError(VBOX_E_FILE_ERROR, 6353 tr("Could not open the medium storage unit '%s'%s"), 6354 parentLocation.raw(), vdError(vrc).raw()); 6356 6355 6357 6356 vrc = VDCreateDiff(hdd, … … 6367 6366 task.mVDOperationIfaces); 6368 6367 if (RT_FAILURE(vrc)) 6369 throw setError( E_FAIL,6370 6371 6368 throw setError(VBOX_E_FILE_ERROR, 6369 tr("Could not create the differencing medium storage unit '%s'%s"), 6370 location.raw(), vdError(vrc).raw()); 6372 6371 6373 6372 size = VDGetFileSize(hdd, VD_LAST_IMAGE); … … 6457 6456 pMedium->m->vdDiskIfaces); 6458 6457 if (RT_FAILURE(vrc)) 6459 throw setError( E_FAIL,6458 throw setError(VBOX_E_FILE_ERROR, 6460 6459 tr("Could not open the medium storage unit '%s'%s"), 6461 6460 pMedium->m->strLocationFull.raw(), … … 6482 6481 location.raw()); 6483 6482 else 6484 throw setError( E_FAIL,6483 throw setError(VBOX_E_FILE_ERROR, 6485 6484 tr("Could not compact medium '%s'%s"), 6486 6485 location.raw(),
Note:
See TracChangeset
for help on using the changeset viewer.