Index: trunk/src/VBox/VMM/VMMR3/CPUMDbg.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/CPUMDbg.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/CPUMDbg.cpp	(revision 39034)
@@ -264,7 +264,5 @@
 static DECLCALLBACK(int) cpumR3RegGstGet_crX(void *pvUser, PCDBGFREGDESC pDesc, PDBGFREGVAL pValue)
 {
-    PVMCPU      pVCpu   = (PVMCPU)pvUser;
-    void const *pv      = (uint8_t const *)&pVCpu->cpum + pDesc->offRegister;
-
+    PVMCPU pVCpu = (PVMCPU)pvUser;
     VMCPU_ASSERT_EMT(pVCpu);
 
@@ -289,6 +287,5 @@
 {
     int         rc;
-    PVMCPU      pVCpu   = (PVMCPU)pvUser;
-    void const *pv      = (uint8_t const *)&pVCpu->cpum + pDesc->offRegister;
+    PVMCPU      pVCpu = (PVMCPU)pvUser;
 
     VMCPU_ASSERT_EMT(pVCpu);
@@ -346,7 +343,5 @@
 static DECLCALLBACK(int) cpumR3RegGstGet_drX(void *pvUser, PCDBGFREGDESC pDesc, PDBGFREGVAL pValue)
 {
-    PVMCPU      pVCpu   = (PVMCPU)pvUser;
-    void const *pv      = (uint8_t const *)&pVCpu->cpum + pDesc->offRegister;
-
+    PVMCPU pVCpu = (PVMCPU)pvUser;
     VMCPU_ASSERT_EMT(pVCpu);
 
@@ -371,6 +366,5 @@
 {
     int         rc;
-    PVMCPU      pVCpu   = (PVMCPU)pvUser;
-    void const *pv      = (uint8_t const *)&pVCpu->cpum + pDesc->offRegister;
+    PVMCPU      pVCpu = (PVMCPU)pvUser;
 
     VMCPU_ASSERT_EMT(pVCpu);
@@ -418,8 +412,7 @@
 static DECLCALLBACK(int) cpumR3RegGstGet_msr(void *pvUser, PCDBGFREGDESC pDesc, PDBGFREGVAL pValue)
 {
-    PVMCPU      pVCpu   = (PVMCPU)pvUser;
-    void const *pv      = (uint8_t const *)&pVCpu->cpum + pDesc->offRegister;
-
-    VMCPU_ASSERT_EMT(pVCpu);
+    PVMCPU pVCpu = (PVMCPU)pvUser;
+    VMCPU_ASSERT_EMT(pVCpu);
+
     uint64_t u64Value;
     int rc = CPUMQueryGuestMsr(pVCpu, pDesc->offRegister, &u64Value);
@@ -447,5 +440,4 @@
     int         rc;
     PVMCPU      pVCpu   = (PVMCPU)pvUser;
-    void const *pv      = (uint8_t const *)&pVCpu->cpum + pDesc->offRegister;
 
     VMCPU_ASSERT_EMT(pVCpu);
@@ -498,7 +490,5 @@
 static DECLCALLBACK(int) cpumR3RegGstGet_stN(void *pvUser, PCDBGFREGDESC pDesc, PDBGFREGVAL pValue)
 {
-    PVMCPU      pVCpu   = (PVMCPU)pvUser;
-    void const *pv      = (uint8_t const *)&pVCpu->cpum.s.Guest + pDesc->offRegister;
-
+    PVMCPU pVCpu = (PVMCPU)pvUser;
     VMCPU_ASSERT_EMT(pVCpu);
     Assert(pDesc->enmType == DBGFREGVALTYPE_R80);
@@ -587,7 +577,5 @@
 static DECLCALLBACK(int) cpumR3RegHyperGet_drX(void *pvUser, PCDBGFREGDESC pDesc, PDBGFREGVAL pValue)
 {
-    PVMCPU      pVCpu   = (PVMCPU)pvUser;
-    void const *pv      = (uint8_t const *)&pVCpu->cpum + pDesc->offRegister;
-
+    PVMCPU pVCpu = (PVMCPU)pvUser;
     VMCPU_ASSERT_EMT(pVCpu);
 
Index: trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp	(revision 39034)
@@ -396,6 +396,5 @@
         ASMAtomicXchgHandle(&pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(hAlias)], hRealAliasFor, &hAsOld);
         uint32_t cRefs = RTDbgAsRelease(hAsOld);
-        Assert(cRefs > 0);
-        Assert(cRefs != UINT32_MAX);
+        Assert(cRefs > 0); Assert(cRefs != UINT32_MAX); NOREF(cRefs);
         rc = VINF_SUCCESS;
     }
Index: trunk/src/VBox/VMM/VMMR3/DBGFReg.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFReg.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/DBGFReg.cpp	(revision 39034)
@@ -471,5 +471,5 @@
             {
                 bool fInserted2 = RTStrSpaceInsert(&pVM->dbgf.s.RegSpace, &paLookupRecs[iLookupRec].Core);
-                AssertMsg(fInserted2, ("'%s'", paLookupRecs[iLookupRec].Core.pszString));
+                AssertMsg(fInserted2, ("'%s'", paLookupRecs[iLookupRec].Core.pszString)); NOREF(fInserted2);
             }
 
@@ -1725,6 +1725,4 @@
 static void dbgfR3RegNmQueryAllInSet(PCDBGFREGSET pSet, size_t cRegsToQuery, PDBGFREGENTRYNM paRegs, size_t cRegs)
 {
-    int rc = VINF_SUCCESS;
-
     if (cRegsToQuery > pSet->cDescs)
         cRegsToQuery = pSet->cDescs;
Index: trunk/src/VBox/VMM/VMMR3/EMHwaccm.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/EMHwaccm.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/EMHwaccm.cpp	(revision 39034)
@@ -182,5 +182,7 @@
 #endif
 {
+#ifdef LOG_ENABLED
     PCPUMCTX pCtx = pVCpu->em.s.pCtx;
+#endif
     int      rc;
 
Index: trunk/src/VBox/VMM/VMMR3/FTM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/FTM.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/FTM.cpp	(revision 39034)
@@ -882,5 +882,5 @@
                 pNode->pPage = (void *)(pNode + 1);
                 bool fRet = RTAvlGCPhysInsert(&pVM->ftm.s.standby.pPhysPageTree, &pNode->Core);
-                Assert(fRet);
+                Assert(fRet); NOREF(fRet);
             }
 
@@ -1018,5 +1018,5 @@
         return VINF_SUCCESS;
 
-    /** todo: verify VM config. */
+    /** @todo verify VM config. */
 
     /*
@@ -1031,5 +1031,5 @@
      * Command processing loop.
      */
-    bool fDone = false;
+    //bool fDone = false;
     for (;;)
     {
Index: trunk/src/VBox/VMM/VMMR3/HWACCM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/HWACCM.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/HWACCM.cpp	(revision 39034)
@@ -1560,5 +1560,5 @@
     for (VMCPUID i = 0; i < pVM->cCpus; i++)
     {
-        PVMCPU pVCpu = &pVM->aCpus[i];
+        PVMCPU pVCpu = &pVM->aCpus[i]; NOREF(pVCpu);
 
 #ifdef VBOX_WITH_STATISTICS
Index: trunk/src/VBox/VMM/VMMR3/PATM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PATM.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/PATM.cpp	(revision 39034)
@@ -5626,5 +5626,5 @@
         /* Put the new patch back into the tree, because removing the old one kicked this one out. (hack alert) */
         bool fInserted = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTree, &pNewPatchRec->Core);
-        Assert(fInserted);
+        Assert(fInserted); NOREF(fInserted);
 
         LogRel(("PATM: patmR3RefreshPatch: succeeded to refresh patch at %RRv \n", pInstrGC));
@@ -5678,5 +5678,5 @@
         /* Put the old patch back into the tree (or else it won't be saved) (hack alert) */
         bool fInserted = RTAvloU32Insert(&pVM->patm.s.PatchLookupTreeHC->PatchTree, &pPatchRec->Core);
-        Assert(fInserted);
+        Assert(fInserted); NOREF(fInserted);
 
         /* Enable again in case the dirty instruction is near the end and there are safe code paths. */
Index: trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp	(revision 39034)
@@ -1085,5 +1085,7 @@
                            size_t cbRead)
 {
+#ifdef VBOX_WITH_STATISTICS
     PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
+#endif
 
     LogFlowFunc(("pTask=%#p pEndpoint=%#p off=%RTfoff paSegments=%#p cSegments=%zu cbRead=%zu\n",
Index: trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp	(revision 39034)
@@ -1,10 +1,9 @@
 /* $Id$ */
 /** @file
- * PDM Async I/O - Transport data asynchronous in R3 using EMT.
- * Async File I/O manager.
+ * PDM Async I/O - Async File I/O manager.
  */
 
 /*
- * Copyright (C) 2006-2008 Oracle Corporation
+ * Copyright (C) 2006-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -16,4 +15,8 @@
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
  */
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
 #define LOG_GROUP LOG_GROUP_PDM_ASYNC_COMPLETION
 #define RT_STRICT
@@ -29,7 +32,8 @@
 
 /** The update period for the I/O load statistics in ms. */
-#define PDMACEPFILEMGR_LOAD_UPDATE_PERIOD 1000
+#define PDMACEPFILEMGR_LOAD_UPDATE_PERIOD   1000
 /** Maximum number of requests a manager will handle. */
-#define PDMACEPFILEMGR_REQS_STEP 512
+#define PDMACEPFILEMGR_REQS_STEP            512
+
 
 /*******************************************************************************
@@ -47,11 +51,10 @@
                                                int rc, size_t cbTransfered);
 
+
 int pdmacFileAioMgrNormalInit(PPDMACEPFILEMGR pAioMgr)
 {
-    int rc = VINF_SUCCESS;
-
     pAioMgr->cRequestsActiveMax = PDMACEPFILEMGR_REQS_STEP;
 
-    rc = RTFileAioCtxCreate(&pAioMgr->hAioCtx, RTFILEAIO_UNLIMITED_REQS);
+    int rc = RTFileAioCtxCreate(&pAioMgr->hAioCtx, RTFILEAIO_UNLIMITED_REQS);
     if (rc == VERR_OUT_OF_RANGE)
         rc = RTFileAioCtxCreate(&pAioMgr->hAioCtx, pAioMgr->cRequestsActiveMax);
@@ -245,7 +248,4 @@
 static void pdmacFileAioMgrNormalBalanceLoad(PPDMACEPFILEMGR pAioMgr)
 {
-    PPDMACEPFILEMGR pAioMgrNew = NULL;
-    int rc = VINF_SUCCESS;
-
     /*
      * Check if balancing would improve the situation.
@@ -253,7 +253,8 @@
     if (pdmacFileAioMgrNormalIsBalancePossible(pAioMgr))
     {
-        PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pAioMgr->pEndpointsHead->Core.pEpClass;
-
-        rc = pdmacFileAioMgrCreate(pEpClassFile, &pAioMgrNew, PDMACEPFILEMGRTYPE_ASYNC);
+        PPDMASYNCCOMPLETIONEPCLASSFILE  pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pAioMgr->pEndpointsHead->Core.pEpClass;
+        PPDMACEPFILEMGR                 pAioMgrNew = NULL;
+
+        int rc = pdmacFileAioMgrCreate(pEpClassFile, &pAioMgrNew, PDMACEPFILEMGRTYPE_ASYNC);
         if (RT_SUCCESS(rc))
         {
@@ -323,7 +324,4 @@
 static int pdmacFileAioMgrNormalGrow(PPDMACEPFILEMGR pAioMgr)
 {
-    int rc = VINF_SUCCESS;
-    RTFILEAIOCTX hAioCtxNew = NIL_RTFILEAIOCTX;
-
     LogFlowFunc(("pAioMgr=%#p\n", pAioMgr));
 
@@ -342,6 +340,5 @@
     {
         RTFileClose(pCurr->hFile);
-        rc = RTFileOpen(&pCurr->hFile, pCurr->Core.pszUri, pCurr->fFlags);
-        AssertRC(rc);
+        int rc2 = RTFileOpen(&pCurr->hFile, pCurr->Core.pszUri, pCurr->fFlags); AssertRC(rc);
 
         pCurr = pCurr->AioMgr.pEndpointNext;
@@ -352,5 +349,6 @@
     pAioMgr->cRequestsActiveMax += PDMACEPFILEMGR_REQS_STEP;
 
-    rc = RTFileAioCtxCreate(&hAioCtxNew, RTFILEAIO_UNLIMITED_REQS);
+    RTFILEAIOCTX hAioCtxNew = NIL_RTFILEAIOCTX;
+    int rc = RTFileAioCtxCreate(&hAioCtxNew, RTFILEAIO_UNLIMITED_REQS);
     if (rc == VERR_OUT_OF_RANGE)
         rc = RTFileAioCtxCreate(&hAioCtxNew, pAioMgr->cRequestsActiveMax);
@@ -360,5 +358,5 @@
         /* Close the old context. */
         rc = RTFileAioCtxDestroy(pAioMgr->hAioCtx);
-        AssertRC(rc);
+        AssertRC(rc); /** @todo r=bird: Ignoring error code, will propagate. */
 
         pAioMgr->hAioCtx = hAioCtxNew;
@@ -387,9 +385,8 @@
     /* Assign the file to the new context. */
     pCurr = pAioMgr->pEndpointsHead;
-
     while (pCurr)
     {
         rc = RTFileAioCtxAssociateWithFile(pAioMgr->hAioCtx, pCurr->hFile);
-        AssertRC(rc);
+        AssertRC(rc); /** @todo r=bird: Ignoring error code, will propagate. */
 
         pCurr = pCurr->AioMgr.pEndpointNext;
@@ -420,9 +417,9 @@
 DECLINLINE(bool) pdmacFileAioMgrNormalRcIsFatal(int rcReq)
 {
-    return    rcReq == VERR_DEV_IO_ERROR
-           || rcReq == VERR_FILE_IO_ERROR
-           || rcReq == VERR_DISK_IO_ERROR
-           || rcReq == VERR_DISK_FULL
-           || rcReq == VERR_FILE_TOO_BIG;
+    return rcReq == VERR_DEV_IO_ERROR
+        || rcReq == VERR_FILE_IO_ERROR
+        || rcReq == VERR_DISK_IO_ERROR
+        || rcReq == VERR_DISK_FULL
+        || rcReq == VERR_FILE_TOO_BIG;
 }
 
@@ -504,7 +501,6 @@
 static RTFILEAIOREQ pdmacFileAioMgrNormalRequestAlloc(PPDMACEPFILEMGR pAioMgr)
 {
-    RTFILEAIOREQ hReq = NIL_RTFILEAIOREQ;
-
     /* Get a request handle. */
+    RTFILEAIOREQ hReq;
     if (pAioMgr->iFreeEntry > 0)
     {
@@ -517,5 +513,5 @@
     {
         int rc = RTFileAioReqCreate(&hReq);
-        AssertRC(rc);
+        AssertRCReturn(rc, NIL_RTFILEAIOREQ);
     }
 
@@ -546,6 +542,4 @@
                                             PRTFILEAIOREQ pahReqs, unsigned cReqs)
 {
-    int rc;
-
     pAioMgr->cRequestsActive += cReqs;
     pEndpoint->AioMgr.cRequestsActive += cReqs;
@@ -554,5 +548,5 @@
     LogFlow(("Endpoint has a total of %d active requests now\n", pEndpoint->AioMgr.cRequestsActive));
 
-    rc = RTFileAioCtxSubmit(pAioMgr->hAioCtx, pahReqs, cReqs);
+    int rc = RTFileAioCtxSubmit(pAioMgr->hAioCtx, pahReqs, cReqs);
     if (RT_FAILURE(rc))
     {
@@ -612,9 +606,5 @@
                 }
                 else if (rcReq != VERR_FILE_AIO_IN_PROGRESS)
-                {
-                    PPDMACTASKFILE pTask = (PPDMACTASKFILE)RTFileAioReqGetUser(pahReqs[i]);
-
                     pdmacFileAioMgrNormalReqCompleteRc(pAioMgr, pahReqs[i], rcReq, 0);
-                }
             }
 
@@ -645,10 +635,9 @@
                                                PPDMACTASKFILE pTask)
 {
-    PPDMACFILERANGELOCK pRangeLock = NULL; /** < Range lock */
-
     AssertMsg(   pTask->enmTransferType == PDMACTASKFILETRANSFER_WRITE
               || pTask->enmTransferType == PDMACTASKFILETRANSFER_READ,
                  ("Invalid task type %d\n", pTask->enmTransferType));
 
+    PPDMACFILERANGELOCK pRangeLock;
     pRangeLock = (PPDMACFILERANGELOCK)RTAvlrFileOffsetRangeGet(pEndpoint->AioMgr.pTreeRangesLocked, offStart);
     if (!pRangeLock)
@@ -666,5 +655,5 @@
     /* Check whether we have one of the situations explained below */
     if (   pRangeLock
-#if 0 /** @todo: later. For now we will just block all requests if they interfere */
+#if 0 /** @todo later. For now we will just block all requests if they interfere */
         && (   (pRangeLock->fReadLock && pTask->enmTransferType == PDMACTASKFILETRANSFER_WRITE)
             || (!pRangeLock->fReadLock)
@@ -745,13 +734,8 @@
                                                     PPDMACTASKFILE pTask, PRTFILEAIOREQ phReq)
 {
-    int rc = VINF_SUCCESS;
-    RTFILEAIOREQ hReq = NIL_RTFILEAIOREQ;
-    PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pEndpoint->Core.pEpClass;
-    void *pvBuf = pTask->DataSeg.pvSeg;
-
     AssertMsg(   pTask->enmTransferType == PDMACTASKFILETRANSFER_WRITE
-                || (uint64_t)(pTask->Off + pTask->DataSeg.cbSeg) <= pEndpoint->cbFile,
-                ("Read exceeds file size offStart=%RTfoff cbToTransfer=%d cbFile=%llu\n",
-                pTask->Off, pTask->DataSeg.cbSeg, pEndpoint->cbFile));
+              || (uint64_t)(pTask->Off + pTask->DataSeg.cbSeg) <= pEndpoint->cbFile,
+              ("Read exceeds file size offStart=%RTfoff cbToTransfer=%d cbFile=%llu\n",
+               pTask->Off, pTask->DataSeg.cbSeg, pEndpoint->cbFile));
 
     pTask->fPrefetch = false;
@@ -776,10 +760,10 @@
      * the same range. This will result in data corruption if both are executed concurrently.
      */
+    int  rc = VINF_SUCCESS;
     bool fLocked = pdmacFileAioMgrNormalIsRangeLocked(pEndpoint, pTask->Off, pTask->DataSeg.cbSeg, pTask);
-
     if (!fLocked)
     {
         /* Get a request handle. */
-        hReq = pdmacFileAioMgrNormalRequestAlloc(pAioMgr);
+        RTFILEAIOREQ hReq = pdmacFileAioMgrNormalRequestAlloc(pAioMgr);
         AssertMsg(hReq != NIL_RTFILEAIOREQ, ("Out of request handles\n"));
 
@@ -823,9 +807,4 @@
                                                        PPDMACTASKFILE pTask, PRTFILEAIOREQ phReq)
 {
-    int rc = VINF_SUCCESS;
-    RTFILEAIOREQ hReq = NIL_RTFILEAIOREQ;
-    PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pEndpoint->Core.pEpClass;
-    void *pvBuf = pTask->DataSeg.pvSeg;
-
     /*
      * Check if the alignment requirements are met.
@@ -862,10 +841,13 @@
      * the same range. This will result in data corruption if both are executed concurrently.
      */
+    int  rc = VINF_SUCCESS;
     bool fLocked = pdmacFileAioMgrNormalIsRangeLocked(pEndpoint, offStart, cbToTransfer, pTask);
-
     if (!fLocked)
     {
+        PPDMASYNCCOMPLETIONEPCLASSFILE  pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pEndpoint->Core.pEpClass;
+        void                           *pvBuf        = pTask->DataSeg.pvSeg;
+
         /* Get a request handle. */
-        hReq = pdmacFileAioMgrNormalRequestAlloc(pAioMgr);
+        RTFILEAIOREQ hReq = pdmacFileAioMgrNormalRequestAlloc(pAioMgr);
         AssertMsg(hReq != NIL_RTFILEAIOREQ, ("Out of request handles\n"));
 
@@ -963,6 +945,5 @@
     RTFILEAIOREQ  apReqs[20];
     unsigned      cRequests = 0;
-    unsigned      cMaxRequests = pAioMgr->cRequestsActiveMax - pAioMgr->cRequestsActive;
-    int           rc = VINF_SUCCESS;
+    int           rc        = VINF_SUCCESS;
 
     AssertMsg(pEndpoint->enmState == PDMASYNCCOMPLETIONENDPOINTFILESTATE_ACTIVE,
@@ -1147,5 +1128,5 @@
         pEndpoint->AioMgr.pReqsPendingTail = NULL;
         rc = pdmacFileAioMgrNormalProcessTaskList(pTasksHead, pAioMgr, pEndpoint);
-        AssertRC(rc);
+        AssertRC(rc);                   /** @todo r=bird: status code potentially overwritten.  */
     }
 
@@ -1592,11 +1573,11 @@
 int pdmacFileAioMgrNormal(RTTHREAD ThreadSelf, void *pvUser)
 {
-    int rc                  = VINF_SUCCESS;
-    PPDMACEPFILEMGR pAioMgr = (PPDMACEPFILEMGR)pvUser;
-    uint64_t uMillisEnd     = RTTimeMilliTS() + PDMACEPFILEMGR_LOAD_UPDATE_PERIOD;
-
-    while (   (pAioMgr->enmState == PDMACEPFILEMGRSTATE_RUNNING)
-           || (pAioMgr->enmState == PDMACEPFILEMGRSTATE_SUSPENDING)
-           || (pAioMgr->enmState == PDMACEPFILEMGRSTATE_GROWING))
+    int             rc          = VINF_SUCCESS;
+    PPDMACEPFILEMGR pAioMgr     = (PPDMACEPFILEMGR)pvUser;
+    uint64_t        uMillisEnd  = RTTimeMilliTS() + PDMACEPFILEMGR_LOAD_UPDATE_PERIOD;
+
+    while (   pAioMgr->enmState == PDMACEPFILEMGRSTATE_RUNNING
+           || pAioMgr->enmState == PDMACEPFILEMGRSTATE_SUSPENDING
+           || pAioMgr->enmState == PDMACEPFILEMGRSTATE_GROWING)
     {
         if (!pAioMgr->cRequestsActive)
Index: trunk/src/VBox/VMM/VMMR3/PDMBlkCache.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PDMBlkCache.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/PDMBlkCache.cpp	(revision 39034)
@@ -953,5 +953,5 @@
                 /* Insert into the tree. */
                 bool fInserted = RTAvlrU64Insert(pBlkCache->pTree, &pEntry->Core);
-                Assert(fInserted);
+                Assert(fInserted); NOREF(fInserted);
 
                 /* Add to the dirty list. */
@@ -1545,16 +1545,13 @@
 static PPDMBLKCACHEENTRY pdmBlkCacheGetCacheEntryByOffset(PPDMBLKCACHE pBlkCache, uint64_t off)
 {
-    PPDMBLKCACHEGLOBAL pCache = pBlkCache->pCache;
-    PPDMBLKCACHEENTRY pEntry = NULL;
-
-    STAM_PROFILE_ADV_START(&pCache->StatTreeGet, Cache);
+    STAM_PROFILE_ADV_START(&pBlkCache->pCache->StatTreeGet, Cache);
 
     RTSemRWRequestRead(pBlkCache->SemRWEntries, RT_INDEFINITE_WAIT);
-    pEntry = (PPDMBLKCACHEENTRY)RTAvlrU64RangeGet(pBlkCache->pTree, off);
+    PPDMBLKCACHEENTRY pEntry = (PPDMBLKCACHEENTRY)RTAvlrU64RangeGet(pBlkCache->pTree, off);
     if (pEntry)
         pdmBlkCacheEntryRef(pEntry);
     RTSemRWReleaseRead(pBlkCache->SemRWEntries);
 
-    STAM_PROFILE_ADV_STOP(&pCache->StatTreeGet, Cache);
+    STAM_PROFILE_ADV_STOP(&pBlkCache->pCache->StatTreeGet, Cache);
 
     return pEntry;
@@ -1573,7 +1570,5 @@
                                                     PPDMBLKCACHEENTRY *ppEntryAbove)
 {
-    PPDMBLKCACHEGLOBAL pCache = pBlkCache->pCache;
-
-    STAM_PROFILE_ADV_START(&pCache->StatTreeGet, Cache);
+    STAM_PROFILE_ADV_START(&pBlkCache->pCache->StatTreeGet, Cache);
 
     RTSemRWRequestRead(pBlkCache->SemRWEntries, RT_INDEFINITE_WAIT);
@@ -1587,16 +1582,14 @@
     RTSemRWReleaseRead(pBlkCache->SemRWEntries);
 
-    STAM_PROFILE_ADV_STOP(&pCache->StatTreeGet, Cache);
+    STAM_PROFILE_ADV_STOP(&pBlkCache->pCache->StatTreeGet, Cache);
 }
 
 static void pdmBlkCacheInsertEntry(PPDMBLKCACHE pBlkCache, PPDMBLKCACHEENTRY pEntry)
 {
-    PPDMBLKCACHEGLOBAL pCache = pBlkCache->pCache;
-
-    STAM_PROFILE_ADV_START(&pCache->StatTreeInsert, Cache);
+    STAM_PROFILE_ADV_START(&pBlkCache->pCache->StatTreeInsert, Cache);
     RTSemRWRequestWrite(pBlkCache->SemRWEntries, RT_INDEFINITE_WAIT);
     bool fInserted = RTAvlrU64Insert(pBlkCache->pTree, &pEntry->Core);
-    AssertMsg(fInserted, ("Node was not inserted into tree\n"));
-    STAM_PROFILE_ADV_STOP(&pCache->StatTreeInsert, Cache);
+    AssertMsg(fInserted, ("Node was not inserted into tree\n")); NOREF(fInserted);
+    STAM_PROFILE_ADV_STOP(&pBlkCache->pCache->StatTreeInsert, Cache);
     RTSemRWReleaseWrite(pBlkCache->SemRWEntries);
 }
@@ -2475,5 +2468,5 @@
                         {
                             pdmBlkCacheLockEnter(pCache);
-                            pdmBlkCacheEntryRemoveFromList(pEntry); 
+                            pdmBlkCacheEntryRemoveFromList(pEntry);
 
                             STAM_PROFILE_ADV_START(&pCache->StatTreeRemove, Cache);
@@ -2521,5 +2514,5 @@
                         {
                             pdmBlkCacheLockEnter(pCache);
-                            pdmBlkCacheEntryRemoveFromList(pEntry); 
+                            pdmBlkCacheEntryRemoveFromList(pEntry);
 
                             RTSemRWRequestWrite(pBlkCache->SemRWEntries, RT_INDEFINITE_WAIT);
@@ -2538,5 +2531,5 @@
                 {
                     pdmBlkCacheLockEnter(pCache);
-                    pdmBlkCacheEntryRemoveFromList(pEntry); 
+                    pdmBlkCacheEntryRemoveFromList(pEntry);
 
                     RTSemRWRequestWrite(pBlkCache->SemRWEntries, RT_INDEFINITE_WAIT);
@@ -2581,5 +2574,5 @@
     PPDMBLKCACHEREQ pReq = pWaiter->pReq;
 
-    pdmBlkCacheReqUpdate(pBlkCache, pWaiter->pReq, rc, true);
+    pdmBlkCacheReqUpdate(pBlkCache, pReq, rc, true);
 
     RTMemFree(pWaiter);
Index: trunk/src/VBox/VMM/VMMR3/PDMUsb.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PDMUsb.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/PDMUsb.cpp	(revision 39034)
@@ -1210,5 +1210,5 @@
     PVM pVM = pUsbIns->Internal.s.pVM;
     VM_ASSERT_EMT(pVM);
-    /** @todo int rc = DBGFR3InfoRegisterUsb(pVM, pszName, pszDesc, pfnHandler, pUsbIns); */
+    NOREF(pVM); /** @todo int rc = DBGFR3InfoRegisterUsb(pVM, pszName, pszDesc, pfnHandler, pUsbIns); */
     int rc = VERR_NOT_IMPLEMENTED; AssertFailed();
 
Index: trunk/src/VBox/VMM/VMMR3/PGM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGM.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/PGM.cpp	(revision 39034)
@@ -3296,5 +3296,7 @@
 VMMR3DECL(int) PGMR3ChangeMode(PVM pVM, PVMCPU pVCpu, PGMMODE enmGuestMode)
 {
+#if HC_ARCH_BITS == 32
     bool fIsOldGuestPagingMode64Bits = (pVCpu->pgm.s.enmGuestMode >= PGMMODE_AMD64);
+#endif
     bool fIsNewGuestPagingMode64Bits = (enmGuestMode >= PGMMODE_AMD64);
 
Index: trunk/src/VBox/VMM/VMMR3/PGMDbg.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGMDbg.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/PGMDbg.cpp	(revision 39034)
@@ -204,5 +204,4 @@
     /* partial read that failed, chop it up in pages. */
     *pcbRead = 0;
-    size_t const cbReq = cb;
     rc = VINF_SUCCESS;
     while (cb > 0)
@@ -1466,5 +1465,5 @@
 
     uint32_t iFirst, iLast;
-    uint64_t u64BaseAddress = pgmR3DumpHierarchyCalcRange(pState, X86_PD_SHIFT, X86_PG_ENTRIES, &iFirst, &iLast);
+    pgmR3DumpHierarchyCalcRange(pState, X86_PD_SHIFT, X86_PG_ENTRIES, &iFirst, &iLast);
     for (uint32_t i = iFirst; i <= iLast; i++)
     {
@@ -2143,5 +2142,5 @@
 
     uint32_t iFirst, iLast;
-    uint64_t u64BaseAddress = pgmR3DumpHierarchyCalcRange(pState, X86_PD_SHIFT, X86_PG_ENTRIES, &iFirst, &iLast);
+    pgmR3DumpHierarchyCalcRange(pState, X86_PD_SHIFT, X86_PG_ENTRIES, &iFirst, &iLast);
     for (uint32_t i = iFirst; i <= iLast; i++)
     {
Index: trunk/src/VBox/VMM/VMMR3/PGMMap.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGMMap.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/PGMMap.cpp	(revision 39034)
@@ -1017,5 +1017,7 @@
 {
     PPGM   pPGM  = &pVM->pgm.s;
+#ifdef VBOX_STRICT
     PVMCPU pVCpu = VMMGetCpu(pVM);
+#endif
     pgmLock(pVM);                           /* to avoid assertions */
 
Index: trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp	(revision 39034)
@@ -4262,5 +4262,4 @@
 
 #ifdef VBOX_STRICT
-        bool fOk = true;
         uint32_t i;
         for (i = iClear; i < pVM->pgm.s.cHandyPages; i++)
Index: trunk/src/VBox/VMM/VMMR3/PGMPool.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGMPool.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/PGMPool.cpp	(revision 39034)
@@ -853,5 +853,5 @@
         /* First write protect the page again to catch all write accesses. (before checking for changes -> SMP) */
         int rc = PGMHandlerPhysicalReset(pVM, pPage->GCPhys & PAGE_BASE_GC_MASK);
-        Assert(rc == VINF_SUCCESS);
+        AssertRCSuccess(rc);
         pPage->fDirty = false;
 
Index: trunk/src/VBox/VMM/VMMR3/PGMSavedState.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGMSavedState.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/PGMSavedState.cpp	(revision 39034)
@@ -3097,6 +3097,5 @@
 static DECLCALLBACK(int) pgmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
 {
-    int     rc;
-    PPGM    pPGM = &pVM->pgm.s;
+    int rc;
 
     /*
Index: trunk/src/VBox/VMM/VMMR3/PGMSharedPage.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGMSharedPage.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/PGMSharedPage.cpp	(revision 39034)
@@ -219,5 +219,5 @@
     /* We must stall other VCPUs as we'd otherwise have to send IPI flush commands for every single change we make. */
     int rc = VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ONE_BY_ONE, pgmR3SharedModuleRegRendezvous, &idCpu);
-    Assert(rc == VINF_SUCCESS);
+    AssertRCSuccess(rc);
 }
 #endif
Index: trunk/src/VBox/VMM/VMMR3/PGMShw.h
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGMShw.h	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/PGMShw.h	(revision 39034)
@@ -186,5 +186,4 @@
     PPGMPOOLPAGE pNewShwPageCR3;
     PVM          pVM       = pVCpu->pVMR3;
-    PPGMPOOL     pPool     = pVM->pgm.s.CTX_SUFF(pPool);
 
     Assert(HWACCMIsNestedPagingActive(pVM) == pVM->pgm.s.fNestedPaging);
Index: trunk/src/VBox/VMM/VMMR3/SELM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/SELM.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/SELM.cpp	(revision 39034)
@@ -1840,5 +1840,4 @@
      * Figure out the size of what need to monitor.
      */
-    bool fNoRing1Stack = true;
     /* We're not interested in any 16-bit TSSes. */
     uint32_t cbMonitoredTss = cbTss;
Index: trunk/src/VBox/VMM/VMMR3/TM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/TM.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/TM.cpp	(revision 39034)
@@ -1537,6 +1537,5 @@
          * Change to the DESTROY state.
          */
-        TMTIMERSTATE enmState    = pTimer->enmState;
-        TMTIMERSTATE enmNewState = enmState;
+        TMTIMERSTATE const enmState = pTimer->enmState;
         Log2(("TMTimerDestroy: %p:{.enmState=%s, .pszDesc='%s'} cRetries=%d\n",
               pTimer, tmTimerState(enmState), R3STRING(pTimer->pszDesc), cRetries));
@@ -2128,9 +2127,9 @@
 
         /* Check if stopped by expired timer. */
-        uint64_t u64Expire = pNext->u64Expire;
-        if (u64Now >= pNext->u64Expire)
+        uint64_t const u64Expire = pNext->u64Expire;
+        if (u64Now >= u64Expire)
         {
             STAM_COUNTER_INC(&pVM->tm.s.StatVirtualSyncRunStop);
-            u64Now = pNext->u64Expire;
+            u64Now = u64Expire;
             ASMAtomicWriteU64(&pVM->tm.s.u64VirtualSync, u64Now);
             ASMAtomicWriteBool(&pVM->tm.s.fVirtualSyncTicking, false);
Index: trunk/src/VBox/VMM/VMMR3/VM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/VM.cpp	(revision 39031)
+++ trunk/src/VBox/VMM/VMMR3/VM.cpp	(revision 39034)
@@ -1767,5 +1767,5 @@
             {
                 int rc2 = VMR3ReqCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)SSMR3LiveDone, 1, pSSM);
-                AssertMsg(rc2 == rc, ("%Rrc != %Rrc\n", rc2, rc));
+                AssertMsg(rc2 == rc, ("%Rrc != %Rrc\n", rc2, rc)); NOREF(rc2);
             }
         }
