Index: trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
===================================================================
--- trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c	(revision 11405)
+++ trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c	(revision 11423)
@@ -49,4 +49,5 @@
 
 #include "../SUPDrvInternal.h"
+#include <VBox/log.h>
 #include <iprt/semaphore.h>
 #include <iprt/spinlock.h>
@@ -188,5 +189,5 @@
 int _init(void)
 {
-    dprintf(("VBoxDrvSolaris _init"));
+    LogFlow((DEVICE_NAME ":_init"));
 
     int rc = ddi_soft_state_init(&g_pVBoxDrvSolarisState, sizeof(vbox_devstate_t), 8);
@@ -200,5 +201,5 @@
     }
 
-    cmn_err(CE_CONT, "VBoxDrvSolaris _init failed with rc=%d", rc);
+    cmn_err(CE_CONT, "VBoxDrvSolaris _init failed with rc=%d\n", rc);
     return rc;
 }
@@ -207,5 +208,5 @@
 int _fini(void)
 {
-    dprintf(("VBoxDrvSolaris _fini"));
+    LogFlow((DEVICE_NAME ":_fini"));
 
     int e = mod_remove(&g_VBoxDrvSolarisModLinkage);
@@ -220,7 +221,6 @@
 int _info(struct modinfo *pModInfo)
 {
-    dprintf(("VBoxDrvSolaris _info"));
+    LogFlow((DEVICE_NAME ":_info"));
     int e = mod_info(&g_VBoxDrvSolarisModLinkage, pModInfo);
-    dprintf(("VBoxDrvSolaris _info returns %d", e));
     return e;
 }
@@ -237,5 +237,5 @@
 static int VBoxDrvSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd)
 {
-    dprintf(("VBoxDrvSolarisAttach"));
+    LogFlow((DEVICE_NAME ":VBoxDrvSolarisAttach\n"));
 
     switch (enmCmd)
@@ -250,5 +250,5 @@
             if (ddi_soft_state_zalloc(g_pVBoxDrvSolarisState, instance) != DDI_SUCCESS)
             {
-                cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: state alloc failed");
+                LogRel((DEVICE_NAME ":VBoxDrvSolarisAttach: state alloc failed\n"));
                 return DDI_FAILURE;
             }
@@ -290,5 +290,5 @@
                         /* Is this really necessary? */
                         ddi_remove_minor_node(pDip, NULL);
-                        cmn_err(CE_NOTE,"VBoxDrvSolarisAttach: ddi_create_minor_node failed.");
+                        LogRel((DEVICE_NAME ":VBoxDrvSolarisAttach: ddi_create_minor_node failed.\n"));
 
                         RTSpinlockDestroy(g_Spinlock);
@@ -296,13 +296,13 @@
                     }
                     else
-                        cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: RTSpinlockCreate failed");
+                        LogRel((DEVICE_NAME ":VBoxDrvSolarisAttach: RTSpinlockCreate failed\n"));
                     supdrvDeleteDevExt(&g_DevExt);
                 }
                 else
-                    cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: supdrvInitDevExt failed");
+                    LogRel((DEVICE_NAME ":VBoxDrvSolarisAttach: supdrvInitDevExt failed\n"));
                 RTR0Term();
             }
             else
-                cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: failed to init R0Drv");
+                LogRel((DEVICE_NAME ":VBoxDrvSolarisAttach: failed to init R0Drv\n"));
             memset(&g_DevExt, 0, sizeof(g_DevExt));
             break;
@@ -339,6 +339,5 @@
     int rc = VINF_SUCCESS;
 
-
-    dprintf(("VBoxDrvSolarisDetach"));
+    LogFlow((DEVICE_NAME ":VBoxDrvSolarisDetach\n"));
     switch (enmCmd)
     {
@@ -363,5 +362,4 @@
 
             memset(&g_DevExt, 0, sizeof(g_DevExt));
-            dprintf(("VBoxDrvSolarisDetach: Clean Up Done."));
             return DDI_SUCCESS;
         }
@@ -391,5 +389,5 @@
     int                 rc;
     PSUPDRVSESSION      pSession;
-    dprintf(("VBoxDrvSolarisOpen: pDev=%p:%#x\n", pDev, *pDev));
+    LogFlow((DEVICE_NAME ":VBoxDrvSolarisOpen: pDev=%p:%#x\n", pDev, *pDev));
 
 #ifndef USE_SESSION_HASH
@@ -413,5 +411,5 @@
     if (!pState)
     {
-        cmn_err(CE_NOTE,"VBoxDrvSolarisOpen: too many open instances.");
+        LogRel((DEVICE_NAME ":VBoxDrvSolarisOpen: too many open instances.\n"));
         return ENXIO;
     }
@@ -428,6 +426,5 @@
         pState->pSession = pSession;
         *pDev = makedevice(getmajor(*pDev), iOpenInstance);
