Changeset 47342 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jul 23, 2013 1:59:12 PM (11 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r47190 r47342 786 786 /** true if we already listed the disk type of the snapshot folder. */ 787 787 bool mfSnapshotFolderDiskTypeShown : 1; 788 /** true if a USB controller is available (i.e. USB devices can be attached). */ 789 bool mfVMHasUsbController : 1; 788 790 789 791 /** Pointer to the VMM -> User (that's us) callbacks. */ -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r47249 r47342 381 381 , mfSnapshotFolderExt4WarningShown(false) 382 382 , mfSnapshotFolderDiskTypeShown(false) 383 , mfVMHasUsbController(false) 383 384 , mpVmm2UserMethods(NULL) 384 385 , m_pVMMDev(NULL) … … 2848 2849 return ptrVM.rc(); 2849 2850 2850 /* Don't proceed unless we've found the usb controller. */ 2851 PPDMIBASE pBase = NULL; 2852 int vrc = PDMR3QueryLun(ptrVM.rawUVM(), "usb-ohci", 0, 0, &pBase); 2853 if (RT_FAILURE(vrc)) 2851 /* Don't proceed unless we have a USB controller. */ 2852 if (!mfVMHasUsbController) 2854 2853 return setError(VBOX_E_PDM_ERROR, 2855 2854 tr("The virtual machine does not have a USB controller")); … … 7137 7136 if (RT_SUCCESS(vrc) || autoCaller.state() == InUninit) 7138 7137 { 7139 /* If the machine has a nUSB controller, release all USB devices7138 /* If the machine has a USB controller, release all USB devices 7140 7139 * (symmetric to the code in captureUSBDevices()) */ 7141 bool fHasUSBController = false; 7142 { 7143 PPDMIBASE pBase; 7144 vrc = PDMR3QueryLun(pUVM, "usb-ohci", 0, 0, &pBase); 7145 if (RT_SUCCESS(vrc)) 7146 { 7147 fHasUSBController = true; 7148 alock.release(); 7149 detachAllUSBDevices(false /* aDone */); 7150 alock.acquire(); 7151 } 7140 if (mfVMHasUsbController) 7141 { 7142 alock.release(); 7143 detachAllUSBDevices(false /* aDone */); 7144 alock.acquire(); 7152 7145 } 7153 7146 … … 7200 7193 7201 7194 /* Complete the detaching of the USB devices. */ 7202 if ( fHasUSBController)7195 if (mfVMHasUsbController) 7203 7196 { 7204 7197 alock.release(); … … 8652 8645 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 8653 8646 8654 /* If the machine has a nUSB controller, ask the USB proxy service to8647 /* If the machine has a USB controller, ask the USB proxy service to 8655 8648 * capture devices */ 8656 PPDMIBASE pBase; 8657 int vrc = PDMR3QueryLun(pUVM, "usb-ohci", 0, 0, &pBase); 8658 if (RT_SUCCESS(vrc)) 8649 if (mfVMHasUsbController) 8659 8650 { 8660 8651 /* release the lock before calling Host in VBoxSVC since Host may call … … 8666 8657 ComAssertComRCRetRC(hrc); 8667 8658 } 8668 else if ( vrc == VERR_PDM_DEVICE_NOT_FOUND 8669 || vrc == VERR_PDM_DEVICE_INSTANCE_NOT_FOUND) 8670 vrc = VINF_SUCCESS; 8671 else 8672 AssertRC(vrc); 8673 8674 return RT_SUCCESS(vrc) ? S_OK : E_FAIL; 8659 8660 return S_OK; 8675 8661 } 8676 8662 -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r47246 r47342 2290 2290 attachStatusDriver(pInst, &mapUSBLed[0], 0, 0, NULL, NULL, 0); 2291 2291 2292 mfVMHasUsbController = true; 2292 2293 #ifdef VBOX_WITH_EHCI 2293 2294 BOOL fEHCIEnabled;
Note:
See TracChangeset
for help on using the changeset viewer.