Index: trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
===================================================================
--- trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c	(revision 56969)
+++ trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c	(revision 56970)
@@ -1898,5 +1898,5 @@
     /* Load windows */
     int32_t rc = crServerLsrDataGetU32(pReader, &uiNumElems);
-    AssertRCReturn(rc, rc);
+    AssertLogRelRCReturn(rc, rc);
     for (ui=0; ui<uiNumElems; ++ui)
     {
@@ -1907,7 +1907,7 @@
 
         rc = crServerLsrDataGetMem(pReader, &key, sizeof(key));
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
         rc = crServerLsrDataGetMem(pReader, &createInfo, sizeof(createInfo));
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
 
         CRASSERT(!pReader->cbData);
@@ -1916,5 +1916,5 @@
         {
             rc = SSMR3GetStrZEx(pReader->pSSM, psz, 200, NULL);
-            AssertRCReturn(rc, rc);
+            AssertLogRelRCReturn(rc, rc);
             createInfo.pszDpyName = psz;
         }
@@ -1926,5 +1926,5 @@
     /* Load cr_server.muralTable */
     rc = SSMR3GetU32(pReader->pSSM, &uiNumElems);
-    AssertRCReturn(rc, rc);
+    AssertLogRelRCReturn(rc, rc);
     for (ui=0; ui<uiNumElems; ++ui)
     {
@@ -1933,7 +1933,7 @@
 
         rc = crServerLsrDataGetMem(pReader, &key, sizeof(key));
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
         rc = crServerLsrDataGetMem(pReader, &muralInfo, RT_OFFSETOF(CRMuralInfo, CreateInfo));
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
 
         if (version <= SHCROGL_SSM_VERSION_BEFORE_FRONT_DRAW_TRACKING)
@@ -1956,5 +1956,5 @@
                  * the mural memory is zero-initialized initially, so we can be sure the padding is zeroed */
                 rc = crServerLsrDataGetMem(pReader, &LaBuf, sizeof (LaBuf));
-                AssertRCReturn(rc, rc);
+                AssertLogRelRCReturn(rc, rc);
                 if (LaBuf.apv[0] != NULL && LaBuf.apv[0] != ((void*)1))
                     break;
@@ -2023,5 +2023,5 @@
 
             rc = crServerLsrDataPutMem(pReader, &LaBuf, sizeof (LaBuf));
-            AssertRCReturn(rc, rc);
+            AssertLogRelRCReturn(rc, rc);
         }
 
@@ -2030,5 +2030,5 @@
             CR_SERVER_BUGGY_MURAL_DATA Tmp;
             rc = crServerLsrDataGetMem(pReader, &Tmp, sizeof (Tmp));
-            AssertRCReturn(rc, rc);
+            AssertLogRelRCReturn(rc, rc);
         }
 
@@ -2042,5 +2042,5 @@
 
             rc = crServerLsrDataGetMem(pReader, muralInfo.pVisibleRects, 4*sizeof(GLint)*muralInfo.cVisibleRects);
-            AssertRCReturn(rc, rc);
+            AssertLogRelRCReturn(rc, rc);
         }
 
@@ -2135,5 +2135,5 @@
         CRFBDataElement * pEl = &Data.data.aElements[i];
         rc = SSMR3GetMem(pSSM, pEl->pvData, pEl->cbData);
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
     }
 
@@ -2205,5 +2205,5 @@
         /* Read number of clients */
         rc = SSMR3GetU32(pSSM, &g_hackVBoxServerSaveLoadCallsLeft);
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
 
         Assert(g_hackVBoxServerSaveLoadCallsLeft);
@@ -2238,6 +2238,6 @@
     /* Load and recreate rendering contexts */
     rc = SSMR3GetU32(pSSM, &uiNumElems);
-    AssertRCReturn(rc, rc);
-    for (ui=0; ui<uiNumElems; ++ui)
+    AssertLogRelRCReturn(rc, rc);
+    for (ui = 0; ui < uiNumElems; ++ui)
     {
         CRCreateInfo_t createInfo;
@@ -2248,12 +2248,12 @@
 
         rc = SSMR3GetMem(pSSM, &key, sizeof(key));
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
         rc = SSMR3GetMem(pSSM, &createInfo, sizeof(createInfo));
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
 
         if (createInfo.pszDpyName)
         {
             rc = SSMR3GetStrZEx(pSSM, psz, 200, NULL);
-            AssertRCReturn(rc, rc);
+            AssertLogRelRCReturn(rc, rc);
             createInfo.pszDpyName = psz;
         }
@@ -2274,5 +2274,5 @@
         /* we have a mural data here */
         rc = crVBoxServerLoadMurals(&Reader, version);
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
         CRASSERT(!Reader.pu8Buffer);
     }
@@ -2286,5 +2286,5 @@
 
     rc = crStateLoadGlobals(pSSM, version);
-    AssertRCReturn(rc, rc);
+    AssertLogRelRCReturn(rc, rc);
 
     if (uiNumElems)
@@ -2309,5 +2309,5 @@
 
         rc = SSMR3GetMem(pSSM, &key, sizeof(key));
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
 
         pContextInfo = (CRContextInfo*) crHashtableSearch(cr_server.contextTable, key);
