VirtualBox

Changeset 47970 in vbox


Ignore:
Timestamp:
Aug 21, 2013 1:57:27 PM (11 years ago)
Author:
vboxsync
Message:

Main/Appliance: fix USB controller handling in the import code path (when the appliance was created by VirtualBox)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp

    r47964 r47970  
    32843284    if (stack.fUSBEnabled)
    32853285    {
    3286         settings::USBController ctrl;
    3287 
    3288         ctrl.strName = "OHCI";
    3289         ctrl.enmType = USBControllerType_OHCI;
    3290 
    3291         config.hardwareMachine.usbSettings.llUSBControllers.push_back(ctrl);
    3292     }
     3286        /** @todo r=klaus add support for arbitrary USB controller types, this can't handle multiple controllers due to its design anyway */
     3287
     3288        /* usually the OHCI controller is enabled already, need to check */
     3289        bool fOHCIEnabled = false;
     3290        settings::USBControllerList &llUSBControllers = config.hardwareMachine.usbSettings.llUSBControllers;
     3291        settings::USBControllerList::iterator it;
     3292        for (it = llUSBControllers.begin(); it != llUSBControllers.end(); ++it)
     3293        {
     3294            if (it->enmType == USBControllerType_OHCI)
     3295            {
     3296                fOHCIEnabled = true;
     3297                break;
     3298            }
     3299        }
     3300
     3301        if (!fOHCIEnabled)
     3302        {
     3303            settings::USBController ctrl;
     3304            ctrl.strName = "OHCI";
     3305            ctrl.enmType = USBControllerType_OHCI;
     3306
     3307            llUSBControllers.push_back(ctrl);
     3308        }
     3309    }
     3310    else
     3311        config.hardwareMachine.usbSettings.llUSBControllers.clear();
    32933312#endif
    32943313    /* Audio adapter */
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