VirtualBox

Changeset 31326 in vbox


Ignore:
Timestamp:
Aug 3, 2010 9:56:22 AM (14 years ago)
Author:
vboxsync
Message:

Pass on cpu priority property.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vm.h

    r31123 r31326  
    705705    /** Number of virtual CPUs. */
    706706    uint32_t                    cCpus;
     707    /** CPU priority (1-100) */
     708    uint32_t                    uCpuPriority;
    707709
    708710    /** Size of the VM structure including the VMCPU array. */
     
    713715
    714716    /** Reserved; alignment. */
    715     uint32_t                    u32Reserved[6];
     717    uint32_t                    u32Reserved[5];
    716718
    717719    /** @name Public VMM Switcher APIs
  • trunk/include/VBox/vm.mac

    r28800 r31326  
    5353    .hSelf                  resd 1
    5454    .cCpus                  resd 1
     55    .uCpuPriority           resd 1
    5556    .cbSelf                 resd 1
    5657    .offVMCPU               resd 1
    57     .u32Reserved            resd 6
     58    .u32Reserved            resd 5
    5859
    5960    .pfnVMMGCGuestToHostAsmGuestCtx RTRCPTR_RES 1
  • trunk/include/VBox/vmapi.h

    r28800 r31326  
    406406VMMR3DECL(int)              VMR3HotUnplugCpu(PVM pVM, VMCPUID idCpu);
    407407VMMR3DECL(int)              VMR3HotPlugCpu(PVM pVM, VMCPUID idCpu);
    408 
     408VMMR3DECL(int)              VMR3SetCpuPriority(PVM pVM, unsigned ulCpuPriority);
    409409/** @} */
    410410#endif /* IN_RING3 */
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r31287 r31326  
    534534    hrc = pMachine->COMGETTER(CPUCount)(&cCpus);                                        H();
    535535
     536    ULONG ulCpuPriority = 100;
     537    hrc = pMachine->COMGETTER(CPUPriority)(&ulCpuPriority);                             H();
     538
    536539    Bstr osTypeId;
    537540    hrc = pMachine->COMGETTER(OSTypeId)(osTypeId.asOutParam());                         H();
     
    567570        InsertConfigInteger(pRoot, "RamHoleSize",          cbRamHole);
    568571        InsertConfigInteger(pRoot, "NumCPUs",              cCpus);
     572        InsertConfigInteger(pRoot, "CpuPriority",          ulCpuPriority);
    569573        InsertConfigInteger(pRoot, "TimerMillies",         10);
    570574#ifdef VBOX_WITH_RAW_MODE
  • trunk/src/VBox/VMM/VM.cpp

    r30473 r31326  
    561561        AssertRelease(pVM->pSession == pUVM->vm.s.pSession);
    562562        AssertRelease(pVM->cCpus == cCpus);
     563        AssertRelease(pVM->uCpuPriority == 100);
    563564        AssertRelease(pVM->offVMCPU == RT_UOFFSETOF(VM, aCpus));
    564565
     
    589590        if (RT_SUCCESS(rc))
    590591        {
    591             rc = CFGMR3QueryBoolDef(CFGMR3GetRoot(pVM), "HwVirtExtForced", &pVM->fHwVirtExtForced, false);
     592            PCFGMNODE pRoot = CFGMR3GetRoot(pVM);
     593            rc = CFGMR3QueryBoolDef(pRoot, "HwVirtExtForced", &pVM->fHwVirtExtForced, false);
    592594            if (RT_SUCCESS(rc) && pVM->fHwVirtExtForced)
    593595                pVM->fHWACCMEnabled = true;
     
    599601            if (psz && !strcmp(psz, "fake"))
    600602            {
    601                 CFGMR3RemoveValue(CFGMR3GetRoot(pVM), "RawR3Enabled");
    602                 CFGMR3InsertInteger(CFGMR3GetRoot(pVM), "RawR3Enabled", 0);
    603                 CFGMR3RemoveValue(CFGMR3GetRoot(pVM), "RawR0Enabled");
    604                 CFGMR3InsertInteger(CFGMR3GetRoot(pVM), "RawR0Enabled", 0);
     603                CFGMR3RemoveValue(pRoot, "RawR3Enabled");
     604                CFGMR3InsertInteger(pRoot, "RawR3Enabled", 0);
     605                CFGMR3RemoveValue(pRoot, "RawR0Enabled");
     606                CFGMR3InsertInteger(pRoot, "RawR0Enabled", 0);
    605607            }
    606608
     
    611613            {
    612614                uint32_t cCPUsCfg;
    613                 rc = CFGMR3QueryU32Def(CFGMR3GetRoot(pVM), "NumCPUs", &cCPUsCfg, 1);
     615                rc = CFGMR3QueryU32Def(pRoot, "NumCPUs", &cCPUsCfg, 1);
    614616                AssertLogRelMsgRC(rc, ("Configuration error: Querying \"NumCPUs\" as integer failed, rc=%Rrc\n", rc));
    615617                if (RT_SUCCESS(rc) && cCPUsCfg != cCpus)
     
    622624            if (RT_SUCCESS(rc))
    623625            {
     626                rc = CFGMR3QueryU32Def(pRoot, "CpuPriority", &pVM->uCpuPriority, 100);
     627                AssertLogRelMsgRC(rc, ("Configuration error: Querying \"CpuPriority\" as integer failed, rc=%Rrc\n", rc));
     628
    624629                /*
    625630                 * Init the ring-3 components and ring-3 per cpu data, finishing it off
  • trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp

    r30334 r31326  
    588588                        pGVM->hSelf     = iHandle;
    589589                        pGVM->pVM       = NULL;
    590                         pGVM->cCpus     = cCpus;
     590                        pGVM->cCpus     = cCpus;                       
    591591
    592592                        gvmmR0InitPerVMData(pGVM);
     
    607607                            PVM pVM = (PVM)RTR0MemObjAddress(pGVM->gvmm.s.VMMemObj); AssertPtr(pVM);
    608608                            memset(pVM, 0, cPages << PAGE_SHIFT);
    609                             pVM->enmVMState = VMSTATE_CREATING;
    610                             pVM->pVMR0      = pVM;
    611                             pVM->pSession   = pSession;
    612                             pVM->hSelf      = iHandle;
    613                             pVM->cbSelf     = cbVM;
    614                             pVM->cCpus      = cCpus;
    615                             pVM->offVMCPU   = RT_UOFFSETOF(VM, aCpus);
     609                            pVM->enmVMState     = VMSTATE_CREATING;
     610                            pVM->pVMR0          = pVM;
     611                            pVM->pSession       = pSession;
     612                            pVM->hSelf          = iHandle;
     613                            pVM->cbSelf         = cbVM;
     614                            pVM->cCpus          = cCpus;
     615                            pVM->uCpuPriority   = 100; /* default is maximum priority. */
     616                            pVM->offVMCPU       = RT_UOFFSETOF(VM, aCpus);
    616617
    617618                            rc = RTR0MemObjAllocPage(&pGVM->gvmm.s.VMPagesMemObj, cPages * sizeof(SUPPAGE), false /* fExecutable */);
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