VirtualBox

Changeset 59117 in vbox for trunk/src/VBox/Main/testcase


Ignore:
Timestamp:
Dec 14, 2015 2:04:37 PM (9 years ago)
Author:
vboxsync
Message:

USB,Main: Rework USBProxyService. Split it into a USBProxyService and USBProxyBackend class, USBProxyService can use multiple USBProxyBackend instances as sources for USB devices to attach to a VM which will be used for USB/IP support. Change the PDM USB API to contain a backend parameter instead of a remote flag to indicate the USB backend to use for the given device.

Location:
trunk/src/VBox/Main/testcase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/testcase/Makefile.kmk

    r56825 r59117  
    208208tstUSBProxyLinux_SOURCES   = \
    209209        tstUSBProxyLinux.cpp \
    210         ../src-server/linux/USBProxyServiceLinux.cpp \
     210        ../src-server/linux/USBProxyBackendLinux.cpp \
    211211        ../src-server/linux/USBGetDevices.cpp
    212212tstUSBProxyLinux_INCS      = \
  • trunk/src/VBox/Main/testcase/tstUSBProxyLinux.cpp

    r57358 r59117  
    11/* $Id$ */
    22/** @file
    3  * USBProxyServiceLinux test case.
     3 * USBProxyBackendLinux test case.
    44 */
    55
     
    2121*********************************************************************************************************************************/
    2222
    23 #include "USBProxyService.h"
     23#include "USBProxyBackend.h"
    2424#include "USBGetDevices.h"
    2525
     
    3232/*** BEGIN STUBS ***/
    3333
    34 USBProxyService::USBProxyService(Host*) {}
    35 USBProxyService::~USBProxyService() {}
    36 HRESULT USBProxyService::init() { return S_OK; }
    37 int USBProxyService::start() { return VINF_SUCCESS; }
    38 int USBProxyService::stop() { return VINF_SUCCESS; }
    39 RWLockHandle *USBProxyService::lockHandle() const { return NULL; }
    40 void *USBProxyService::insertFilter(USBFILTER const*) { return NULL; }
    41 void USBProxyService::removeFilter(void*) {}
    42 int USBProxyService::captureDevice(HostUSBDevice*) { return VINF_SUCCESS; }
    43 void USBProxyService::captureDeviceCompleted(HostUSBDevice*, bool) {}
    44 void USBProxyService::detachingDevice(HostUSBDevice*) {}
    45 int USBProxyService::releaseDevice(HostUSBDevice*) { return VINF_SUCCESS; }
    46 void USBProxyService::releaseDeviceCompleted(HostUSBDevice*, bool) {}
    47 void USBProxyService::serviceThreadInit() {}
    48 void USBProxyService::serviceThreadTerm() {}
    49 int USBProxyService::wait(unsigned int) { return VINF_SUCCESS; }
    50 int USBProxyService::interruptWait() { return VINF_SUCCESS; }
    51 PUSBDEVICE USBProxyService::getDevices() { return NULL; }
    52 void USBProxyService::deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList &llOpenedMachines, PUSBDEVICE aUSBDevice) {}
    53 void USBProxyService::deviceRemoved(ComObjPtr<HostUSBDevice> &aDevice) {}
    54 void USBProxyService::deviceChanged(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList*, SessionMachine*) {}
    55 bool USBProxyService::updateDeviceState(HostUSBDevice*, USBDEVICE*, bool*, SessionMachine**) { return true; }
    56 bool USBProxyService::updateDeviceStateFake(HostUSBDevice*, USBDEVICE*, bool*, SessionMachine**) { return true; }
    57 bool USBProxyService::isActive() { return true; }
     34USBProxyBackend::USBProxyBackend(USBProxyService*) {}
     35USBProxyBackend::~USBProxyBackend() {}
     36int USBProxyBackend::init() { return VINF_SUCCESS; }
     37int USBProxyBackend::start() { return VINF_SUCCESS; }
     38int USBProxyBackend::stop() { return VINF_SUCCESS; }
     39RWLockHandle *USBProxyBackend::lockHandle() const { return NULL; }
     40void *USBProxyBackend::insertFilter(USBFILTER const*) { return NULL; }
     41void USBProxyBackend::removeFilter(void*) {}
     42int USBProxyBackend::captureDevice(HostUSBDevice*) { return VINF_SUCCESS; }
     43void USBProxyBackend::captureDeviceCompleted(HostUSBDevice*, bool) {}
     44void USBProxyBackend::detachingDevice(HostUSBDevice*) {}
     45int USBProxyBackend::releaseDevice(HostUSBDevice*) { return VINF_SUCCESS; }
     46void USBProxyBackend::releaseDeviceCompleted(HostUSBDevice*, bool) {}
     47void USBProxyBackend::serviceThreadInit() {}
     48void USBProxyBackend::serviceThreadTerm() {}
     49int USBProxyBackend::wait(unsigned int) { return VINF_SUCCESS; }
     50int USBProxyBackend::interruptWait() { return VINF_SUCCESS; }
     51PUSBDEVICE USBProxyBackend::getDevices() { return NULL; }
     52void USBProxyBackend::deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList &llOpenedMachines, PUSBDEVICE aUSBDevice) {}
     53void USBProxyBackend::deviceRemoved(ComObjPtr<HostUSBDevice> &aDevice) {}
     54void USBProxyBackend::deviceChanged(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList*, SessionMachine*) {}
     55bool USBProxyBackend::updateDeviceState(HostUSBDevice*, USBDEVICE*, bool*, SessionMachine**) { return true; }
     56bool USBProxyBackend::updateDeviceStateFake(HostUSBDevice*, USBDEVICE*, bool*, SessionMachine**) { return true; }
     57bool USBProxyBackend::isActive() { return true; }
    5858
    5959VBoxMainHotplugWaiter::VBoxMainHotplugWaiter(char const*) {}
     
    6262{
    6363    return Utf8Str();
    64 }
    65 
    66 int USBProxyService::getLastError(void)
    67 {
    68     return mLastError;
    6964}
    7065
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette