Changeset 35885 in vbox for trunk/src/VBox/Main/xml
- Timestamp:
- Feb 8, 2011 1:20:04 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 69897
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r35818 r35885 91 91 92 92 /** VirtualBox XML settings version number substring ("x.y") */ 93 #define VBOX_XML_VERSION "1.1 1"93 #define VBOX_XML_VERSION "1.12" 94 94 95 95 /** VirtualBox XML settings version platform substring */ … … 320 320 else if (ulMinor == 11) 321 321 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) 323 325 m->sv = SettingsVersion_Future; 324 326 } … … 340 342 // creating new settings file: 341 343 m->strSettingsVersionFull = VBOX_XML_VERSION_FULL; 342 m->sv = SettingsVersion_v1_1 1;344 m->sv = SettingsVersion_v1_12; 343 345 } 344 346 } … … 818 820 break; 819 821 822 case SettingsVersion_v1_12: 823 pcszVersion = "1.12"; 824 break; 825 820 826 case SettingsVersion_Future: 821 827 // can be set if this code runs on XML files that were created by a future version of VBox; 822 828 // in that case, downgrade to current version when writing since we can't write future versions... 823 pcszVersion = "1.1 1";824 m->sv = SettingsVersion_v1_1 0;829 pcszVersion = "1.12"; 830 m->sv = SettingsVersion_v1_12; 825 831 break; 826 832 … … 846 852 * set the "sv" member to the required settings version that is to 847 853 * be written. For newly created files, the settings version will be 848 * the latest (1.1 1); for files read in from disk earlier, it will be854 * the latest (1.12); for files read in from disk earlier, it will be 849 855 * the settings version indicated in the file. However, this method 850 856 * will silently make sure that the settings version is always … … 1648 1654 && (strNotificationPatterns == h.strNotificationPatterns) 1649 1655 && (ioSettings == h.ioSettings) 1656 && (pciAttachments == h.pciAttachments) 1650 1657 ) 1651 1658 ); … … 2717 2724 pelmBandwidthGroup->getAttributeValue("maxMbPerSec", gr.cMaxMbPerSec); 2718 2725 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); 2719 2749 } 2720 2750 } … … 3863 3893 } 3864 3894 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 3865 3914 xml::ElementNode *pelmGuest = pelmHardware->createChild("Guest"); 3866 3915 pelmGuest->setAttribute("memoryBalloonSize", hw.ulMemoryBalloonSize); … … 4418 4467 void MachineConfigFile::bumpSettingsVersionIfNeeded() 4419 4468 { 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 4420 4476 if (m->sv < SettingsVersion_v1_11) 4421 4477 {
Note:
See TracChangeset
for help on using the changeset viewer.