Index: /trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
===================================================================
--- /trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp	(revision 71610)
+++ /trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp	(revision 71611)
@@ -1950,17 +1950,9 @@
          */
         case VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE:
-            if (VBoxVBVAExHSIsEnabled(&pVdma->CmdVbva))
-            {
-                if (pVdma->CrSrvInfo.pfnGuestCtl)
-                    return pVdma->CrSrvInfo.pfnGuestCtl(pVdma->CrSrvInfo.hSvr,
-                                                        (uint8_t RT_UNTRUSTED_VOLATILE_GUEST *)pCmd->u.cmd.pvCmd,
-                                                        pCmd->u.cmd.cbCmd);
-
-                /* Unexpected. */
-                WARN(("VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE in HGCM-less mode\n"));
-            }
-            else
-                WARN(("VBVAEXHOSTCTL_TYPE_GHH_BE_OPAQUE for disabled vdma VBVA\n"));
-            return VERR_INVALID_STATE;
+            ASSERT_GUEST_LOGREL_RETURN(VBoxVBVAExHSIsEnabled(&pVdma->CmdVbva), VERR_INVALID_STATE);
+            ASSERT_GUEST_LOGREL_RETURN(pVdma->CrSrvInfo.pfnGuestCtl, VERR_INVALID_STATE);
+            return pVdma->CrSrvInfo.pfnGuestCtl(pVdma->CrSrvInfo.hSvr,
+                                                (uint8_t RT_UNTRUSTED_VOLATILE_GUEST *)pCmd->u.cmd.pvCmd,
+                                                pCmd->u.cmd.cbCmd);
 
         /*
@@ -1968,31 +1960,22 @@
          */
         case VBVAEXHOSTCTL_TYPE_GHH_RESIZE:
