Changeset 22480 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 26, 2009 5:14:13 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r22456 r22480 1055 1055 * 1056 1056 * @param pvUser pointer to Console 1057 * @param u 32VersionConsole unit version.1057 * @param uVersion Console unit version. 1058 1058 * Should match sSSMConsoleVer. 1059 * @param uPhase The data phase. 1059 1060 * 1060 1061 * @note Should locks the Console object for writing, if necessary. … … 1062 1063 //static 1063 1064 DECLCALLBACK(int) 1064 Console::loadStateFileExec (PSSMHANDLE pSSM, void *pvUser, uint32_t u32Version)1065 Console::loadStateFileExec(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPhase) 1065 1066 { 1066 1067 LogFlowFunc (("\n")); 1067 1068 1068 if (SSM_VERSION_MAJOR_CHANGED(u 32Version, sSSMConsoleVer))1069 if (SSM_VERSION_MAJOR_CHANGED(uVersion, sSSMConsoleVer)) 1069 1070 return VERR_VERSION_MISMATCH; 1070 1071 Console *that = static_cast <Console *> (pvUser); 1071 Assert(uPhase == SSM_PHASE_FINAL); NOREF(uPhase); 1072 1073 Console *that = static_cast<Console *>(pvUser); 1072 1074 AssertReturn(that, VERR_INVALID_PARAMETER); 1073 1075 … … 6786 6788 { 6787 6789 /* 6788 * 6790 * Register our load/save state file handlers 6789 6791 */ 6790 vrc = SSMR3RegisterExternal (pVM, 6791 sSSMConsoleUnit, 0 /* iInstance */, sSSMConsoleVer, 6792 0 /* cbGuess */, 6793 NULL, saveStateFileExec, NULL, NULL, loadStateFileExec, NULL, 6794 static_cast <Console *> (console)); 6795 AssertRC (vrc); 6796 if (VBOX_FAILURE (vrc)) 6797 break; 6792 vrc = SSMR3RegisterExternal(pVM, sSSMConsoleUnit, 0 /*iInstance*/, sSSMConsoleVer, 0 /* cbGuess */, 6793 NULL, NULL, NULL, 6794 NULL, saveStateFileExec, NULL, 6795 NULL, loadStateFileExec, NULL, 6796 static_cast<Console *>(console)); 6797 AssertRCBreak(vrc); 6798 6798 6799 6799 vrc = static_cast <Console *>(console)->getDisplay()->registerSSM(pVM); -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r22455 r22480 1457 1457 /* the VMM device's Main driver */ 1458 1458 rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); RC_CHECK(); 1459 rc = CFGMR3InsertString(pLunL0, "Driver", " MainVMMDev");RC_CHECK();1459 rc = CFGMR3InsertString(pLunL0, "Driver", "HGCM"); RC_CHECK(); 1460 1460 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1461 1461 VMMDev *pVMMDev = pConsole->mVMMDev; -
trunk/src/VBox/Main/DisplayImpl.cpp
r22443 r22480 116 116 */ 117 117 DECLCALLBACK(void) 118 Display::displaySSMSave 118 Display::displaySSMSave(PSSMHANDLE pSSM, void *pvUser) 119 119 { 120 120 Display *that = static_cast<Display*>(pvUser); 121 121 122 int rc = SSMR3PutU32 (pSSM, that->mcMonitors); 123 AssertRC(rc); 124 122 SSMR3PutU32(pSSM, that->mcMonitors); 125 123 for (unsigned i = 0; i < that->mcMonitors; i++) 126 124 { 127 rc = SSMR3PutU32 (pSSM, that->maFramebuffers[i].u32Offset); 128 AssertRC(rc); 129 rc = SSMR3PutU32 (pSSM, that->maFramebuffers[i].u32MaxFramebufferSize); 130 AssertRC(rc); 131 rc = SSMR3PutU32 (pSSM, that->maFramebuffers[i].u32InformationSize); 132 AssertRC(rc); 125 SSMR3PutU32(pSSM, that->maFramebuffers[i].u32Offset); 126 SSMR3PutU32(pSSM, that->maFramebuffers[i].u32MaxFramebufferSize); 127 SSMR3PutU32(pSSM, that->maFramebuffers[i].u32InformationSize); 133 128 } 134 129 } 135 130 136 131 DECLCALLBACK(int) 137 Display::displaySSMLoad (PSSMHANDLE pSSM, void *pvUser, uint32_t u32Version)132 Display::displaySSMLoad(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPhase) 138 133 { 139 134 Display *that = static_cast<Display*>(pvUser); 135 136 if (uVersion != sSSMDisplayVer) 137 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 138 140 139 uint32_t cMonitors; 141 142 if (u32Version != sSSMDisplayVer) 143 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 144 145 int rc = SSMR3GetU32 (pSSM, &cMonitors); 140 int rc = SSMR3GetU32(pSSM, &cMonitors); 146 141 if (cMonitors != that->mcMonitors) 147 142 { 148 143 LogRel(("Display: Number of monitors changed (%d->%d)!\n", 149 144 cMonitors, that->mcMonitors)); 150 145 return VERR_SSM_LOAD_CONFIG_MISMATCH; 151 146 } 152 147 153 for (unsigned i = 0; i < cMonitors; i++) 154 { 155 rc = SSMR3GetU32 (pSSM, &that->maFramebuffers[i].u32Offset); 156 AssertRC(rc); 157 rc = SSMR3GetU32 (pSSM, &that->maFramebuffers[i].u32MaxFramebufferSize); 158 AssertRC(rc); 159 rc = SSMR3GetU32 (pSSM, &that->maFramebuffers[i].u32InformationSize); 160 AssertRC(rc); 148 for (uint32_t i = 0; i < cMonitors; i++) 149 { 150 SSMR3GetU32(pSSM, &that->maFramebuffers[i].u32Offset); 151 SSMR3GetU32(pSSM, &that->maFramebuffers[i].u32MaxFramebufferSize); 152 SSMR3GetU32(pSSM, &that->maFramebuffers[i].u32InformationSize); 161 153 } 162 154 … … 262 254 int Display::registerSSM(PVM pVM) 263 255 { 264 return SSMR3RegisterExternal(pVM, "DisplayData", 3*sizeof(uint32_t*), 265 sSSMDisplayVer, 0, 266 NULL, displaySSMSave, NULL, 267 NULL, displaySSMLoad, NULL, this); 256 int rc = SSMR3RegisterExternal(pVM, "DisplayData", 0, sSSMDisplayVer, 257 mcMonitors * sizeof(uint32_t) * 3 + sizeof(uint32_t), 258 NULL, NULL, NULL, 259 NULL, displaySSMSave, NULL, 260 NULL, displaySSMLoad, NULL, this); 261 262 AssertRCReturn(rc, rc); 263 264 /* 265 * Register loaders for old saved states where iInstance was 3 * sizeof(uint32_t *). 266 */ 267 rc = SSMR3RegisterExternal(pVM, "DisplayData", 12 /*uInstance*/, sSSMDisplayVer, 0 /*cbGuess*/, 268 NULL, NULL, NULL, 269 NULL, NULL, NULL, 270 NULL, displaySSMLoad, NULL, this); 271 AssertRCReturn(rc, rc); 272 273 rc = SSMR3RegisterExternal(pVM, "DisplayData", 24 /*uInstance*/, sSSMDisplayVer, 0 /*cbGuess*/, 274 NULL, NULL, NULL, 275 NULL, NULL, NULL, 276 NULL, displaySSMLoad, NULL, this); 277 AssertRCReturn(rc, rc); 278 return VINF_SUCCESS; 268 279 } 269 280 … … 2393 2404 2394 2405 pThis->maFramebuffers[uScreenId].fVBVAEnabled = true; 2395 2406 2396 2407 return VINF_SUCCESS; 2397 2408 } … … 2547 2558 if (!CFGMR3AreValuesValid(pCfgHandle, "Object\0")) 2548 2559 return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES; 2549 AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, 2560 AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, 2550 2561 ("Configuration error: Not possible to attach anything to this driver!\n"), 2551 2562 VERR_PDM_DRVINS_NO_ATTACH); … … 2657 2668 NULL, 2658 2669 /* pfnDetach */ 2659 NULL, 2670 NULL, 2660 2671 /* pfnPowerOff */ 2661 NULL, 2672 NULL, 2662 2673 /* pfnSoftReset */ 2663 2674 NULL, -
trunk/src/VBox/Main/VMMDevInterface.cpp
r22277 r22480 601 601 * @param pDrvIns Driver instance of the driver which registered the data unit. 602 602 * @param pSSM SSM operation handle. 603 * @param u32Version Data layout version. 604 */ 605 static DECLCALLBACK(int) iface_hgcmLoad(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM, uint32_t u32Version) 603 * @param uVersion Data layout version. 604 * @param uPhase The data phase. 605 */ 606 static DECLCALLBACK(int) iface_hgcmLoad(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPhase) 606 607 { 607 608 LogFlowFunc(("Enter\n")); 608 609 609 if (u 32Version != HGCM_SSM_VERSION)610 if (uVersion != HGCM_SSM_VERSION) 610 611 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 612 Assert(uPhase == SSM_PHASE_FINAL); NOREF(uPhase); 611 613 612 614 return HGCMHostLoadState (pSSM); … … 716 718 if (!CFGMR3AreValuesValid(pCfgHandle, "Object\0")) 717 719 return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES; 718 AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, 720 AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, 719 721 ("Configuration error: Not possible to attach anything to this driver!\n"), 720 722 VERR_PDM_DRVINS_NO_ATTACH); … … 812 814 LogRel(("Failed to load Shared Folders service %Rrc\n", rc)); 813 815 814 pDrvIns->pDrvHlp->pfnSSMRegister(pDrvIns, "HGCM", 0, HGCM_SSM_VERSION, 4096/* bad guess */, NULL, iface_hgcmSave, NULL, NULL, iface_hgcmLoad, NULL); 816 rc = PDMDrvHlpSSMRegisterEx(pDrvIns, HGCM_SSM_VERSION, 4096 /* bad guess */, 817 NULL, NULL, NULL, 818 NULL, iface_hgcmSave, NULL, 819 NULL, iface_hgcmLoad, NULL); 820 if (RT_FAILURE(rc)) 821 return rc; 822 815 823 #endif /* VBOX_WITH_HGCM */ 816 824 … … 827 835 PDM_DRVREG_VERSION, 828 836 /* szDriverName */ 829 " MainVMMDev",837 "HGCM", 830 838 /* pszDescription */ 831 839 "Main VMMDev driver (Main as in the API).", … … 855 863 NULL, 856 864 /* pfnDetach */ 857 NULL, 865 NULL, 858 866 /* pfnPowerOff */ 859 NULL, 867 NULL, 860 868 /* pfnSoftReset */ 861 869 NULL, -
trunk/src/VBox/Main/include/ConsoleImpl.h
r22455 r22480 500 500 501 501 static DECLCALLBACK(void) saveStateFileExec (PSSMHANDLE pSSM, void *pvUser); 502 static DECLCALLBACK(int) loadStateFileExec (PSSMHANDLE pSSM, void *pvUser, uint32_t u 32Version);502 static DECLCALLBACK(int) loadStateFileExec (PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPhase); 503 503 504 504 #ifdef VBOX_WITH_GUEST_PROPS -
trunk/src/VBox/Main/include/DisplayImpl.h
r22412 r22480 291 291 292 292 293 static DECLCALLBACK(void) displaySSMSave 294 static DECLCALLBACK(int) displaySSMLoad (PSSMHANDLE pSSM, void *pvUser, uint32_t u32Version);293 static DECLCALLBACK(void) displaySSMSave(PSSMHANDLE pSSM, void *pvUser); 294 static DECLCALLBACK(int) displaySSMLoad(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPhase); 295 295 296 296 const ComObjPtr<Console, ComWeakRef> mParent;
Note:
See TracChangeset
for help on using the changeset viewer.