- Timestamp:
- Sep 4, 2009 1:15:27 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 51958
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/HardDiskImpl.cpp
r22624 r22779 1899 1899 /** 1900 1900 * Returns @c true if this hard disk cannot be modified because it has 1901 * depend ants (children) or is part of the snapshot. Related to the hard disk1901 * dependents (children) or is part of the snapshot. Related to the hard disk 1902 1902 * type and posterity, not to the current media state. 1903 1903 * -
trunk/src/VBox/Main/MachineImpl.cpp
r22762 r22779 2115 2115 LONG aDevice) 2116 2116 { 2117 LogFlowThisFunc 2117 LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%ld aDevice=%ld\n", 2118 2118 aControllerName, aControllerPort, aDevice)); 2119 2119 … … 2131 2131 /// @todo NEWMEDIA implicit machine registration 2132 2132 if (!mData->mRegistered) 2133 return setError 2134 tr("Cannot attach hard disks to an unregistered machine"));2133 return setError(VBOX_E_INVALID_OBJECT_STATE, 2134 tr("Cannot attach hard disks to an unregistered machine")); 2135 2135 2136 2136 AssertReturn(mData->mMachineState != MachineState_Saved, E_FAIL); 2137 2137 2138 if (Global::IsOnlineOrTransient (mData->mMachineState)) 2139 return setError (VBOX_E_INVALID_VM_STATE, 2140 tr ("Invalid machine state: %d"), mData->mMachineState); 2138 if (Global::IsOnlineOrTransient(mData->mMachineState)) 2139 return setError(VBOX_E_INVALID_VM_STATE, 2140 tr("Invalid machine state: %d"), 2141 mData->mMachineState); 2141 2142 2142 2143 /* Check for an existing controller. */ … … 2158 2159 || (aDevice >= (LONG)devicesPerPort) 2159 2160 ) 2160 return setError (E_INVALIDARG, 2161 tr ("The port and/or count parameter are out of range [%lu:%lu]"), 2162 portCount, devicesPerPort); 2161 return setError(E_INVALIDARG, 2162 tr("The port and/or count parameter are out of range [%lu:%lu]"), 2163 portCount, 2164 devicesPerPort); 2163 2165 2164 2166 /* check if the device slot is already busy */ 2165 HDData::AttachmentList::const_iterator it = 2166 std::find_if (mHDData->mAttachments.begin(), 2167 mHDData->mAttachments.end(), 2168 HardDiskAttachment::EqualsTo (aControllerName, aControllerPort, aDevice)); 2169 2167 HDData::AttachmentList::const_iterator it = std::find_if(mHDData->mAttachments.begin(), 2168 mHDData->mAttachments.end(), 2169 HardDiskAttachment::EqualsTo(aControllerName, aControllerPort, aDevice)); 2170 2170 if (it != mHDData->mAttachments.end()) 2171 2171 { … … 2189 2189 AutoWriteLock hdLock (hd); 2190 2190 2191 if (std::find_if 2192 2193 HardDiskAttachment::RefersTo (hd)) !=2194 2191 if (std::find_if(mHDData->mAttachments.begin(), 2192 mHDData->mAttachments.end(), 2193 HardDiskAttachment::RefersTo (hd)) 2194 != mHDData->mAttachments.end()) 2195 2195 { 2196 2196 return setError(VBOX_E_OBJECT_IN_USE,
Note:
See TracChangeset
for help on using the changeset viewer.