VirtualBox

Changeset 45664 in vbox for trunk/src


Ignore:
Timestamp:
Apr 22, 2013 12:32:23 PM (12 years ago)
Author:
vboxsync
Message:

tstVMM: the current behavior is that either raw mode or VT-x/AMD-V mode is allowed but not both

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/testcase/tstVMM.cpp

    r44528 r45664  
    152152    NOREF(pvUser);
    153153    int rc = CFGMR3ConstructDefaultTree(pVM);
    154     if (    RT_SUCCESS(rc)
    155         &&  g_cCpus > 1)
     154    if (RT_SUCCESS(rc))
    156155    {
    157156        PCFGMNODE pRoot = CFGMR3GetRoot(pVM);
    158         CFGMR3RemoveValue(pRoot, "NumCPUs");
    159         rc = CFGMR3InsertInteger(pRoot, "NumCPUs", g_cCpus);
    160         RTTESTI_CHECK_MSG_RET(RT_SUCCESS(rc), ("CFGMR3InsertInteger(pRoot,\"NumCPUs\",) -> %Rrc\n", rc), rc);
    161 
    162         CFGMR3RemoveValue(pRoot, "HwVirtExtForced");
    163         rc = CFGMR3InsertInteger(pRoot, "HwVirtExtForced", true);
    164         RTTESTI_CHECK_MSG_RET(RT_SUCCESS(rc), ("CFGMR3InsertInteger(pRoot,\"HwVirtExtForced\",) -> %Rrc\n", rc), rc);
    165 
    166         PCFGMNODE pHwVirtExt = CFGMR3GetChild(pRoot, "HWVirtExt");
    167         CFGMR3RemoveNode(pHwVirtExt);
    168         rc = CFGMR3InsertNode(pRoot, "HWVirtExt", &pHwVirtExt);
    169         RTTESTI_CHECK_MSG_RET(RT_SUCCESS(rc), ("CFGMR3InsertNode(pRoot,\"HWVirtExt\",) -> %Rrc\n", rc), rc);
    170         rc = CFGMR3InsertInteger(pHwVirtExt, "Enabled", true);
    171         RTTESTI_CHECK_MSG_RET(RT_SUCCESS(rc), ("CFGMR3InsertInteger(pHwVirtExt,\"Enabled\",) -> %Rrc\n", rc), rc);
    172         rc = CFGMR3InsertInteger(pHwVirtExt, "64bitEnabled", false);
    173         RTTESTI_CHECK_MSG_RET(RT_SUCCESS(rc), ("CFGMR3InsertInteger(pHwVirtExt,\"64bitEnabled\",) -> %Rrc\n", rc), rc);
     157        if (g_cCpus < 2)
     158        {
     159            rc = CFGMR3InsertInteger(pRoot, "HMEnabled", false);
     160            RTTESTI_CHECK_MSG_RET(RT_SUCCESS(rc),
     161                                  ("CFGMR3InsertInteger(pRoot,\"HMEnabled\",) -> %Rrc\n", rc), rc);
     162        }
     163        else if (g_cCpus > 1)
     164        {
     165            CFGMR3RemoveValue(pRoot, "NumCPUs");
     166            rc = CFGMR3InsertInteger(pRoot, "NumCPUs", g_cCpus);
     167            RTTESTI_CHECK_MSG_RET(RT_SUCCESS(rc),
     168                                  ("CFGMR3InsertInteger(pRoot,\"NumCPUs\",) -> %Rrc\n", rc), rc);
     169
     170            CFGMR3RemoveValue(pRoot, "HwVirtExtForced");
     171            rc = CFGMR3InsertInteger(pRoot, "HwVirtExtForced", true);
     172            RTTESTI_CHECK_MSG_RET(RT_SUCCESS(rc),
     173                                  ("CFGMR3InsertInteger(pRoot,\"HwVirtExtForced\",) -> %Rrc\n", rc), rc);
     174            PCFGMNODE pHwVirtExt = CFGMR3GetChild(pRoot, "HWVirtExt");
     175            CFGMR3RemoveNode(pHwVirtExt);
     176            rc = CFGMR3InsertNode(pRoot, "HWVirtExt", &pHwVirtExt);
     177            RTTESTI_CHECK_MSG_RET(RT_SUCCESS(rc),
     178                                  ("CFGMR3InsertNode(pRoot,\"HWVirtExt\",) -> %Rrc\n", rc), rc);
     179            rc = CFGMR3InsertInteger(pHwVirtExt, "Enabled", true);
     180            RTTESTI_CHECK_MSG_RET(RT_SUCCESS(rc),
     181                                  ("CFGMR3InsertInteger(pHwVirtExt,\"Enabled\",) -> %Rrc\n", rc), rc);
     182            rc = CFGMR3InsertInteger(pHwVirtExt, "64bitEnabled", false);
     183            RTTESTI_CHECK_MSG_RET(RT_SUCCESS(rc),
     184                                  ("CFGMR3InsertInteger(pHwVirtExt,\"64bitEnabled\",) -> %Rrc\n", rc), rc);
     185        }
    174186    }
    175187    return rc;
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