vbox的更動 34587 路徑 trunk/src/VBox/Main/xml
- 時間撮記:
- 2010-12-1 下午08:30:02 (14 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Main/xml/Settings.cpp
r34574 r34587 1634 1634 && (llGuestProperties == h.llGuestProperties) 1635 1635 && (strNotificationPatterns == h.strNotificationPatterns) 1636 && (ioSettings == h.ioSettings) 1636 1637 ) 1637 1638 ); … … 1652 1653 && (uuid == a.uuid) 1653 1654 && (strHostDriveSrc == a.strHostDriveSrc) 1654 && ( ulBandwidthLimit == a.ulBandwidthLimit)1655 && (strBwGroup == a.strBwGroup) 1655 1656 ) 1656 1657 ); … … 2656 2657 else if (pelmHwChild->nameEquals("IO")) 2657 2658 { 2659 const xml::ElementNode *pelmBwGroups; 2658 2660 const xml::ElementNode *pelmIoChild; 2659 2661 … … 2662 2664 pelmIoChild->getAttributeValue("enabled", hw.ioSettings.fIoCacheEnabled); 2663 2665 pelmIoChild->getAttributeValue("size", hw.ioSettings.ulIoCacheSize); 2666 } 2667 2668 if ((pelmBwGroups = pelmHwChild->findChildElement("BandwidthGroups"))) 2669 { 2670 xml::NodesLoop nl2(*pelmBwGroups, "BandwidthGroup"); 2671 const xml::ElementNode *pelmBandwidthGroup; 2672 while ((pelmBandwidthGroup = nl2.forAllNodes())) 2673 { 2674 BandwidthGroup gr; 2675 Utf8Str strTemp; 2676 2677 pelmBandwidthGroup->getAttributeValue("name", gr.strName); 2678 2679 if (pelmBandwidthGroup->getAttributeValue("type", strTemp)) 2680 { 2681 if (strTemp == "Disk") 2682 gr.enmType = BandwidthGroupType_Disk; 2683 else if (strTemp == "Network") 2684 gr.enmType = BandwidthGroupType_Network; 2685 else 2686 throw ConfigFileError(this, pelmBandwidthGroup, N_("Invalid value '%s' in BandwidthGroup/@type attribute"), strTemp.c_str()); 2687 } 2688 else 2689 throw ConfigFileError(this, pelmBandwidthGroup, N_("Missing BandwidthGroup/@type attribute")); 2690 2691 pelmBandwidthGroup->getAttributeValue("maxMbPerSec", gr.cMaxMbPerSec); 2692 hw.ioSettings.llBandwidthGroups.push_back(gr); 2693 } 2664 2694 } 2665 2695 } … … 2878 2908 throw ConfigFileError(this, pelmImage, N_("Required AttachedDevice/@device attribute is missing")); 2879 2909 2880 pelmAttached->getAttributeValue("bandwidth Limit", att.ulBandwidthLimit);2910 pelmAttached->getAttributeValue("bandwidthGroup", att.strBwGroup); 2881 2911 sctl.llAttachedDevices.push_back(att); 2882 2912 } … … 3760 3790 xml::ElementNode *pelmIo = pelmHardware->createChild("IO"); 3761 3791 xml::ElementNode *pelmIoCache; 3762 xml::ElementNode *pelmIoBandwidth;3763 3792 3764 3793 pelmIoCache = pelmIo->createChild("IoCache"); 3765 3794 pelmIoCache->setAttribute("enabled", hw.ioSettings.fIoCacheEnabled); 3766 3795 pelmIoCache->setAttribute("size", hw.ioSettings.ulIoCacheSize); 3767 pelmIoBandwidth = pelmIo->createChild("IoBandwidth"); 3796 3797 if (m->sv >= SettingsVersion_v1_11) 3798 { 3799 xml::ElementNode *pelmBandwidthGroups = pelmIo->createChild("BandwidthGroups"); 3800 for (BandwidthGroupList::const_iterator it = hw.ioSettings.llBandwidthGroups.begin(); 3801 it != hw.ioSettings.llBandwidthGroups.end(); 3802 ++it) 3803 { 3804 const BandwidthGroup &gr = *it; 3805 const char *pcszType; 3806 xml::ElementNode *pelmThis = pelmBandwidthGroups->createChild("BandwidthGroup"); 3807 pelmThis->setAttribute("name", gr.strName); 3808 switch (gr.enmType) 3809 { 3810 case BandwidthGroupType_Network: pcszType = "Network"; break; 3811 default: /* BandwidthGrouptype_Disk */ pcszType = "Disk"; break; 3812 } 3813 pelmThis->setAttribute("type", pcszType); 3814 pelmThis->setAttribute("maxMbPerSec", gr.cMaxMbPerSec); 3815 } 3816 } 3768 3817 } 3769 3818 … … 4007 4056 pelmDevice->setAttribute("device", att.lDevice); 4008 4057 4009 if (att. ulBandwidthLimit)4010 pelmDevice->setAttribute("bandwidth Limit", att.ulBandwidthLimit);4058 if (att.strBwGroup.length()) 4059 pelmDevice->setAttribute("bandwidthGroup", att.strBwGroup); 4011 4060 4012 4061 // attached image, if any … … 4325 4374 { 4326 4375 // VirtualBox 4.0 adds HD audio, CPU priorities, fault tolerance, 4327 // per-machine media registries, VRDE and JRockitVE.4376 // per-machine media registries, VRDE, JRockitVE and bandwidth gorups. 4328 4377 if ( hardwareMachine.audioAdapter.controllerType == AudioControllerType_HDA 4329 4378 || hardwareMachine.ulCpuExecutionCap != 100 … … 4338 4387 || !hardwareMachine.vrdeSettings.strAuthLibrary.isEmpty() 4339 4388 || machineUserData.strOsType == "JRockitVE" 4389 || hardwareMachine.ioSettings.llBandwidthGroups.size() 4340 4390 ) 4341 4391 m->sv = SettingsVersion_v1_11; … … 4437 4487 // Bandwidth limitations are new in VirtualBox 4.0 (1.11) 4438 4488 if ( (m->sv < SettingsVersion_v1_11) 4439 && (att. ulBandwidthLimit!= 0)4489 && (att.strBwGroup.length() != 0) 4440 4490 ) 4441 4491 {
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器