VirtualBox

Changeset 24255 in vbox for trunk/src


Ignore:
Timestamp:
Nov 2, 2009 2:04:08 PM (15 years ago)
Author:
vboxsync
Message:

ConsoleImpl: don't need controllerDevToBool() anymore

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r24250 r24255  
    26552655        default:
    26562656            return NULL;
    2657     }
    2658 }
    2659 
    2660 void Console::controllerDevToBool(const char *pszCtrlDev, bool *afBool)
    2661 {
    2662     if (!strcmp("lsilogicscsi", pszCtrlDev))
    2663     {
    2664         afBool[StorageControllerType_LsiLogic] = true;
    2665     }
    2666     else if (!strcmp("buslogic", pszCtrlDev))
    2667     {
    2668         afBool[StorageControllerType_BusLogic] = true;
    2669     }
    2670     else if (!strcmp("ahci", pszCtrlDev))
    2671     {
    2672         afBool[StorageControllerType_IntelAhci] = true;
    2673     }
    2674     else if (!strcmp("piix3ide", pszCtrlDev))
    2675     {
    2676         afBool[StorageControllerType_PIIX3] = true;
    2677         afBool[StorageControllerType_PIIX4] = true;
    2678         afBool[StorageControllerType_ICH6]  = true;
    2679     }
    2680     else if (!strcmp("i82078", pszCtrlDev))
    2681     {
    2682         afBool[StorageControllerType_I82078] = true;
    26832657    }
    26842658}
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r24250 r24255  
    766766     */
    767767    com::SafeIfaceArray<IStorageController> ctrls;
    768     bool afNodePresent[StorageControllerType_I82078 + 1] = {};
     768    PCFGMNODE aCtrlNodes[StorageControllerType_I82078 + 1] = {};
    769769    hrc = pMachine->COMGETTER(StorageControllers)(ComSafeArrayAsOutParam(ctrls));   H();
    770770
     
    785785        const char *pszCtrlDev = pConsole->controllerTypeToDev(enmCtrlType);
    786786
    787         if (!afNodePresent[enmCtrlType])
     787        if (aCtrlNodes[enmCtrlType])
     788            pDev = aCtrlNodes[enmCtrlType];
     789        else
    788790        {
    789791            rc = CFGMR3InsertNode(pDevices, pszCtrlDev, &pDev);                     RC_CHECK();
    790             pConsole->controllerDevToBool(pszCtrlDev, afNodePresent);
    791         }
    792         else
    793         {
    794             pDev = CFGMR3GetChildF(pDevices, pszCtrlDev);
    795             if (!pDev)
    796                 rc = VERR_CFGM_CHILD_NOT_FOUND;                                     RC_CHECK();
    797         }
     792
     793            if (   (enmCtrlType == StorageControllerType_PIIX3)
     794                || (enmCtrlType == StorageControllerType_PIIX4)
     795                || (enmCtrlType == StorageControllerType_ICH6))
     796            {
     797                aCtrlNodes[StorageControllerType_PIIX3] = pDev;
     798                aCtrlNodes[StorageControllerType_PIIX4] = pDev;
     799                aCtrlNodes[StorageControllerType_ICH6]  = pDev;
     800            }
     801            else
     802                aCtrlNodes[enmCtrlType] = pDev;
     803        }
     804
    798805        rc = CFGMR3InsertNodeF(pDev, &pCtlInst, "%u", ulInstance);                  RC_CHECK();
    799806
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r24250 r24255  
    443443                                          const char *pszFormat, bool fPassthrough);
    444444    const char *controllerTypeToDev(StorageControllerType_T enmCtrlType);
    445     void controllerDevToBool(const char *pszCtrlDev, bool *afBool);
    446445    HRESULT convertBusPortDeviceToLun(StorageBus_T enmBus, LONG port, LONG device, unsigned &uLun);
    447446    HRESULT doMediumChange(IMediumAttachment *aMediumAttachment);
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