Changeset 24843 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Nov 21, 2009 9:57:48 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 55077
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/SSM.cpp
r24804 r24843 549 549 /** 32-bit MSC saved this? */ 550 550 bool fIsHostMsc32; 551 /** "Host OS" dot "architecture", picked up from recent SSM data units. */ 552 char szHostOSAndArch[32]; 551 553 552 554 /** @name Header info (set by ssmR3ValidateFile) … … 1017 1019 /* 1018 1020 * Detect 32-bit MSC for handling SSMFIELD_ENTRY_PAD_MSC32_AUTO. 1021 * Save the Host OS for SSMR3HandleHostOSAndArch 1019 1022 */ 1020 1023 if (!strcmp(szVar, "Host OS")) … … 1026 1029 pSSM->u.Read.fIsHostMsc32 = fIsHostMsc32; 1027 1030 } 1031 1032 size_t cchValue = strlen(szValue); 1033 size_t cchCopy = RT_MIN(cchValue, sizeof(pSSM->u.Read.szHostOSAndArch) - 1); 1034 Assert(cchValue == cchCopy); 1035 memcpy(pSSM->u.Read.szHostOSAndArch, szValue, cchCopy); 1036 pSSM->u.Read.szHostOSAndArch[cchCopy] = '\0'; 1028 1037 } 1029 1038 } … … 7352 7361 pSSM->u.Read.fFixedGCPtrSize= false; 7353 7362 pSSM->u.Read.fIsHostMsc32 = SSM_HOST_IS_MSC_32; 7363 RT_ZERO(pSSM->u.Read.szHostOSAndArch); 7354 7364 pSSM->u.Read.u16VerMajor = UINT16_MAX; 7355 7365 pSSM->u.Read.u16VerMinor = UINT16_MAX; … … 8639 8649 * @returns 32 or 64. If pSSM is invalid, 0 is returned. 8640 8650 * @param pSSM The saved state handle. 8651 * 8652 * @remarks This method should ONLY be used for hacks when loading OLDER saved 8653 * state that have data layout or semantical changes without the 8654 * compulsory version number change. 8641 8655 */ 8642 8656 VMMR3DECL(uint32_t) SSMR3HandleHostBits(PSSMHANDLE pSSM) … … 8644 8658 SSM_ASSERT_VALID_HANDLE(pSSM); 8645 8659 return ssmR3GetHostBits(pSSM); 8660 } 8661 8662 8663 /** 8664 * Get the VirtualBox SVN revision that created the saved state. 8665 * 8666 * @returns The revision number on success. 8667 * form. If we don't know, it's an empty string. 8668 * @param pSSM The saved state handle. 8669 * 8670 * @remarks This method should ONLY be used for hacks when loading OLDER saved 8671 * state that have data layout or semantical changes without the 8672 * compulsory version number change. Be VERY careful with this 8673 * function since it will return different values for OSE builds! 8674 */ 8675 VMMR3DECL(uint32_t) SSMR3HandleRevision(PSSMHANDLE pSSM) 8676 { 8677 if (pSSM->enmOp >= SSMSTATE_LOAD_PREP) 8678 return pSSM->u.Read.u32SvnRev; 8679 return VMMGetSvnRev(); 8680 } 8681 8682 8683 /** 8684 * Gets the VirtualBox version that created the saved state. 8685 * 8686 * @returns VBOX_FULL_VERSION style version number. 8687 * Returns UINT32_MAX if unknown or somehow out of range. 8688 * 8689 * @param pSSM The saved state handle. 8690 * 8691 * @remarks This method should ONLY be used for hacks when loading OLDER saved 8692 * state that have data layout or semantical changes without the 8693 * compulsory version number change. 8694 */ 8695 VMMR3DECL(uint32_t) SSMR3HandleVersion(PSSMHANDLE pSSM) 8696 { 8697 if (pSSM->enmOp >= SSMSTATE_LOAD_PREP) 8698 { 8699 if ( !pSSM->u.Read.u16VerMajor 8700 && !pSSM->u.Read.u16VerMinor 8701 && !pSSM->u.Read.u32VerBuild) 8702 return UINT32_MAX; 8703 AssertReturn(pSSM->u.Read.u16VerMajor <= 0xff, UINT32_MAX); 8704 AssertReturn(pSSM->u.Read.u16VerMinor <= 0xff, UINT32_MAX); 8705 AssertReturn(pSSM->u.Read.u32VerBuild <= 0xffff, UINT32_MAX); 8706 return VBOX_FULL_VERSION_MAKE(pSSM->u.Read.u16VerMajor, pSSM->u.Read.u16VerMinor, pSSM->u.Read.u32VerBuild); 8707 } 8708 return VBOX_FULL_VERSION; 8709 } 8710 8711 8712 /** 8713 * Get the host OS and architecture where the saved state was created. 8714 * 8715 * @returns Pointer to a read only string. When known, this is on the os.arch 8716 * form. If we don't know, it's an empty string. 8717 * @param pSSM The saved state handle. 8718 * 8719 * @remarks This method should ONLY be used for hacks when loading OLDER saved 8720 * state that have data layout or semantical changes without the 8721 * compulsory version number change. 8722 */ 8723 VMMR3DECL(const char *) SSMR3HandleHostOSAndArch(PSSMHANDLE pSSM) 8724 { 8725 if (pSSM->enmOp >= SSMSTATE_LOAD_PREP) 8726 return pSSM->u.Read.szHostOSAndArch; 8727 return KBUILD_TARGET "." KBUILD_TARGET_ARCH; 8646 8728 } 8647 8729
Note:
See TracChangeset
for help on using the changeset viewer.