Changeset 35082 in vbox
- Timestamp:
- Dec 14, 2010 1:55:49 PM (14 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r35040 r35082 3396 3396 medium->getLocationFull().c_str()); 3397 3397 3398 if (!medium.isNull()) 3399 { 3400 MediumType_T mtype = medium->getType(); 3401 if ( mtype == MediumType_MultiAttach 3402 || mtype == MediumType_Readonly 3403 ) 3404 { 3405 // These two types are new with VirtualBox 4.0 and therefore require settings 3406 // version 1.11 in the settings backend. Unfortunately it is not enough to do 3407 // the usual routine in MachineConfigFile::bumpSettingsVersionIfNeeded() for 3408 // two reasons: The medium type is a property of the media registry tree, which 3409 // can reside in the global config file (for pre-4.0 media); we would therefore 3410 // possibly need to bump the global config version. We don't want to do that though 3411 // because that might make downgrading to pre-4.0 impossible. 3412 // As a result, we can only use these two new types if the medium is NOT in the 3413 // global registry: 3414 const Guid &uuidGlobalRegistry = mParent->getGlobalRegistryId(); 3415 if ( medium->isInRegistry(uuidGlobalRegistry) 3416 || !mData->pMachineConfigFile->canHaveOwnMediaRegistry() 3417 ) 3418 return setError(VBOX_E_INVALID_OBJECT_STATE, 3419 tr("Cannot attach medium '%s': the media types 'MultiAttach' and 'Readonly' can only be attached " 3420 "to machines that were created with VirtualBox 4.0 or later"), 3421 medium->getLocationFull().c_str()); 3422 } 3423 } 3424 3398 3425 bool fIndirect = false; 3399 3426 if (!medium.isNull()) -
trunk/src/VBox/Main/MediumImpl.cpp
r35040 r35082 1701 1701 default: 1702 1702 AssertFailedReturn(E_FAIL); 1703 } 1704 1705 if ( aType == MediumType_MultiAttach 1706 || aType == MediumType_Readonly 1707 ) 1708 { 1709 // These two types are new with VirtualBox 4.0 and therefore require settings 1710 // version 1.11 in the settings backend. Unfortunately it is not enough to do 1711 // the usual routine in MachineConfigFile::bumpSettingsVersionIfNeeded() for 1712 // two reasons: The medium type is a property of the media registry tree, which 1713 // can reside in the global config file (for pre-4.0 media); we would therefore 1714 // possibly need to bump the global config version. We don't want to do that though 1715 // because that might make downgrading to pre-4.0 impossible. 1716 // As a result, we can only use these two new types if the medium is NOT in the 1717 // global registry: 1718 const Guid &uuidGlobalRegistry = m->pVirtualBox->getGlobalRegistryId(); 1719 if (isInRegistry(uuidGlobalRegistry)) 1720 return setError(VBOX_E_INVALID_OBJECT_STATE, 1721 tr("Cannot change type for medium '%s': the media types 'MultiAttach' and 'Readonly' can only be used " 1722 "on media registered with a machine that was created with VirtualBox 4.0 or later"), 1723 m->strLocationFull.c_str()); 1703 1724 } 1704 1725
Note:
See TracChangeset
for help on using the changeset viewer.