-            if (VBoxVBVAExHSIsEnabled(&pVdma->CmdVbva))
+        {
+            ASSERT_GUEST_RETURN(VBoxVBVAExHSIsEnabled(&pVdma->CmdVbva), VERR_INVALID_STATE);
+            uint32_t cbCmd = pCmd->u.cmd.cbCmd;
+            ASSERT_GUEST_LOGREL_MSG_RETURN(   !(cbCmd % sizeof(VBOXCMDVBVA_RESIZE_ENTRY))
+                                           && cbCmd > 0,
+                                           ("cbCmd=%#x\n", cbCmd), VERR_INVALID_PARAMETER);
+
+            uint32_t const cElements = cbCmd / sizeof(VBOXCMDVBVA_RESIZE_ENTRY);
+            VBOXCMDVBVA_RESIZE RT_UNTRUSTED_VOLATILE_GUEST *pResize
+                = (VBOXCMDVBVA_RESIZE RT_UNTRUSTED_VOLATILE_GUEST *)pCmd->u.cmd.pvCmd;
+            for (uint32_t i = 0; i < cElements; ++i)
             {
-                uint32_t cbCmd = pCmd->u.cmd.cbCmd;
-                if (   !(cbCmd % sizeof(VBOXCMDVBVA_RESIZE_ENTRY))
-                    && cbCmd > 0)
-                {
-                    uint32_t cElements = cbCmd / sizeof(VBOXCMDVBVA_RESIZE_ENTRY);
-                    VBOXCMDVBVA_RESIZE RT_UNTRUSTED_VOLATILE_GUEST *pResize
-                        = (VBOXCMDVBVA_RESIZE RT_UNTRUSTED_VOLATILE_GUEST *)pCmd->u.cmd.pvCmd;
-                    for (uint32_t i = 0; i < cElements; ++i)
-                    {
-                        VBOXCMDVBVA_RESIZE_ENTRY RT_UNTRUSTED_VOLATILE_GUEST *pEntry = &pResize->aEntries[i];
-                        int rc = vboxVDMACrGuestCtlResizeEntryProcess(pVdma, pEntry);
-                        if (RT_FAILURE(rc))
-                        {
-                            WARN(("vboxVDMACrGuestCtlResizeEntryProcess failed %Rrc\n", rc));
-                            return rc;
-                        }
-                    }
-                    return VINF_SUCCESS;
-                }
-                else
-                    WARN(("invalid buffer size: cbCmd=%#x\n", cbCmd));
-                return VERR_INVALID_PARAMETER;
+                VBOXCMDVBVA_RESIZE_ENTRY RT_UNTRUSTED_VOLATILE_GUEST *pEntry = &pResize->aEntries[i];
+                int rc = vboxVDMACrGuestCtlResizeEntryProcess(pVdma, pEntry);
+                ASSERT_GUEST_LOGREL_MSG_RC_RETURN(rc, ("vboxVDMACrGuestCtlResizeEntryProcess failed for #%u: %Rrc\n", i, rc), rc);
             }
-            WARN(("VBVAEXHOSTCTL_TYPE_GHH_RESIZE for disabled vdma VBVA\n"));
-            return VERR_INVALID_STATE;
+            return VINF_SUCCESS;
+        }
 
         /*
@@ -2002,24 +1985,19 @@
         case VBVAEXHOSTCTL_TYPE_GHH_ENABLE_PAUSED:
         {
+            ASSERT_GUEST(pCmd->u.cmd.cbCmd == sizeof(VBVAENABLE));
+
             VBVAENABLE RT_UNTRUSTED_VOLATILE_GUEST *pEnable = (VBVAENABLE RT_UNTRUSTED_VOLATILE_GUEST *)pCmd->u.cmd.pvCmd;
-            Assert(pCmd->u.cmd.cbCmd == sizeof(VBVAENABLE));
-
             uint32_t const u32Offset = pEnable->u32Offset;
             RT_UNTRUSTED_NONVOLATILE_COPY_FENCE();
 
             int rc = vdmaVBVAEnableProcess(pVdma, u32Offset);
-            if (RT_SUCCESS(rc))
+            ASSERT_GUEST_MSG_RC_RETURN(rc, ("vdmaVBVAEnableProcess -> %Rrc\n", rc), rc);
+
+            if (enmType == VBVAEXHOSTCTL_TYPE_GHH_ENABLE_PAUSED)
             {
-                if (enmType != VBVAEXHOSTCTL_TYPE_GHH_ENABLE_PAUSED)
-                    return VINF_SUCCESS;
-
                 rc = VBoxVBVAExHPPause(&pVdma->CmdVbva);
-                if (RT_SUCCESS(rc))
-                    return VINF_SUCCESS;
-                WARN(("VBoxVBVAExHPPause failed %Rrc\n", rc));
+                ASSERT_GUEST_MSG_RC_RETURN(rc, ("VBoxVBVAExHPPause -> %Rrc\n", rc), rc);
             }
-            else
-                WARN(("vdmaVBVAEnableProcess failed %Rrc\n", rc));
-            return rc;
+            return VINF_SUCCESS;
         }
 
@@ -2030,9 +2008,5 @@
         {
             int rc = vdmaVBVADisableProcess(pVdma, true /* fDoHgcmEnable */);
-            if (RT_FAILURE(rc))
-            {
-                WARN(("vdmaVBVADisableProcess failed %Rrc\n", rc));
-                return rc;
-            }
+            ASSERT_GUEST_MSG_RC_RETURN(rc, ("vdmaVBVADisableProcess -> %Rrc\n", rc), rc);
 
             /* do vgaUpdateDisplayAll right away */
@@ -2044,5 +2018,5 @@
 
         default:
-            WARN(("unexpected ctl type %Rrc\n", pCmd->enmType));
+            ASSERT_GUEST_LOGREL_MSG_FAILED(("unexpected ctl type %d\n", enmType));
             return VERR_INVALID_PARAMETER;
     }
@@ -2184,6 +2158,6 @@
  * @thread VDMA
  */
-static int8_t vboxVDMACrCmdVbvaProcessCmdData(struct VBOXVDMAHOST *pVdma, const VBOXCMDVBVA_HDR RT_UNTRUSTED_VOLATILE_GUEST *pCmd,
-                                              uint32_t cbCmd)
+static int8_t vboxVDMACrCmdVbvaProcessCmdData(struct VBOXVDMAHOST *pVdma,
+                                              const VBOXCMDVBVA_HDR RT_UNTRUSTED_VOLATILE_GUEST *pCmd, uint32_t cbCmd)
 {
     uint8_t bOpCode = pCmd->u8OpCode;