@@ -2319,5 +2319,5 @@
         {
             rc = SSMR3GetMem(pSSM, &winId, sizeof(winId));
-            AssertRCReturn(rc, rc);
+            AssertLogRelRCReturn(rc, rc);
 
             if (winId)
@@ -2335,9 +2335,9 @@
 
         rc = crStateLoadContext(pContext, cr_server.contextTable, crVBoxServerGetContextCB, pSSM, version);
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
 
         /*Restore front/back buffer images*/
         rc = crVBoxServerLoadFBImage(pSSM, version, pContextInfo, pMural);
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
     }
 
@@ -2349,5 +2349,5 @@
 
         rc = SSMR3GetU32(pSSM, &uiNumElems);
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
         for (ui=0; ui<uiNumElems; ++ui)
         {
@@ -2356,8 +2356,8 @@
 
             rc = SSMR3GetMem(pSSM, &key, sizeof(key));
-            AssertRCReturn(rc, rc);
+            AssertLogRelRCReturn(rc, rc);
 
             rc = SSMR3GetMem(pSSM, &ctxId, sizeof(ctxId));
-            AssertRCReturn(rc, rc);
+            AssertLogRelRCReturn(rc, rc);
 
             pMural = (CRMuralInfo*)crHashtableSearch(cr_server.muralTable, key);
@@ -2375,5 +2375,5 @@
 
             rc = crVBoxServerLoadFBImage(pSSM, version, pContextInfo, pMural);
-            AssertRCReturn(rc, rc);
+            AssertLogRelRCReturn(rc, rc);
 
             /* restore the reference data, we synchronize it with the HW state in a later crServerPerformMakeCurrent call */
@@ -2395,5 +2395,5 @@
         /* we have a mural data here */
         rc = crVBoxServerLoadMurals(&Reader, version);
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
 
         /* not used any more, just read it out and ignore */
@@ -2412,5 +2412,5 @@
 
             rc = crServerLsrDataGetU32(&Reader, &ui);
-            AssertRCReturn(rc, rc);
+            AssertLogRelRCReturn(rc, rc);
             /* If this assert fires, then we should search correct client in the list first*/
             CRASSERT(ui == pClient->conn->u32ClientID);
@@ -2419,8 +2419,8 @@
             {
                 rc = crServerLsrDataGetU32(&Reader, &pClient->conn->vMajor);
-                AssertRCReturn(rc, rc);
+                AssertLogRelRCReturn(rc, rc);
 
                 rc = crServerLsrDataGetU32(&Reader, &pClient->conn->vMinor);
-                AssertRCReturn(rc, rc);
+                AssertLogRelRCReturn(rc, rc);
             }
 
@@ -2445,5 +2445,5 @@
             {
                 rc = crServerLsrDataGetMem(&Reader, &ctxID, sizeof(ctxID));
-                AssertRCReturn(rc, rc);
+                AssertLogRelRCReturn(rc, rc);
                 client.currentCtxInfo = (CRContextInfo*) crHashtableSearch(cr_server.contextTable, ctxID);
                 CRASSERT(client.currentCtxInfo);
@@ -2456,5 +2456,5 @@
             {
                 rc = crServerLsrDataGetMem(&Reader, &winID, sizeof(winID));
-                AssertRCReturn(rc, rc);
+                AssertLogRelRCReturn(rc, rc);
                 client.currentMural = (CRMuralInfo*) crHashtableSearch(cr_server.muralTable, winID);
                 CRASSERT(client.currentMural);
@@ -2473,10 +2473,10 @@
 
     rc = crServerPendLoadState(pSSM, version);
-    AssertRCReturn(rc, rc);
+    AssertLogRelRCReturn(rc, rc);
 
     if (version >= SHCROGL_SSM_VERSION_WITH_SCREEN_INFO)
     {
         rc = CrPMgrLoadState(pSSM, version);
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
     }
 
@@ -2487,5 +2487,5 @@
         {
             rc = cr_server.head_spu->dispatch_table.spu_load_state((void *)pSSM);
-            AssertRCReturn(rc, rc);
+            AssertLogRelRCReturn(rc, rc);
         }
         else
@@ -3374,5 +3374,5 @@
     VBOXCMDVBVA_3DCTL_CONNECT Connect;
     int rc = SSMR3GetU32(pSSM, &u32);
-    AssertRCReturn(rc, rc);
+    AssertLogRelRCReturn(rc, rc);
 
     for (i = 0; i < u32; i++)
@@ -3383,14 +3383,14 @@
 
         rc = SSMR3GetU32(pSSM, &u32ClientID);
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
         rc = SSMR3GetU32(pSSM, &Connect.u32MajorVersion);
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
         rc = SSMR3GetU32(pSSM, &Connect.u32MinorVersion);
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
         rc = SSMR3GetU64(pSSM, &Connect.u64Pid);
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
 
         rc = crVBoxCrConnectEx(&Connect, u32ClientID);
-        AssertRCReturn(rc, rc);
+        AssertLogRelRCReturn(rc, rc);
     }
 
@@ -3453,5 +3453,5 @@
     int rc = VINF_SUCCESS;
 
-    char psz[2000];
+    char szBuf[2000];
     uint32_t ui32;
 
@@ -3459,81 +3459,50 @@
 
     /* Start of data */
-    rc = SSMR3GetStrZEx(pSSM, psz, 2000, NULL);
-    AssertRCReturn(rc, rc);
-    if (strcmp(gszVBoxOGLSSMMagic, psz))
-    {
-        WARN(("unexpected data"));
-        return VERR_SSM_UNEXPECTED_DATA;
-    }
+    rc = SSMR3GetStrZEx(pSSM, szBuf, sizeof(szBuf), NULL);
+    AssertLogRelRCReturn(rc, rc);
+    AssertLogRelMsgReturn(!strcmp(gszVBoxOGLSSMMagic, szBuf), ("Unexpected data1: '%s'\n", szBuf), VERR_SSM_UNEXPECTED_DATA);
 
     /* num clients */
     rc = SSMR3GetU32(pSSM, &ui32);
-    AssertRCReturn(rc, rc);
+    AssertLogRelRCReturn(rc, rc);
 
     if (!ui32)
     {
         /* no clients, dummy stub */
-        rc = SSMR3GetStrZEx(pSSM, psz, 2000, NULL);
-        AssertRCReturn(rc, rc);
-        if (strcmp(gszVBoxOGLSSMMagic, psz))
-        {
-            WARN(("unexpected data"));
-            return VERR_SSM_UNEXPECTED_DATA;
-        }
+        rc = SSMR3GetStrZEx(pSSM, szBuf, sizeof(szBuf), NULL);
+        AssertLogRelRCReturn(rc, rc);
+        AssertLogRelMsgReturn(!strcmp(gszVBoxOGLSSMMagic, szBuf), ("Unexpected data2: '%s'\n", szBuf), VERR_SSM_UNEXPECTED_DATA);
 
         return VINF_SUCCESS;
     }
-    if (ui32 != 1)
-    {
-        WARN(("invalid id"));
-        return VERR_SSM_UNEXPECTED_DATA;
-    }
+    AssertLogRelMsgReturn(ui32 == 1, ("Invalid client count: %#x\n", ui32), VERR_SSM_UNEXPECTED_DATA);
 
     /* Version */
     rc = SSMR3GetU32(pSSM, &ui32);
-    AssertRCReturn(rc, rc);
-
-    if (ui32 < SHCROGL_SSM_VERSION_CRCMD)
-    {
-        WARN(("unexpected version"));
-        return VERR_SSM_UNEXPECTED_DATA;
-    }
+    AssertLogRelRCReturn(rc, rc);
+    AssertLogRelMsgReturn(ui32 >= SHCROGL_SSM_VERSION_CRCMD, ("Unexpected version: %#x\n", ui32), VERR_SSM_UNEXPECTED_DATA);
 
     rc = crVBoxCrCmdLoadClients(pSSM, u32Version);
-    AssertRCReturn(rc, rc);
+    AssertLogRelRCReturn(rc, rc);
 
     /* The state itself */
     rc = crVBoxServerLoadStatePerform(pSSM, ui32);
-    AssertRCReturn(rc, rc);
+    AssertLogRelRCReturn(rc, rc);
 
     /* Save svc buffers info */
     {
         rc = SSMR3GetU32(pSSM, &ui32);
-        AssertRCReturn(rc, rc);
-
-        if (ui32)
-        {
-            WARN(("unexpected data1"));
-            return VERR_SSM_UNEXPECTED_DATA;
-        }
+        AssertLogRelRCReturn(rc, rc);
+        AssertLogRelMsgReturn(ui32 == 0, ("Unexpected data3: %#x\n", ui32), VERR_SSM_UNEXPECTED_DATA);
 
         rc = SSMR3GetU32(pSSM, &ui32);
-        AssertRCReturn(rc, rc);
-
-        if (ui32)
-        {
-            WARN(("unexpected data1"));
-            return VERR_SSM_UNEXPECTED_DATA;
-        }
+        AssertLogRelRCReturn(rc, rc);
+        AssertLogRelMsgReturn(ui32 == 0, ("Unexpected data4: %#x\n", ui32), VERR_SSM_UNEXPECTED_DATA);
     }
 
     /* End */
-    rc = SSMR3GetStrZEx(pSSM, psz, 2000, NULL);
-    AssertRCReturn(rc, rc);
-    if (strcmp(gszVBoxOGLSSMMagic, psz))
-    {
-        WARN(("unexpected data"));
-        return VERR_SSM_UNEXPECTED_DATA;
-    }
+    rc = SSMR3GetStrZEx(pSSM, szBuf, sizeof(szBuf), NULL);
+    AssertLogRelRCReturn(rc, rc);
+    AssertLogRelMsgReturn(!strcmp(gszVBoxOGLSSMMagic, szBuf), ("Unexpected data5: '%s'\n", szBuf), VERR_SSM_UNEXPECTED_DATA);
 
     return VINF_SUCCESS;
