VirtualBox

Ignore:
Timestamp:
Oct 21, 2010 5:00:14 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
66897
Message:

crOpenGL: workaround failure to load vm snapshot with changed opengl data version (#5316)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp

    r33309 r33319  
    7272
    7373static const char* gszVBoxOGLSSMMagic = "***OpenGL state data***";
    74 #define SHCROGL_SSM_VERSION 21
    7574
    7675static DECLCALLBACK(int) svcUnload (void *)
     
    158157    rc = SSMR3GetU32(pSSM, &ui32);
    159158    AssertRCReturn(rc, rc);
    160     if ((SHCROGL_SSM_VERSION != ui32)
    161         && ((SHCROGL_SSM_VERSION!=4) || (3!=ui32)))
    162     {
    163         /*@todo: add some warning here*/
    164         /*@todo: in many cases saved states would be made without any opengl guest app running.
    165          *       that means we could safely restore the default context.
    166          */
    167         rc = SSMR3SkipToEndOfUnit(pSSM);
    168         return rc;
    169     }
    170159
    171160    /* The state itself */
    172161    rc = crVBoxServerLoadState(pSSM, ui32);
     162
     163    if (rc==VERR_SSM_DATA_UNIT_FORMAT_CHANGED && ui32!=SHCROGL_SSM_VERSION)
     164    {
     165        LogRel(("SHARED_CROPENGL svcLoadState: unsupported save state version %d\n", ui32));
     166
     167        /*@todo ugly hack, as we don't know size of stored opengl data try to read untill end of opengl data marker*/
     168        /*VboxSharedCrOpenGL isn't last hgcm service now, so can't use SSMR3SkipToEndOfUnit*/
     169        {
     170            const char *pMatch = &gszVBoxOGLSSMMagic[0];
     171            char current;
     172
     173            while (*pMatch)
     174            {
     175                rc = SSMR3GetS8(pSSM, (int8_t*)&current);
     176                AssertRCReturn(rc, rc);
     177
     178                if (current==*pMatch)
     179                {
     180                    pMatch++;
     181                }
     182                else
     183                {
     184                    pMatch = &gszVBoxOGLSSMMagic[0];
     185                }
     186            }
     187        }
     188
     189        return VINF_SUCCESS;
     190    }
    173191    AssertRCReturn(rc, rc);
    174192
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette