- Timestamp:
- Dec 13, 2010 5:44:28 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 68870
- Location:
- trunk/src/VBox/Main
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r35009 r35040 7546 7546 } 7547 7547 7548 if (medium->getType() == MediumType_MultiAttach) 7549 { 7550 if (isSnapshotMachine()) 7551 return setError(E_FAIL, 7552 tr("Multi-attach hard disk '%s' with UUID {%RTuuid} cannot be directly attached to snapshot with UUID {%RTuuid} " 7553 "of the virtual machine '%s' ('%s')"), 7554 medium->getLocationFull().c_str(), 7555 dev.uuid.raw(), 7556 puuidSnapshot->raw(), 7557 mUserData->s.strName.c_str(), 7558 mData->m_strConfigFileFull.c_str()); 7559 7560 return setError(E_FAIL, 7561 tr("Multi-attach hard disk '%s' with UUID {%RTuuid} cannot be directly attached to the virtual machine '%s' ('%s')"), 7562 medium->getLocationFull().c_str(), 7563 dev.uuid.raw(), 7564 mUserData->s.strName.c_str(), 7565 mData->m_strConfigFileFull.c_str()); 7566 } 7567 7548 7568 if ( !isSnapshotMachine() 7549 7569 && medium->getChildren().size() != 0 -
trunk/src/VBox/Main/MediumImpl.cpp
r35009 r35040 1646 1646 1647 1647 /* Cannot change the type of a medium being in use by more than one VM. 1648 * If the change is to Immutable then it must not be attached to any VM, 1649 * otherwise assumptions elsewhere are violated and the VM becomes 1650 * inaccessible. Attaching an immutable medium triggers the diff creation, 1651 * and this is vital for the correct operation. */ 1648 * If the change is to Immutable or MultiAttach then it must not be 1649 * directly attached to any VM, otherwise the assumptions about indirect 1650 * attachment elsewhere are violated and the VM becomes inaccessible. 1651 * Attaching an immutable medium triggers the diff creation, and this is 1652 * vital for the correct operation. */ 1652 1653 if ( m->backRefs.size() > 1 1653 || (aType == MediumType_Immutable && m->backRefs.size() > 0)) 1654 || ( ( aType == MediumType_Immutable 1655 || aType == MediumType_MultiAttach) 1656 && m->backRefs.size() > 0)) 1654 1657 return setError(VBOX_E_INVALID_OBJECT_STATE, 1655 1658 tr("Cannot change the type of medium '%s' because it is attached to %d virtual machines"), … … 1660 1663 case MediumType_Normal: 1661 1664 case MediumType_Immutable: 1665 case MediumType_MultiAttach: 1662 1666 { 1663 1667 /* normal can be easily converted to immutable and vice versa even … … 3423 3427 } 3424 3428 case MediumType_Immutable: 3429 case MediumType_MultiAttach: 3425 3430 return true; 3426 3431 case MediumType_Writethrough: … … 4237 4242 tr("Medium '%s' is immutable"), 4238 4243 m->strLocationFull.c_str()); 4244 if (m->type == MediumType_MultiAttach) 4245 throw setError(VBOX_E_INVALID_OBJECT_STATE, 4246 tr("Medium '%s' is multi-attach"), 4247 m->strLocationFull.c_str()); 4239 4248 } 4240 4249 else … … 4251 4260 throw setError(VBOX_E_INVALID_OBJECT_STATE, 4252 4261 tr("Medium '%s' is immutable"), 4262 pTarget->m->strLocationFull.c_str()); 4263 if (pTarget->m->type == MediumType_MultiAttach) 4264 throw setError(VBOX_E_INVALID_OBJECT_STATE, 4265 tr("Medium '%s' is multi-attach"), 4253 4266 pTarget->m->strLocationFull.c_str()); 4254 4267 } -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r34907 r35040 8793 8793 <enum 8794 8794 name="MediumType" 8795 uuid=" 19388a99-8e70-4bd4-9a95-90cbc513ef6d"8795 uuid="fe663fb5-c244-4e1b-9d81-c628b417dd04" 8796 8796 > 8797 8797 <desc> … … 8827 8827 <desc> 8828 8828 A readonly medium, which can of course be used by several machines. 8829 <note>Present and accepted since VirtualBox 4.0.</note> 8830 </desc> 8831 </const> 8832 <const name="MultiAttach" value="5"> 8833 <desc> 8834 A medium which is is indirectly attached, so that one base medium can 8835 be used for several VMs which have their own differencing medium to 8836 store their modifications. In some sense a variant of Immutable 8837 with unset AutoReset flag in each differencing medium. 8829 8838 <note>Present and accepted since VirtualBox 4.0.</note> 8830 8839 </desc> -
trunk/src/VBox/Main/xml/Settings.cpp
r34837 r35040 678 678 else if (strType == "READONLY") 679 679 med.hdType = MediumType_Readonly; 680 else if (strType == "MULTIATTACH") 681 med.hdType = MediumType_MultiAttach; 680 682 else 681 throw ConfigFileError(this, &elmMedium, N_("HardDisk/@type attribute must be one of Normal, Immutable or Writethrough"));683 throw ConfigFileError(this, &elmMedium, N_("HardDisk/@type attribute must be one of Normal, Immutable, Writethrough, Shareable, Readonly or MultiAttach")); 682 684 } 683 685 } … … 1037 1039 mdm.hdType == MediumType_Writethrough ? "Writethrough" : 1038 1040 mdm.hdType == MediumType_Shareable ? "Shareable" : 1039 mdm.hdType == MediumType_Readonly ? "Readonly" : "INVALID"; 1041 mdm.hdType == MediumType_Readonly ? "Readonly" : 1042 mdm.hdType == MediumType_MultiAttach ? "MultiAttach" : 1043 "INVALID"; 1040 1044 pelmMedium->setAttribute("type", pcszType); 1041 1045 } … … 4482 4486 } 4483 4487 4488 // Settings version 1.11 is required if Readonly/MultiAttach media 4489 // are present. 4490 if (m->sv < SettingsVersion_v1_11) 4491 { 4492 /// @todo add code going over all medium attachments and check if 4493 // they are of type Readonly or MultiAttach. 4494 } 4495 4484 4496 // settings version 1.9 is required if there is not exactly one DVD 4485 4497 // or more than one floppy drive present or the DVD is not at the secondary -
trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
r34497 r35040 308 308 <xsd:enumeration value="Immutable"/> 309 309 <xsd:enumeration value="Writethrough"/> 310 <xsd:enumeration value="Shareable"/> 311 <xsd:enumeration value="Readonly"/> 312 <xsd:enumeration value="MultiAttach"/> 310 313 </xsd:restriction> 311 314 </xsd:simpleType>
Note:
See TracChangeset
for help on using the changeset viewer.