VirtualBox

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


Ignore:
Timestamp:
Feb 8, 2011 1:20:04 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
69897
Message:

Main, VMM, vboxshell: more PCI work (persistent settings, logging, more driver API), API consumer in vboxshell

File:
1 edited

Legend:

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

    r35818 r35885  
    9191
    9292/** VirtualBox XML settings version number substring ("x.y")  */
    93 #define VBOX_XML_VERSION        "1.11"
     93#define VBOX_XML_VERSION        "1.12"
    9494
    9595/** VirtualBox XML settings version platform substring */
     
    320320                else if (ulMinor == 11)
    321321                    m->sv = SettingsVersion_v1_11;
    322                 else if (ulMinor > 11)
     322                else if (ulMinor == 12)
     323                    m->sv = SettingsVersion_v1_12;
     324                else if (ulMinor > 12)
    323325                    m->sv = SettingsVersion_Future;
    324326            }
     
    340342        // creating new settings file:
    341343        m->strSettingsVersionFull = VBOX_XML_VERSION_FULL;
    342         m->sv = SettingsVersion_v1_11;
     344        m->sv = SettingsVersion_v1_12;
    343345    }
    344346}
     
    818820            break;
    819821
     822        case SettingsVersion_v1_12:
     823            pcszVersion = "1.12";
     824            break;
     825
    820826        case SettingsVersion_Future:
    821827            // can be set if this code runs on XML files that were created by a future version of VBox;
    822828            // in that case, downgrade to current version when writing since we can't write future versions...
    823             pcszVersion = "1.11";
    824             m->sv = SettingsVersion_v1_10;
     829            pcszVersion = "1.12";
     830            m->sv = SettingsVersion_v1_12;
    825831        break;
    826832
     
    846852 * set the "sv" member to the required settings version that is to
    847853 * be written. For newly created files, the settings version will be
    848  * the latest (1.11); for files read in from disk earlier, it will be
     854 * the latest (1.12); for files read in from disk earlier, it will be
    849855 * the settings version indicated in the file. However, this method
    850856 * will silently make sure that the settings version is always
     
    16481654                  && (strNotificationPatterns   == h.strNotificationPatterns)
    16491655                  && (ioSettings                == h.ioSettings)
     1656                  && (pciAttachments            == h.pciAttachments)
    16501657                )
    16511658            );
     
    27172724                    pelmBandwidthGroup->getAttributeValue("maxMbPerSec", gr.cMaxMbPerSec);
    27182725                    hw.ioSettings.llBandwidthGroups.push_back(gr);
     2726                }
     2727            }
     2728        }  else if (pelmHwChild->nameEquals("HostPci")) {
     2729            const xml::ElementNode *pelmDevices;
     2730
     2731            if ((pelmDevices = pelmHwChild->findChildElement("Devices")))
     2732            {
     2733                xml::NodesLoop nl2(*pelmDevices, "Device");
     2734                const xml::ElementNode *pelmDevice;
     2735                while ((pelmDevice = nl2.forAllNodes()))
     2736                {
     2737                    HostPciDeviceAttachment hpda;
     2738
     2739                    if (!pelmDevice->getAttributeValue("host", hpda.uHostAddress))
     2740                         throw ConfigFileError(this, pelmDevice, N_("Missing Device/@host attribute"));
     2741
     2742                    if (!pelmDevice->getAttributeValue("host", hpda.uGuestAddress))
     2743                         throw ConfigFileError(this, pelmDevice, N_("Missing Device/@guest attribute"));
     2744
     2745                    /* name is optional */
     2746                    pelmDevice->getAttributeValue("name", hpda.strDeviceName);
     2747
     2748                    hw.pciAttachments.push_back(hpda);
    27192749                }
    27202750            }
     
    38633893    }
    38643894
     3895    if (m->sv >= SettingsVersion_v1_12)
     3896    {
     3897        xml::ElementNode *pelmPci = pelmHardware->createChild("HostPci");
     3898        xml::ElementNode *pelmPciDevices = pelmPci->createChild("Devices");
     3899
     3900        for (HostPciDeviceAttachmentList::const_iterator it = hw.pciAttachments.begin();
     3901             it != hw.pciAttachments.end();
     3902             ++it)
     3903        {
     3904            const HostPciDeviceAttachment &hpda = *it;
     3905
     3906            xml::ElementNode *pelmThis = pelmPciDevices->createChild("Device");
     3907
     3908            pelmThis->setAttribute("host",  hpda.uHostAddress);
     3909            pelmThis->setAttribute("guest", hpda.uGuestAddress);
     3910            pelmThis->setAttribute("name",  hpda.strDeviceName);
     3911        }
     3912    }
     3913
    38653914    xml::ElementNode *pelmGuest = pelmHardware->createChild("Guest");
    38663915    pelmGuest->setAttribute("memoryBalloonSize", hw.ulMemoryBalloonSize);
     
    44184467void MachineConfigFile::bumpSettingsVersionIfNeeded()
    44194468{
     4469    if (m->sv < SettingsVersion_v1_12)
     4470    {
     4471        // VirtualBox 4.1 adds PCI passthrough
     4472        if (hardwareMachine.pciAttachments.size())
     4473            m->sv = SettingsVersion_v1_12;
     4474    }
     4475
    44204476    if (m->sv < SettingsVersion_v1_11)
    44214477    {
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