Changeset 35429 in vbox
- Timestamp:
- Jan 7, 2011 2:42:24 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 69300
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/HostImpl.h
r33540 r35429 109 109 110 110 HRESULT getDrives(DeviceType_T mediumType, bool fRefresh, MediaList *&pll); 111 HRESULT findHostDrive(DeviceType_T mediumType, const Guid &uuid, bool fRefresh, ComObjPtr<Medium> &pMedium); 111 HRESULT findHostDriveById(DeviceType_T mediumType, const Guid &uuid, bool fRefresh, ComObjPtr<Medium> &pMedium); 112 HRESULT findHostDriveByName(DeviceType_T mediumType, const Utf8Str &strLocationFull, bool fRefresh, ComObjPtr<Medium> &pMedium); 112 113 113 114 #ifdef VBOX_WITH_USB -
trunk/src/VBox/Main/src-server/HostImpl.cpp
r35368 r35429 1684 1684 * @return VBOX_E_OBJECT_NOT_FOUND if not found, or S_OK if found, or errors from getDrives(). 1685 1685 */ 1686 HRESULT Host::findHostDrive (DeviceType_T mediumType,1687 const Guid &uuid,1688 bool fRefresh,1689 ComObjPtr<Medium> &pMedium)1686 HRESULT Host::findHostDriveById(DeviceType_T mediumType, 1687 const Guid &uuid, 1688 bool fRefresh, 1689 ComObjPtr<Medium> &pMedium) 1690 1690 { 1691 1691 MediaList *pllMedia; … … 1701 1701 Medium *pThis = *it; 1702 1702 if (pThis->getId() == uuid) 1703 { 1704 pMedium = pThis; 1705 return S_OK; 1706 } 1707 } 1708 } 1709 1710 return VBOX_E_OBJECT_NOT_FOUND; 1711 } 1712 1713 /** 1714 * Goes through the list of host drives that would be returned by getDrives() 1715 * and looks for a host drive with the given name. If found, it sets pMedium 1716 * to that drive; otherwise returns VBOX_E_OBJECT_NOT_FOUND. 1717 * 1718 * @param mediumType Must be DeviceType_DVD or DeviceType_Floppy. 1719 * @param strLocationFull Name (path) of host drive to look for. 1720 * @param fRefresh Whether to refresh the host drives list (see getDrives()) 1721 * @param pMedium Medium object, if found… 1722 * @return VBOX_E_OBJECT_NOT_FOUND if not found, or S_OK if found, or errors from getDrives(). 1723 */ 1724 HRESULT Host::findHostDriveByName(DeviceType_T mediumType, 1725 const Utf8Str &strLocationFull, 1726 bool fRefresh, 1727 ComObjPtr<Medium> &pMedium) 1728 { 1729 MediaList *pllMedia; 1730 1731 AutoWriteLock wlock(m->drivesLock COMMA_LOCKVAL_SRC_POS); 1732 HRESULT rc = getDrives(mediumType, fRefresh, pllMedia); 1733 if (SUCCEEDED(rc)) 1734 { 1735 for (MediaList::iterator it = pllMedia->begin(); 1736 it != pllMedia->end(); 1737 ++it) 1738 { 1739 Medium *pThis = *it; 1740 if (pThis->getLocationFull() == strLocationFull) 1703 1741 { 1704 1742 pMedium = pThis; -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r35368 r35429 7529 7529 case DeviceType_Floppy: 7530 7530 case DeviceType_DVD: 7531 rc = mParent->findRemoveableMedium(dev.deviceType, dev.uuid, false /* fRefresh */, medium); 7531 if (dev.strHostDriveSrc.isNotEmpty()) 7532 rc = mParent->host()->findHostDriveByName(dev.deviceType, dev.strHostDriveSrc, false /* fRefresh */, medium); 7533 else 7534 rc = mParent->findRemoveableMedium(dev.deviceType, dev.uuid, false /* fRefresh */, medium); 7532 7535 if (FAILED(rc)) 7533 7536 return rc; -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r35368 r35429 2843 2843 2844 2844 // first search for host drive with that UUID 2845 HRESULT rc = m->pHost->findHostDrive (mediumType,2846 uuid,2847 fRefresh,2848 pMedium);2845 HRESULT rc = m->pHost->findHostDriveById(mediumType, 2846 uuid, 2847 fRefresh, 2848 pMedium); 2849 2849 if (rc == VBOX_E_OBJECT_NOT_FOUND) 2850 2850 // then search for an image with that UUID
Note:
See TracChangeset
for help on using the changeset viewer.