VirtualBox

Changeset 68938 in vbox for trunk/src/VBox/Main/xml


Ignore:
Timestamp:
Sep 29, 2017 4:13:26 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
118205
Message:

Main,VBoxManage: Changed the CPUID override methods on IMachine to take sub-leaves into account. Currently we do not support non-zero sub-leaves due to VMM, but that can be fixed later.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/xml/Settings.cpp

    r68905 r68938  
    26352635 */
    26362636CpuIdLeaf::CpuIdLeaf() :
    2637     ulId(UINT32_MAX),
    2638     ulEax(0),
    2639     ulEbx(0),
    2640     ulEcx(0),
    2641     ulEdx(0)
     2637    idx(UINT32_MAX),
     2638    idxSub(0),
     2639    uEax(0),
     2640    uEbx(0),
     2641    uEcx(0),
     2642    uEdx(0)
    26422643{
    26432644}
     
    26512652{
    26522653    return (this == &c)
    2653         || (   ulId      == c.ulId
    2654             && ulEax     == c.ulEax
    2655             && ulEbx     == c.ulEbx
    2656             && ulEcx     == c.ulEcx
    2657             && ulEdx     == c.ulEdx);
     2654        || (   idx      == c.idx
     2655            && idxSub   == c.idxSub
     2656            && uEax     == c.uEax
     2657            && uEbx     == c.uEbx
     2658            && uEcx     == c.uEcx
     2659            && uEdx     == c.uEdx);
    26582660}
    26592661
     
    33483350        CpuIdLeaf leaf;
    33493351
    3350         if (!pelmCpuIdLeaf->getAttributeValue("id", leaf.ulId))
     3352        if (!pelmCpuIdLeaf->getAttributeValue("id", leaf.idx))
    33513353            throw ConfigFileError(this, pelmCpuIdLeaf, N_("Required CpuId/@id attribute is missing"));
    33523354
    3353         pelmCpuIdLeaf->getAttributeValue("eax", leaf.ulEax);
    3354         pelmCpuIdLeaf->getAttributeValue("ebx", leaf.ulEbx);
    3355         pelmCpuIdLeaf->getAttributeValue("ecx", leaf.ulEcx);
    3356         pelmCpuIdLeaf->getAttributeValue("edx", leaf.ulEdx);
     3355        if (!pelmCpuIdLeaf->getAttributeValue("subleaf", leaf.idxSub))
     3356            leaf.idxSub = 0;
     3357        pelmCpuIdLeaf->getAttributeValue("eax", leaf.uEax);
     3358        pelmCpuIdLeaf->getAttributeValue("ebx", leaf.uEbx);
     3359        pelmCpuIdLeaf->getAttributeValue("ecx", leaf.uEcx);
     3360        pelmCpuIdLeaf->getAttributeValue("edx", leaf.uEdx);
    33573361
    33583362        ll.push_back(leaf);
     
    53175321
    53185322        xml::ElementNode *pelmCpuIdLeaf = pelmCpuIdTree->createChild("CpuIdLeaf");
    5319         pelmCpuIdLeaf->setAttribute("id",  leaf.ulId);
    5320         pelmCpuIdLeaf->setAttribute("eax", leaf.ulEax);
    5321         pelmCpuIdLeaf->setAttribute("ebx", leaf.ulEbx);
    5322         pelmCpuIdLeaf->setAttribute("ecx", leaf.ulEcx);
    5323         pelmCpuIdLeaf->setAttribute("edx", leaf.ulEdx);
     5323        pelmCpuIdLeaf->setAttribute("id",  leaf.idx);
     5324        if (leaf.idxSub != 0)
     5325            pelmCpuIdLeaf->setAttribute("subleaf",  leaf.idxSub);
     5326        pelmCpuIdLeaf->setAttribute("eax", leaf.uEax);
     5327        pelmCpuIdLeaf->setAttribute("ebx", leaf.uEbx);
     5328        pelmCpuIdLeaf->setAttribute("ecx", leaf.uEcx);
     5329        pelmCpuIdLeaf->setAttribute("edx", leaf.uEdx);
    53245330    }
    53255331
     
    69376943            }
    69386944        }
     6945
     6946        for (CpuIdLeafsList::const_iterator it = hardwareMachine.llCpuIdLeafs.begin();
     6947             it != hardwareMachine.llCpuIdLeafs.end();
     6948             ++it)
     6949            if (it->idxSub != 0)
     6950            {
     6951                m->sv = SettingsVersion_v1_16;
     6952                return;
     6953            }
    69396954    }
    69406955
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