Changeset 17685 in vbox for trunk/src/VBox/Main/MachineImpl.cpp
- Timestamp:
- Mar 11, 2009 12:22:40 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r17670 r17685 1886 1886 1887 1887 STDMETHODIMP Machine::AttachHardDisk(IN_GUID aId, 1888 IN_BSTR aControllerName, LONG a Port,1888 IN_BSTR aControllerName, LONG aControllerPort, 1889 1889 LONG aDevice) 1890 1890 { … … 1927 1927 CheckComRCReturnRC(rc); 1928 1928 1929 if ( (a Port < 0) || (aPort >= portCount)1929 if ( (aControllerPort < 0) || (aControllerPort >= portCount) 1930 1930 || (aDevice < 0) || (aDevice >= devicesPerPort)) 1931 1931 return setError (E_INVALIDARG, … … 1937 1937 std::find_if (mHDData->mAttachments.begin(), 1938 1938 mHDData->mAttachments.end(), 1939 HardDiskAttachment::EqualsTo (aControllerName, a Port, aDevice));1939 HardDiskAttachment::EqualsTo (aControllerName, aControllerPort, aDevice)); 1940 1940 1941 1941 if (it != mHDData->mAttachments.end()) … … 1946 1946 tr ("Hard disk '%ls' is already attached to device slot %d on " 1947 1947 "port %d of controller '%ls' of this virtual machine"), 1948 hd->locationFull().raw(), aDevice, a Port, aControllerName);1948 hd->locationFull().raw(), aDevice, aControllerPort, aControllerName); 1949 1949 } 1950 1950 … … 1993 1993 /* see if it's the same bus/channel/device */ 1994 1994 if ((*it)->device() == aDevice && 1995 (*it)->port() == a Port &&1995 (*it)->port() == aControllerPort && 1996 1996 (*it)->controller() == aControllerName) 1997 1997 { … … 2051 2051 */ 2052 2052 if ((*it)->device() == aDevice && 2053 (*it)->port() == a Port &&2053 (*it)->port() == aControllerPort && 2054 2054 (*it)->controller() == aControllerName) 2055 2055 { … … 2111 2111 */ 2112 2112 if ((*it)->device() == aDevice && 2113 (*it)->port() == a Port &&2113 (*it)->port() == aControllerPort && 2114 2114 (*it)->controller() == aControllerName) 2115 2115 { … … 2187 2187 ComObjPtr<HardDiskAttachment> attachment; 2188 2188 attachment.createObject(); 2189 rc = attachment->init (hd, aControllerName, a Port, aDevice, indirect);2189 rc = attachment->init (hd, aControllerName, aControllerPort, aDevice, indirect); 2190 2190 CheckComRCReturnRC (rc); 2191 2191 … … 2206 2206 } 2207 2207 2208 STDMETHODIMP Machine::GetHardDisk(IN_BSTR aControllerName, LONG a Port,2208 STDMETHODIMP Machine::GetHardDisk(IN_BSTR aControllerName, LONG aControllerPort, 2209 2209 LONG aDevice, IHardDisk **aHardDisk) 2210 2210 { … … 2225 2225 std::find_if (mHDData->mAttachments.begin(), 2226 2226 mHDData->mAttachments.end(), 2227 HardDiskAttachment::EqualsTo (aControllerName, a Port, aDevice));2227 HardDiskAttachment::EqualsTo (aControllerName, aControllerPort, aDevice)); 2228 2228 2229 2229 if (it == mHDData->mAttachments.end()) 2230 2230 return setError (VBOX_E_OBJECT_NOT_FOUND, 2231 2231 tr ("No hard disk attached to device slot %d on port %d of controller '%ls'"), 2232 aDevice, a Port, aControllerName);2232 aDevice, aControllerPort, aControllerName); 2233 2233 2234 2234 (*it)->hardDisk().queryInterfaceTo (aHardDisk); … … 2237 2237 } 2238 2238 2239 STDMETHODIMP Machine::DetachHardDisk(IN_BSTR aControllerName, LONG a Port,2239 STDMETHODIMP Machine::DetachHardDisk(IN_BSTR aControllerName, LONG aControllerPort, 2240 2240 LONG aDevice) 2241 2241 { … … 2262 2262 std::find_if (mHDData->mAttachments.begin(), 2263 2263 mHDData->mAttachments.end(), 2264 HardDiskAttachment::EqualsTo (aControllerName, a Port, aDevice));2264 HardDiskAttachment::EqualsTo (aControllerName, aControllerPort, aDevice)); 2265 2265 2266 2266 if (it == mHDData->mAttachments.end()) 2267 2267 return setError (VBOX_E_OBJECT_NOT_FOUND, 2268 2268 tr ("No hard disk attached to device slot %d on port %d of controller '%ls'"), 2269 aDevice, a Port, aControllerName);2269 aDevice, aControllerPort, aControllerName); 2270 2270 2271 2271 ComObjPtr<HardDiskAttachment> hda = *it;
Note:
See TracChangeset
for help on using the changeset viewer.