-        dprintf(("VBoxDrvSolarisOpen: returns pDev=%#x pSession=%p pState=%p\n", *pDev, pSession, pState));
-        OSDBGPRINT(("VBoxDrvSolarisOpen: Dev=%#x pSession=%p pid=%d r0proc=%p thread=%p\n",
+        LogFlow((DEVICE_NAME ":VBoxDrvSolarisOpen: Dev=%#x pSession=%p pid=%d r0proc=%p thread=%p\n",
                     *pDev, pSession, RTProcSelf(), RTR0ProcHandleSelf(), RTThreadNativeSelf() ));
         return 0;
@@ -460,5 +457,5 @@
         g_apSessionHashTab[iHash] = pSession;
         RTSpinlockReleaseNoInts(g_Spinlock, &Tmp);
-        OSDBGPRINT(("VBoxDrvSolarisOpen success"));
+        LogFlow((DEVICE_NAME ":VBoxDrvSolarisOpen success\n"));
     }
 
@@ -473,5 +470,5 @@
     if (instance >= DEVICE_MAXINSTANCES)
     {
-        cmn_err(CE_NOTE, "VBoxDrvSolarisOpen: All instances exhausted\n");
+        LogRel((DEVICE_NAME ":VBoxDrvSolarisOpen: All instances exhausted\n"));
         return ENXIO;
     }
@@ -486,5 +483,6 @@
 static int VBoxDrvSolarisClose(dev_t Dev, int flag, int otyp, cred_t *cred)
 {
-    dprintf(("VBoxDrvSolarisClose: Dev=%#x\n", Dev));
+    LogFlow((DEVICE_NAME ":VBoxDrvSolarisClose: Dev=%#x\n", Dev));
+
 #ifndef USE_SESSION_HASH
     /*
@@ -494,5 +492,5 @@
     if (!pState)
     {
-        OSDBGPRINT(("VBoxDrvSolarisClose: no state data for %#x (%d)\n", Dev, getminor(Dev)));
+        LogRel((DEVICE_NAME ":VBoxDrvSolarisClose: no state data for %#x (%d)\n", Dev, getminor(Dev)));
         return EFAULT;
     }
@@ -504,8 +502,9 @@
     if (!pSession)
     {
-        OSDBGPRINT(("VBoxDrvSolarisClose: no session in state data for %#x (%d)\n", Dev, getminor(Dev)));
+        LogRel((DEVICE_NAME ":VBoxDrvSolarisClose: no session in state data for %#x (%d)\n", Dev, getminor(Dev)));
         return EFAULT;
     }
-    dprintf(("VBoxDrvSolarisClose: Dev=%#x pSession=%p pid=%d r0proc=%p thread=%p\n", Dev, pSession, RTProcSelf(), RTR0ProcHandleSelf(), RTThreadNativeSelf() ));
+    LogFlow((DEVICE_NAME ":VBoxDrvSolarisClose: Dev=%#x pSession=%p pid=%d r0proc=%p thread=%p\n",
+            Dev, pSession, RTProcSelf(), RTR0ProcHandleSelf(), RTThreadNativeSelf() ));
 
 #else
@@ -549,5 +548,5 @@
     if (!pSession)
     {
-        OSDBGPRINT(("VBoxDrvSolarisClose: WHAT?!? pSession == NULL! This must be a mistake... pid=%d (close)\n",
+        LogRel((DEVICE_NAME ":VBoxDrvSolarisClose: WHAT?!? pSession == NULL! This must be a mistake... pid=%d (close)\n",
                     (int)Process));
         return EFAULT;
@@ -559,5 +558,4 @@
      */
     supdrvCloseSession(&g_DevExt, pSession);
-    dprintf(("VBoxDrvSolarisClose: returns\n"));
     return 0;
 }
@@ -566,5 +564,5 @@
 static int VBoxDrvSolarisRead(dev_t Dev, struct uio *pUio, cred_t *pCred)
 {
-    dprintf(("VBoxDrvSolarisRead"));
+    LogFlow((DEVICE_NAME ":VBoxDrvSolarisRead"));
     return 0;
 }
@@ -573,5 +571,5 @@
 static int VBoxDrvSolarisWrite(dev_t Dev, struct uio *pUio, cred_t *pCred)
 {
-    dprintf(("VBoxDrvSolarisWrite"));
+    LogFlow((DEVICE_NAME ":VBoxDrvSolarisWrite"));
     return 0;
 }
@@ -599,5 +597,5 @@
     if (!pState)
     {
-        OSDBGPRINT(("VBoxDrvSolarisIOCtl: no state data for %#x (%d)\n", Dev, getminor(Dev)));
+        LogRel((DEVICE_NAME ":VBoxDrvSolarisIOCtl: no state data for %#x (%d)\n", Dev, getminor(Dev)));
         return EINVAL;
     }
@@ -606,5 +604,5 @@
     if (!pSession)
     {
-        OSDBGPRINT(("VBoxDrvSolarisIOCtl: no session in state data for %#x (%d)\n", Dev, getminor(Dev)));
+        LogRel((DEVICE_NAME ":VBoxDrvSolarisIOCtl: no session in state data for %#x (%d)\n", Dev, getminor(Dev)));
         return DDI_SUCCESS;
     }
@@ -628,5 +626,5 @@
     if (!pSession)
     {
-        OSDBGPRINT(("VBoxSupDrvIOCtl: WHAT?!? pSession == NULL! This must be a mistake... pid=%d iCmd=%#x\n",
+        LogRel((DEVICE_NAME ":VBoxSupDrvIOCtl: WHAT?!? pSession == NULL! This must be a mistake... pid=%d iCmd=%#x\n",
                     (int)Process, Cmd));
         return EINVAL;
@@ -682,5 +680,5 @@
     if (RT_UNLIKELY(IOCPARM_LEN(iCmd) != sizeof(Hdr)))
     {
-        OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: iCmd=%#x len %d expected %d\n", iCmd, IOCPARM_LEN(iCmd), sizeof(Hdr)));
+        LogRel((DEVICE_NAME ":VBoxDrvSolarisIOCtlSlow: iCmd=%#x len %d expected %d\n", iCmd, IOCPARM_LEN(iCmd), sizeof(Hdr)));
         return EINVAL;
     }
@@ -688,10 +686,10 @@
     if (RT_UNLIKELY(rc))
     {
-        OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: ddi_copyin(,%#lx,) failed; iCmd=%#x. rc=%d\n", iArg, iCmd, rc));
+        LogRel((DEVICE_NAME ":VBoxDrvSolarisIOCtlSlow: ddi_copyin(,%#lx,) failed; iCmd=%#x. rc=%d\n", iArg, iCmd, rc));
         return EFAULT;
     }
     if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC))
     {
-        OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: bad header magic %#x; iCmd=%#x\n", Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK, iCmd));
+        LogRel((DEVICE_NAME ":VBoxDrvSolarisIOCtlSlow: bad header magic %#x; iCmd=%#x\n", Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK, iCmd));
         return EINVAL;
     }
@@ -701,5 +699,5 @@
                     ||  cbBuf > _1M*16))
     {
-        OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: max(%#x,%#x); iCmd=%#x\n", Hdr.cbIn, Hdr.cbOut, iCmd));
+        LogRel((DEVICE_NAME ":VBoxDrvSolarisIOCtlSlow: max(%#x,%#x); iCmd=%#x\n", Hdr.cbIn, Hdr.cbOut, iCmd));
         return EINVAL;
     }
@@ -711,5 +709,5 @@
     if (RT_UNLIKELY(!pHdr))
     {
-        OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: failed to allocate buffer of %d bytes for iCmd=%#x.\n", cbBuf, iCmd));
+        LogRel((DEVICE_NAME ":VBoxDrvSolarisIOCtlSlow: failed to allocate buffer of %d bytes for iCmd=%#x.\n", cbBuf, iCmd));
         return ENOMEM;
     }
@@ -717,5 +715,5 @@
     if (RT_UNLIKELY(rc))
     {
-        dprintf(("VBoxDrvSolarisIOCtlSlow: copy_from_user(,%#lx, %#x) failed; iCmd=%#x. rc=%d\n", iArg, Hdr.cbIn, iCmd, rc));
+        LogRel((DEVICE_NAME ":VBoxDrvSolarisIOCtlSlow: copy_from_user(,%#lx, %#x) failed; iCmd=%#x. rc=%d\n", iArg, Hdr.cbIn, iCmd, rc));
         RTMemFree(pHdr);
         return EFAULT;
@@ -735,5 +733,5 @@
         if (RT_UNLIKELY(cbOut > cbBuf))
         {
-            OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: too much output! %#x > %#x; iCmd=%#x!\n", cbOut, cbBuf, iCmd));
+            LogRel((DEVICE_NAME ":VBoxDrvSolarisIOCtlSlow: too much output! %#x > %#x; iCmd=%#x!\n", cbOut, cbBuf, iCmd));
             cbOut = cbBuf;
         }
@@ -742,5 +740,5 @@
         {
             /* this is really bad */
-            OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: ddi_copyout(,%p,%d) failed. rc=%d\n", (void *)iArg, cbBuf, rc));
+            LogRel((DEVICE_NAME ":VBoxDrvSolarisIOCtlSlow: ddi_copyout(,%p,%d) failed. rc=%d\n", (void *)iArg, cbBuf, rc));
             rc = EFAULT;
         }
@@ -862,11 +860,5 @@
 
     szMsg[sizeof(szMsg) - 1] = '\0';
-#if 0
-    uprintf("SUPR0Printf: %s", szMsg);
-#endif
-#if 1
-    cmn_err(CE_CONT, "VBoxDrv: %s", szMsg);
-#endif
-
+    cmn_err(CE_CONT, "%s", szMsg);
     return 0;
 }
