VirtualBox

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


Ignore:
Timestamp:
Jan 28, 2013 12:06:54 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
83393
Message:

Main: One more use of PVM and some other cleanups.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r44402 r44419  
    55
    66/*
    7  * Copyright (C) 2005-2012 Oracle Corporation
     7 * Copyright (C) 2005-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    521521    static DECLCALLBACK(int) configConstructor(PUVM pUVM, PVM pVM, void *pvConsole);
    522522    int configConstructorInner(PUVM pUVM, PVM pVM, AutoWriteLock *pAlock);
    523     int configCfgmOverlay(PVM pVM, IVirtualBox *pVirtualBox, IMachine *pMachine);
     523    int configCfgmOverlay(PCFGMNODE pRoot, IVirtualBox *pVirtualBox, IMachine *pMachine);
    524524    int configDumpAPISettingsTweaks(IVirtualBox *pVirtualBox, IMachine *pMachine);
    525525
     
    576576                                                   bool fForce);
    577577
    578     HRESULT attachRawPCIDevices(PVM pVM, BusAssignmentManager *BusMgr, PCFGMNODE pDevices);
     578    HRESULT attachRawPCIDevices(PUVM pUVM, BusAssignmentManager *BusMgr, PCFGMNODE pDevices);
    579579    void attachStatusDriver(PCFGMNODE pCtlInst, PPDMLED *papLeds,
    580580                            uint64_t uFirst, uint64_t uLast,
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r44402 r44419  
    55
    66/*
    7  * Copyright (C) 2005-2012 Oracle Corporation
     7 * Copyright (C) 2005-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    75497549                 * deadlock).
    75507550                 */
    7551                 std::auto_ptr<VMPowerDownTask> task(new VMPowerDownTask(that,
    7552                                                                         pProgress));
     7551                std::auto_ptr<VMPowerDownTask> task(new VMPowerDownTask(that, pProgress));
    75537552
    75547553                 /* If creating a task failed, this can currently mean one of
     
    75657564
    75667565                int vrc = RTThreadCreate(NULL, Console::powerDownThread,
    7567                                          (void *) task.get(), 0,
     7566                                         (void *)task.get(), 0,
    75687567                                         RTTHREADTYPE_MAIN_WORKER, 0,
    75697568                                         "VMPwrDwn");
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r44399 r44419  
    479479
    480480#ifdef VBOX_WITH_PCI_PASSTHROUGH
    481 HRESULT Console::attachRawPCIDevices(PVM pVM,
    482                                      BusAssignmentManager *BusMgr,
    483                                      PCFGMNODE            pDevices)
     481HRESULT Console::attachRawPCIDevices(PUVM pUVM, BusAssignmentManager *pBusMgr, PCFGMNODE pDevices)
    484482{
    485483    HRESULT hrc = S_OK;
     
    505503    static const char *s_pszPCIRawExtPackName = "Oracle VM VirtualBox Extension Pack";
    506504    if (!mptrExtPackManager->isExtPackUsable(s_pszPCIRawExtPackName))
    507     {
    508505        /* Always fatal! */
    509         return VMSetError(pVM, VERR_NOT_FOUND, RT_SRC_POS,
     506        return VMR3SetError(pUVM, VERR_NOT_FOUND, RT_SRC_POS,
    510507                N_("Implementation of the PCI passthrough framework not found!\n"
    511508                   "The VM cannot be started. To fix this problem, either "
    512509                   "install the '%s' or disable PCI passthrough via VBoxManage"),
    513510                s_pszPCIRawExtPackName);
    514     }
    515511# endif
    516512
     
    534530            int iBase = GuestPCIAddress.miBus - 1;
    535531
    536             while (!BusMgr->hasPCIDevice("ich9pcibridge", iBase) && iBase > 0)
     532            while (!pBusMgr->hasPCIDevice("ich9pcibridge", iBase) && iBase > 0)
    537533            {
    538534                iBridgesMissed++; iBase--;
     
    544540                InsertConfigNode(pBridges, Utf8StrFmt("%d", iBase + iBridge).c_str(), &pInst);
    545541                InsertConfigInteger(pInst, "Trusted",              1);
    546                 hrc = BusMgr->assignPCIDevice("ich9pcibridge", pInst);
     542                hrc = pBusMgr->assignPCIDevice("ich9pcibridge", pInst);
    547543            }
    548544        }
     
    597593        GuestPCIAddress.fromLong(guest);
    598594        Assert(GuestPCIAddress.valid());
    599         hrc = BusMgr->assignHostPCIDevice("pciraw", pInst, HostPCIAddress, GuestPCIAddress, true);
     595        hrc = pBusMgr->assignHostPCIDevice("pciraw", pInst, HostPCIAddress, GuestPCIAddress, true);
    600596        if (hrc != S_OK)
    601597            return hrc;
     
    759755    }
    760756
    761     BusAssignmentManager* BusMgr = mBusMgr = BusAssignmentManager::createInstance(chipsetType);
     757    BusAssignmentManager *pBusMgr = mBusMgr = BusAssignmentManager::createInstance(chipsetType);
    762758
    763759    ULONG cCpus = 1;
     
    11471143            InsertConfigNode(pDev,     "0", &pInst);
    11481144            InsertConfigInteger(pInst, "Trusted",              1); /* boolean */
    1149             hrc = BusMgr->assignPCIDevice("ich9pcibridge", pInst);                          H();
     1145            hrc = pBusMgr->assignPCIDevice("ich9pcibridge", pInst);                         H();
    11501146
    11511147            InsertConfigNode(pDev,     "1", &pInst);
    11521148            InsertConfigInteger(pInst, "Trusted",              1); /* boolean */
    1153             hrc = BusMgr->assignPCIDevice("ich9pcibridge", pInst);                          H();
     1149            hrc = pBusMgr->assignPCIDevice("ich9pcibridge", pInst);                         H();
    11541150
    11551151#ifdef VBOX_WITH_PCI_PASSTHROUGH
    11561152            /* Add PCI passthrough devices */
    1157             hrc = attachRawPCIDevices(pVM, BusMgr, pDevices);                               H();
     1153            hrc = attachRawPCIDevices(pUVM, pBusMgr, pDevices);                             H();
    11581154#endif
    11591155        }
     
    12131209            InsertConfigNode(pDevices, "lpc", &pDev);
    12141210            InsertConfigNode(pDev,     "0", &pInst);
    1215             hrc = BusMgr->assignPCIDevice("lpc", pInst);                                    H();
     1211            hrc = pBusMgr->assignPCIDevice("lpc", pInst);                                   H();
    12161212            InsertConfigInteger(pInst, "Trusted",   1); /* boolean */
    12171213        }
     
    13091305        InsertConfigInteger(pInst, "Trusted",              1); /* boolean */
    13101306
    1311         hrc = BusMgr->assignPCIDevice("vga", pInst);                                        H();
     1307        hrc = pBusMgr->assignPCIDevice("vga", pInst);                                       H();
    13121308        InsertConfigNode(pInst,    "Config", &pCfg);
    13131309        ULONG cVRamMBs;
     
    15881584                case StorageControllerType_LsiLogic:
    15891585                {
    1590                     hrc = BusMgr->assignPCIDevice("lsilogic", pCtlInst);                    H();
     1586                    hrc = pBusMgr->assignPCIDevice("lsilogic", pCtlInst);                   H();
    15911587
    15921588                    InsertConfigInteger(pCfg, "Bootable",  fBootable);
     
    16021598                case StorageControllerType_BusLogic:
    16031599                {
    1604                     hrc = BusMgr->assignPCIDevice("buslogic", pCtlInst);                    H();
     1600                    hrc = pBusMgr->assignPCIDevice("buslogic", pCtlInst);                   H();
    16051601
    16061602                    InsertConfigInteger(pCfg, "Bootable",  fBootable);
     
    16161612                case StorageControllerType_IntelAhci:
    16171613                {
    1618                     hrc = BusMgr->assignPCIDevice("ahci", pCtlInst);                        H();
     1614                    hrc = pBusMgr->assignPCIDevice("ahci", pCtlInst);                       H();
    16191615
    16201616                    ULONG cPorts = 0;
     
    16241620
    16251621                    /* Needed configuration values for the bios, only first controller. */
    1626                     if (!BusMgr->hasPCIDevice("ahci", 1))
     1622                    if (!pBusMgr->hasPCIDevice("ahci", 1))
    16271623                    {
    16281624#define MAX_SATA_LUN_COUNT 4
     
    17131709                     * IDE (update this when the main interface changes)
    17141710                     */
    1715                     hrc = BusMgr->assignPCIDevice("piix3ide", pCtlInst);                    H();
     1711                    hrc = pBusMgr->assignPCIDevice("piix3ide", pCtlInst);                   H();
    17161712                    InsertConfigString(pCfg,   "Type", controllerString(enmCtrlType));
    17171713                    /* Attach the status driver */
     
    17491745                case StorageControllerType_LsiLogicSas:
    17501746                {
    1751                     hrc = BusMgr->assignPCIDevice("lsilogicsas", pCtlInst);                 H();
     1747                    hrc = pBusMgr->assignPCIDevice("lsilogicsas", pCtlInst);                H();
    17521748
    17531749                    InsertConfigString(pCfg,  "ControllerType", "SAS1068");
     
    18981894#endif
    18991895            PCIBusAddress PCIAddr = PCIBusAddress(0, iPCIDeviceNo, 0);
    1900             hrc = BusMgr->assignPCIDevice(pszAdapterName, pInst, PCIAddr);                  H();
     1896            hrc = pBusMgr->assignPCIDevice(pszAdapterName, pInst, PCIAddr);                 H();
    19011897
    19021898            InsertConfigNode(pInst, "Config", &pCfg);
     
    21312127        InsertConfigNode(pInst,    "Config", &pCfg);
    21322128        InsertConfigInteger(pInst, "Trusted",              1); /* boolean */
    2133         hrc = BusMgr->assignPCIDevice("VMMDev", pInst);                                     H();
     2129        hrc = pBusMgr->assignPCIDevice("VMMDev", pInst);                                    H();
    21342130
    21352131        Bstr hwVersion;
     
    21882184                    InsertConfigNode(pDev,     "0", &pInst);
    21892185                    InsertConfigInteger(pInst, "Trusted",          1); /* boolean */
    2190                     hrc = BusMgr->assignPCIDevice("ichac97", pInst);                        H();
     2186                    hrc = pBusMgr->assignPCIDevice("ichac97", pInst);                       H();
    21912187                    InsertConfigNode(pInst,    "Config", &pCfg);
    21922188                    break;
     
    22122208                    InsertConfigNode(pDev,     "0", &pInst);
    22132209                    InsertConfigInteger(pInst, "Trusted",          1); /* boolean */
    2214                     hrc = BusMgr->assignPCIDevice("hda", pInst);                            H();
     2210                    hrc = pBusMgr->assignPCIDevice("hda", pInst);                           H();
    22152211                    InsertConfigNode(pInst,    "Config", &pCfg);
    22162212                }
     
    23112307                InsertConfigNode(pInst,    "Config", &pCfg);
    23122308                InsertConfigInteger(pInst, "Trusted",              1); /* boolean */
    2313                 hrc = BusMgr->assignPCIDevice("usb-ohci", pInst);                           H();
     2309                hrc = pBusMgr->assignPCIDevice("usb-ohci", pInst);                          H();
    23142310                InsertConfigNode(pInst,    "LUN#0", &pLunL0);
    23152311                InsertConfigString(pLunL0, "Driver",               "VUSBRootHub");
     
    23432339                        InsertConfigNode(pInst,    "Config", &pCfg);
    23442340                        InsertConfigInteger(pInst, "Trusted", 1); /* boolean */
    2345                         hrc = BusMgr->assignPCIDevice("usb-ehci", pInst);                   H();
     2341                        hrc = pBusMgr->assignPCIDevice("usb-ehci", pInst);                  H();
    23462342
    23472343                        InsertConfigNode(pInst,    "LUN#0", &pLunL0);
     
    26912687            InsertConfigInteger(pInst, "Trusted", 1); /* boolean */
    26922688            InsertConfigNode(pInst,    "Config", &pCfg);
    2693             hrc = BusMgr->assignPCIDevice("acpi", pInst);                                   H();
     2689            hrc = pBusMgr->assignPCIDevice("acpi", pInst);                                  H();
    26942690
    26952691            InsertConfigInteger(pCfg,  "RamSize",          cbRam);
     
    27112707            {
    27122708                PCIBusAddress Address;
    2713                 if (BusMgr->findPCIAddress("hda", 0, Address))
     2709                if (pBusMgr->findPCIAddress("hda", 0, Address))
    27142710                {
    27152711                    uint32_t u32AudioPCIAddr = (Address.miDevice << 16) | Address.miFn;
     
    28192815     */
    28202816    if (RT_SUCCESS(rc))
    2821         rc = configCfgmOverlay(pVM, virtualBox, pMachine);
     2817        rc = configCfgmOverlay(pRoot, virtualBox, pMachine);
    28222818
    28232819    /*
     
    28652861 */
    28662862/* static */
    2867 int Console::configCfgmOverlay(PVM pVM, IVirtualBox *pVirtualBox, IMachine *pMachine)
     2863int Console::configCfgmOverlay(PCFGMNODE pRoot, IVirtualBox *pVirtualBox, IMachine *pMachine)
    28682864{
    28692865    /*
     
    28802876     * extra data to support global settings with local overrides.
    28812877     */
    2882     PCFGMNODE pRoot = CFGMR3GetRoot(pVM);
    2883     int       rc    = VINF_SUCCESS;
     2878    int rc = VINF_SUCCESS;
    28842879    try
    28852880    {
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