VirtualBox

Changeset 96854 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Sep 26, 2022 8:48:48 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
153758
Message:

Devices/USB,Main,FE/Qt: Export EHCI and XHCI controller implementations from PUEL extension pack to the base open-source package, bugref:10296

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r96847 r96854  
    21292129                else if (enmCtrlType == USBControllerType_EHCI)
    21302130                {
     2131                    InsertConfigNode(pDevices, "usb-ehci", &pDev);
     2132                    InsertConfigNode(pDev,     "0", &pInst);
     2133                    InsertConfigNode(pInst,    "Config", &pCfg);
     2134                    InsertConfigInteger(pInst, "Trusted", 1); /* boolean */
     2135                    hrc = pBusMgr->assignPCIDevice("usb-ehci", pInst);                  H();
     2136
     2137                    InsertConfigNode(pInst,    "LUN#0", &pLunL0);
     2138                    InsertConfigString(pLunL0, "Driver",               "VUSBRootHub");
     2139                    InsertConfigNode(pLunL0,   "Config", &pCfg);
     2140
    21312141                    /*
    2132                      * USB 2.0 is only available if the proper ExtPack is installed.
    2133                      *
    2134                      * Note. Configuring EHCI here and providing messages about
    2135                      * the missing extpack isn't exactly clean, but it is a
    2136                      * necessary evil to patch over legacy compatability issues
    2137                      * introduced by the new distribution model.
     2142                     * Attach the status driver.
    21382143                     */
    2139 # ifdef VBOX_WITH_EXTPACK
    2140                     static const char *s_pszUsbExtPackName = "Oracle VM VirtualBox Extension Pack";
    2141                     if (mptrExtPackManager->i_isExtPackUsable(s_pszUsbExtPackName))
    2142 # endif
    2143                     {
    2144                         InsertConfigNode(pDevices, "usb-ehci", &pDev);
    2145                         InsertConfigNode(pDev,     "0", &pInst);
    2146                         InsertConfigNode(pInst,    "Config", &pCfg);
    2147                         InsertConfigInteger(pInst, "Trusted", 1); /* boolean */
    2148                         hrc = pBusMgr->assignPCIDevice("usb-ehci", pInst);                  H();
    2149 
    2150                         InsertConfigNode(pInst,    "LUN#0", &pLunL0);
    2151                         InsertConfigString(pLunL0, "Driver",               "VUSBRootHub");
    2152                         InsertConfigNode(pLunL0,   "Config", &pCfg);
    2153 
    2154                         /*
    2155                          * Attach the status driver.
    2156                          */
    2157                         i_attachStatusDriver(pInst, DeviceType_USB, 0, 0, NULL, NULL, NULL, 0);
    2158                     }
    2159 # ifdef VBOX_WITH_EXTPACK
    2160                     else
    2161                     {
    2162                         /* Always fatal! Up to VBox 4.0.4 we allowed to start the VM anyway
    2163                          * but this induced problems when the user saved + restored the VM! */
    2164                         return pVMM->pfnVMR3SetError(pUVM, VERR_NOT_FOUND, RT_SRC_POS,
    2165                                 N_("Implementation of the USB 2.0 controller not found!\n"
    2166                                    "Because the USB 2.0 controller state is part of the saved "
    2167                                    "VM state, the VM cannot be started. To fix "
    2168                                    "this problem, either install the '%s' or disable USB 2.0 "
    2169                                    "support in the VM settings.\n"
    2170                                    "Note! This error could also mean that an incompatible version of "
    2171                                    "the '%s' is installed"),
    2172                                 s_pszUsbExtPackName, s_pszUsbExtPackName);
    2173                     }
    2174 # endif
     2144                    i_attachStatusDriver(pInst, DeviceType_USB, 0, 0, NULL, NULL, NULL, 0);
    21752145                }
    21762146#endif
    21772147                else if (enmCtrlType == USBControllerType_XHCI)
    21782148                {
     2149                    InsertConfigNode(pDevices, "usb-xhci", &pDev);
     2150                    InsertConfigNode(pDev,     "0", &pInst);
     2151                    InsertConfigNode(pInst,    "Config", &pCfg);
     2152                    InsertConfigInteger(pInst, "Trusted", 1); /* boolean */
     2153                    hrc = pBusMgr->assignPCIDevice("usb-xhci", pInst);                  H();
     2154
     2155                    InsertConfigNode(pInst,    "LUN#0", &pLunL0);
     2156                    InsertConfigString(pLunL0, "Driver",               "VUSBRootHub");
     2157                    InsertConfigNode(pLunL0,   "Config", &pCfg);
     2158
     2159                    InsertConfigNode(pInst,    "LUN#1", &pLunL1);
     2160                    InsertConfigString(pLunL1, "Driver",               "VUSBRootHub");
     2161                    InsertConfigNode(pLunL1,   "Config", &pCfg);
     2162
    21792163                    /*
    2180                      * USB 3.0 is only available if the proper ExtPack is installed.
    2181                      *
    2182                      * Note. Configuring EHCI here and providing messages about
    2183                      * the missing extpack isn't exactly clean, but it is a
    2184                      * necessary evil to patch over legacy compatability issues
    2185                      * introduced by the new distribution model.
     2164                     * Attach the status driver.
    21862165                     */
    2187 # ifdef VBOX_WITH_EXTPACK
    2188                     static const char *s_pszUsbExtPackName = "Oracle VM VirtualBox Extension Pack";
    2189                     if (mptrExtPackManager->i_isExtPackUsable(s_pszUsbExtPackName))
    2190 # endif
    2191                     {
    2192                         InsertConfigNode(pDevices, "usb-xhci", &pDev);
    2193                         InsertConfigNode(pDev,     "0", &pInst);
    2194                         InsertConfigNode(pInst,    "Config", &pCfg);
    2195                         InsertConfigInteger(pInst, "Trusted", 1); /* boolean */
    2196                         hrc = pBusMgr->assignPCIDevice("usb-xhci", pInst);                  H();
    2197 
    2198                         InsertConfigNode(pInst,    "LUN#0", &pLunL0);
    2199                         InsertConfigString(pLunL0, "Driver",               "VUSBRootHub");
    2200                         InsertConfigNode(pLunL0,   "Config", &pCfg);
    2201 
    2202                         InsertConfigNode(pInst,    "LUN#1", &pLunL1);
    2203                         InsertConfigString(pLunL1, "Driver",               "VUSBRootHub");
    2204                         InsertConfigNode(pLunL1,   "Config", &pCfg);
    2205 
    2206                         /*
    2207                          * Attach the status driver.
    2208                          */
    2209                         i_attachStatusDriver(pInst, DeviceType_USB, 0, 1, NULL, NULL, NULL, 0);
    2210                     }
    2211 # ifdef VBOX_WITH_EXTPACK
    2212                     else
    2213                     {
    2214                         /* Always fatal. */
    2215                         return pVMM->pfnVMR3SetError(pUVM, VERR_NOT_FOUND, RT_SRC_POS,
    2216                                 N_("Implementation of the USB 3.0 controller not found!\n"
    2217                                    "Because the USB 3.0 controller state is part of the saved "
    2218                                    "VM state, the VM cannot be started. To fix "
    2219                                    "this problem, either install the '%s' or disable USB 3.0 "
    2220                                    "support in the VM settings"),
    2221                                 s_pszUsbExtPackName);
    2222                     }
    2223 # endif
     2166                    i_attachStatusDriver(pInst, DeviceType_USB, 0, 1, NULL, NULL, NULL, 0);
    22242167                }
    22252168            } /* for every USB controller. */
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r96407 r96854  
    1600916009    if (!usbDeviceFilters.isNull() && recommendedUSB3 && usbProxyAvailable)
    1601016010    {
    16011 #ifdef VBOX_WITH_EXTPACK
    16012         /* USB 3.0 is only available if the proper ExtPack is installed. */
    16013         ExtPackManager *aManager = mParent->i_getExtPackManager();
    16014         if (aManager->i_isExtPackUsable(ORACLE_PUEL_EXTPACK_NAME))
    16015         {
    16016             rc = addUSBController("XHCI", USBControllerType_XHCI, usbController);
    16017             if (FAILED(rc)) return rc;
    16018 
    16019             /* xHci includes OHCI */
    16020             ohciEnabled = true;
    16021         }
    16022 #endif
     16011        rc = addUSBController("XHCI", USBControllerType_XHCI, usbController);
     16012        if (FAILED(rc)) return rc;
     16013
     16014        /* xHci includes OHCI */
     16015        ohciEnabled = true;
    1602316016    }
    1602416017    if (   !ohciEnabled
     
    1602916022        ohciEnabled = true;
    1603016023
    16031 #ifdef VBOX_WITH_EXTPACK
    16032         /* USB 2.0 is only available if the proper ExtPack is installed.
    16033          * Note. Configuring EHCI here and providing messages about
    16034          * the missing extpack isn't exactly clean, but it is a
    16035          * necessary evil to patch over legacy compatability issues
    16036           * introduced by the new distribution model. */
    16037         ExtPackManager *manager = mParent->i_getExtPackManager();
    16038         if (manager->i_isExtPackUsable(ORACLE_PUEL_EXTPACK_NAME))
    16039         {
    16040             rc = addUSBController("EHCI", USBControllerType_EHCI, usbController);
    16041             if (FAILED(rc)) return rc;
    16042         }
    16043 #endif
     16024        rc = addUSBController("EHCI", USBControllerType_EHCI, usbController);
     16025        if (FAILED(rc)) return rc;
    1604416026    }
    1604516027
  • trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp

    r96670 r96854  
    18121812HRESULT SystemProperties::getSupportedUSBControllerTypes(std::vector<USBControllerType_T> &aSupportedUSBControllerTypes)
    18131813{
    1814     static const USBControllerType_T aUSBControllerTypesWithoutExtPack[] =
    1815     {
    1816         USBControllerType_OHCI,
    1817     };
    1818     static const USBControllerType_T aUSBControllerTypesWithExtPack[] =
     1814    static const USBControllerType_T aUSBControllerTypes[] =
    18191815    {
    18201816        USBControllerType_OHCI,
     
    18221818        USBControllerType_XHCI,
    18231819    };
    1824     bool fExtPack = false;
    1825 # ifdef VBOX_WITH_EXTPACK
    1826     static const char *s_pszUsbExtPackName = "Oracle VM VirtualBox Extension Pack";
    1827     if (mParent->i_getExtPackManager()->i_isExtPackUsable(s_pszUsbExtPackName))
    1828 # endif
    1829     {
    1830         fExtPack = true;
    1831     }
    1832 
    1833     if (fExtPack)
    1834         aSupportedUSBControllerTypes.assign(aUSBControllerTypesWithExtPack,
    1835                                             aUSBControllerTypesWithExtPack + RT_ELEMENTS(aUSBControllerTypesWithExtPack));
    1836     else
    1837         aSupportedUSBControllerTypes.assign(aUSBControllerTypesWithoutExtPack,
    1838                                             aUSBControllerTypesWithoutExtPack + RT_ELEMENTS(aUSBControllerTypesWithoutExtPack));
     1820    aSupportedUSBControllerTypes.assign(aUSBControllerTypes,
     1821                                        aUSBControllerTypes + RT_ELEMENTS(aUSBControllerTypes));
    18391822    return S_OK;
    18401823}
Note: See TracChangeset for help on using the changeset viewer.

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