Changeset 15582 in vbox for trunk/src/VBox
- Timestamp:
- Dec 16, 2008 1:22:33 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl2.cpp
r15574 r15582 1702 1702 afPciDeviceNo[4] = true; 1703 1703 rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo", 0); RC_CHECK(); 1704 Bstr hwVersion; 1705 hrc = pMachine->COMGETTER(HardwareVersion)(hwVersion.asOutParam()); H(); 1706 if (hwVersion.compare(Bstr("1")) == 0) /* <= 2.0.x */ 1707 { 1708 CFGMR3InsertInteger(pCfg, "HeapEnabled", 0); RC_CHECK(); 1709 } 1704 1710 1705 1711 /* the VMM device's Main driver */ -
trunk/src/VBox/Main/MachineImpl.cpp
r15496 r15582 187 187 { 188 188 /* default values for a newly created machine */ 189 mHWVersion = "2"; /** @todo get the default from the schema if that is possible. */ 189 190 mMemorySize = 128; 190 191 mCPUCount = 1; … … 220 221 return true; 221 222 222 if (mMemorySize != that.mMemorySize || 223 if (mHWVersion != that.mHWVersion || 224 mMemorySize != that.mMemorySize || 223 225 mMemoryBalloonSize != that.mMemoryBalloonSize || 224 226 mStatisticsUpdateInterval != that.mStatisticsUpdateInterval || … … 907 909 mUserData.backup(); 908 910 mUserData->mOSTypeId = aOSTypeId; 911 912 return S_OK; 913 } 914 915 STDMETHODIMP Machine::COMGETTER(HardwareVersion) (BSTR *aHWVersion) 916 { 917 if (!aHWVersion) 918 return E_POINTER; 919 920 AutoCaller autoCaller (this); 921 CheckComRCReturnRC (autoCaller.rc()); 922 923 AutoReadLock alock (this); 924 925 mHWData->mHWVersion.cloneTo (aHWVersion); 926 927 return S_OK; 928 } 929 930 STDMETHODIMP Machine::COMSETTER(HardwareVersion) (IN_BSTR aHWVersion) 931 { 932 /* check known version */ 933 Utf8Str hwVersion = aHWVersion; 934 if ( hwVersion.compare ("1") != 0 935 && hwVersion.compare ("2") != 0) 936 return setError (E_INVALIDARG, 937 tr ("Invalid hardware version: %ls\n"), aHWVersion); 938 939 AutoCaller autoCaller (this); 940 CheckComRCReturnRC (autoCaller.rc()); 941 942 AutoWriteLock alock (this); 943 944 HRESULT rc = checkStateDependency (MutableStateDep); 945 CheckComRCReturnRC (rc); 946 947 mHWData.backup(); 948 mHWData->mHWVersion = hwVersion; 909 949 910 950 return S_OK; … … 4969 5009 HRESULT rc = S_OK; 4970 5010 5011 /* The hardware version attribute (optional). */ 5012 mHWData->mHWVersion = aNode.stringValue ("version"); 5013 4971 5014 /* CPU node (currently not required) */ 4972 5015 { … … 6357 6400 6358 6401 HRESULT rc = S_OK; 6402 6403 /* The hardware version attribute (optional). 6404 Automatically upgrade from 1 to 2 when there is no saved state. (ugly!) */ 6405 { 6406 Utf8Str hwVersion = mHWData->mHWVersion; 6407 if ( hwVersion.compare ("1") == 0 6408 && mSSData->mStateFilePath.isEmpty()) 6409 mHWData->mHWVersion = hwVersion = "2"; /** @todo Is this safe, to update mHWVersion here? If not some other point needs to be found where this can be done. */ 6410 if (hwVersion.compare ("2") == 0) /** @todo get the default from the schema if possible. */ 6411 aNode.zapValue ("version"); 6412 else 6413 aNode.setStringValue ("version", hwVersion.raw()); 6414 } 6359 6415 6360 6416 /* CPU (optional, but always created atm) */ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r15570 r15582 3126 3126 <interface 3127 3127 name="IMachine" extends="$unknown" 3128 uuid=" a744b229-3457-422f-8550-649c40346c55"3128 uuid="ea6fb7ea-1993-4642-b113-f29eb39e0df0" 3129 3129 wsmap="managed" 3130 3130 > … … 3308 3308 </note> 3309 3309 </desc> 3310 </attribute> 3311 3312 <attribute name="HardwareVersion" type="wstring"> 3313 <desc>Hardware version identifier. Internal use only for now.</desc> 3310 3314 </attribute> 3311 3315 -
trunk/src/VBox/Main/include/MachineImpl.h
r15051 r15582 250 250 bool operator== (const HWData &that) const; 251 251 252 Bstr mHWVersion; 252 253 ULONG mMemorySize; 253 254 ULONG mMemoryBalloonSize; … … 475 476 STDMETHOD(COMGETTER(OSTypeId)) (BSTR *aOSTypeId); 476 477 STDMETHOD(COMSETTER(OSTypeId)) (IN_BSTR aOSTypeId); 478 STDMETHOD(COMGETTER(HardwareVersion))(BSTR *aVersion); 479 STDMETHOD(COMSETTER(HardwareVersion))(IN_BSTR aVersion); 477 480 STDMETHOD(COMGETTER(MemorySize))(ULONG *memorySize); 478 481 STDMETHOD(COMSETTER(MemorySize))(ULONG memorySize); -
trunk/src/VBox/Main/xml/SettingsConverter.xsl
r15473 r15582 667 667 --> 668 668 669 <xsl:template match="vb:VirtualBox[substring-before(@version,'-')='1.3']/ 670 vb:Machine/vb:Hardware" 671 mode="v1.4"> 672 <!-- add version attribute to Hardware if parent Machine has a stateFile attribute --> 673 <xsl:copy> 674 <xsl:if test="../@stateFile"> 675 <xsl:attribute name="version">1</xsl:attribute> 676 </xsl:if> 677 <xsl:apply-templates select="node()" mode="v1.4"/> 678 </xsl:copy> 679 </xsl:template> 680 681 669 682 <!-- 670 683 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
r15069 r15582 763 763 </xsd:element> 764 764 </xsd:all> 765 <xsd:attribute name="version" type="xsd:string" default="2"/> 765 766 </xsd:complexType> 766 767
Note:
See TracChangeset
for help on using the changeset viewer.