Changeset 35126 in vbox
- Timestamp:
- Dec 15, 2010 12:14:15 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Main/MediumImpl.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MediumImpl.cpp
r35082 r35126 1639 1639 } 1640 1640 1641 DeviceType_T devType = getDeviceType(); 1642 // DVD media can only be readonly. 1643 if (devType == DeviceType_DVD && aType != MediumType_Readonly) 1644 return setError(VBOX_E_INVALID_OBJECT_STATE, 1645 tr("Cannot change the type of DVD medium '%s'"), 1646 m->strLocationFull.c_str()); 1647 // Floppy media can only be writethrough or readonly. 1648 if ( devType == DeviceType_Floppy 1649 && aType != MediumType_Writethrough 1650 && aType != MediumType_Readonly) 1651 return setError(VBOX_E_INVALID_OBJECT_STATE, 1652 tr("Cannot change the type of floppy medium '%s'"), 1653 m->strLocationFull.c_str()); 1654 1641 1655 /* cannot change the type of a differencing medium */ 1642 1656 if (m->pParent) … … 1697 1711 m->strLocationFull.c_str()); 1698 1712 } 1713 else if (aType == MediumType_Readonly && devType == DeviceType_HardDisk) 1714 { 1715 // Readonly hard disks are not allowed, this medium type is reserved for 1716 // DVDs and floppy images at the moment. Later we might allow readonly hard 1717 // disks, but that's extremely unusual and many guest OSes will have trouble. 1718 return setError(VBOX_E_INVALID_OBJECT_STATE, 1719 tr("Cannot change type for medium '%s' to 'Readonly' since it is a hard disk"), 1720 m->strLocationFull.c_str()); 1721 } 1699 1722 break; 1700 1723 } … … 1703 1726 } 1704 1727 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 1728 if (aType == MediumType_MultiAttach) 1729 { 1730 // This type is new with VirtualBox 4.0 and therefore requires settings 1710 1731 // version 1.11 in the settings backend. Unfortunately it is not enough to do 1711 1732 // the usual routine in MachineConfigFile::bumpSettingsVersionIfNeeded() for … … 1719 1740 if (isInRegistry(uuidGlobalRegistry)) 1720 1741 return setError(VBOX_E_INVALID_OBJECT_STATE, 1721 tr("Cannot change type for medium '%s': the media type s 'MultiAttach' and 'Readonly' can only be used "1742 tr("Cannot change type for medium '%s': the media type 'MultiAttach' can only be used " 1722 1743 "on media registered with a machine that was created with VirtualBox 4.0 or later"), 1723 1744 m->strLocationFull.c_str());
Note:
See TracChangeset
for help on using the changeset viewer.

