Changeset 54237 in vbox
- Timestamp:
- Feb 17, 2015 3:19:35 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
r53434 r54237 5 5 6 6 /* 7 * Copyright (C) 2007-201 4Oracle Corporation7 * Copyright (C) 2007-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 361 361 */ 362 362 if (pReq->hypervisorSize == 0) 363 Log FlowFunc(("Nothing to do\n"));363 Log(("vboxGuestInitFixateGuestMappings: nothing to do\n")); 364 364 else 365 365 { … … 373 373 uint32_t iTry; 374 374 bool fBitched = false; 375 Log FlowFunc(("cbHypervisor=%#x\n", cbHypervisor));375 Log(("vboxGuestInitFixateGuestMappings: cbHypervisor=%#x\n", cbHypervisor)); 376 376 for (iTry = 0; iTry < RT_ELEMENTS(ahTries); iTry++) 377 377 { … … 765 765 rc = VBoxGuestReportDriverStatus(true /* Driver is active */); 766 766 if (RT_FAILURE(rc)) 767 Log FlowFunc(("Could not report guest driver status, rc=%Rrc\n", rc));767 Log(("VBoxGuestReinitDevExtAfterHibernation: could not report guest driver status, rc=%Rrc\n", rc)); 768 768 } 769 769 else 770 LogFlowFunc(("Could not report guest information to host, rc=%Rrc\n", rc)); 771 772 LogFlowFunc(("Returned with rc=%Rrc\n", rc)); 770 Log(("VBoxGuestReinitDevExtAfterHibernation: could not report guest information to host, rc=%Rrc\n", rc)); 771 LogFlow(("VBoxGuestReinitDevExtAfterHibernation: returned with rc=%Rrc\n", rc)); 773 772 return rc; 774 773 } … … 873 872 else 874 873 { 875 Log FlowFunc(("Inflating failed, rc=%Rrc\n", rc));874 Log(("vboxGuestSetBalloonSize(inflate): failed, rc=%Rrc!\n", rc)); 876 875 RTR0MemObjFree(*pMemObj, true); 877 876 *pMemObj = NIL_RTR0MEMOBJ; … … 885 884 pDevExt->MemBalloon.cChunks--; 886 885 else 887 Log FlowFunc(("Deflating failed, rc=%Rrc\n", rc));886 Log(("vboxGuestSetBalloonSize(deflate): failed, rc=%Rrc!\n", rc)); 888 887 } 889 888 … … 920 919 if (RT_FAILURE(rc)) 921 920 { 922 LogRel Func(("Deflating balloon failed with rc=%Rrc; will leak %u chunks\n",923 921 LogRel(("vboxGuestCloseMemBalloon: Deflate failed with rc=%Rrc. Will leak %u chunks.\n", 922 rc, pDevExt->MemBalloon.cChunks)); 924 923 break; 925 924 } … … 930 929 } 931 930 else 932 LogRel Func(("Failed to allocate VMMDev request buffer, rc=%Rrc; will leak %u chunks\n",933 931 LogRel(("vboxGuestCloseMemBalloon: Failed to allocate VMMDev request buffer (rc=%Rrc). Will leak %u chunks.\n", 932 rc, pDevExt->MemBalloon.cChunks)); 934 933 RTMemFree(pDevExt->MemBalloon.paMemObj); 935 934 pDevExt->MemBalloon.paMemObj = NULL; … … 1048 1047 { 1049 1048 pDevExt->pVMMDevMemory = pVMMDev; 1050 Log FlowFunc(("VMMDevMemory: mapping=%p size=%#RX32 (%#RX32),version=%#RX32\n",1051 1049 Log(("VBoxGuestInitDevExt: VMMDevMemory: mapping=%p size=%#RX32 (%#RX32) version=%#RX32\n", 1050 pVMMDev, pVMMDev->u32Size, cbMMIO, pVMMDev->u32Version)); 1052 1051 } 1053 1052 else /* try live without it. */ 1054 LogRel Func(("Bogus VMMDev memory; u32Version=%RX32 (expected %RX32),u32Size=%RX32 (expected <= %RX32)\n",1055 1053 LogRel(("VBoxGuestInitDevExt: Bogus VMMDev memory; u32Version=%RX32 (expected %RX32) u32Size=%RX32 (expected <= %RX32)\n", 1054 pVMMDev->u32Version, VMMDEV_MEMORY_VERSION, pVMMDev->u32Size, cbMMIO)); 1056 1055 } 1057 1056 … … 1068 1067 if (RT_FAILURE(rc)) 1069 1068 { 1070 LogRel Func(("Failed to create spinlock, rc=%Rrc\n", rc));1069 LogRel(("VBoxGuestInitDevExt: failed to create spinlock, rc=%Rrc!\n", rc)); 1071 1070 if (pDevExt->EventSpinlock != NIL_RTSPINLOCK) 1072 1071 RTSpinlockDestroy(pDevExt->EventSpinlock); … … 1077 1076 if (RT_FAILURE(rc)) 1078 1077 { 1079 LogRel Func(("Failed to create mutex, rc=%Rrc\n", rc));1078 LogRel(("VBoxGuestInitDevExt: failed to create mutex, rc=%Rrc!\n", rc)); 1080 1079 RTSpinlockDestroy(pDevExt->SessionSpinlock); 1081 1080 RTSpinlockDestroy(pDevExt->EventSpinlock); … … 1112 1111 rc = VBoxGuestReportDriverStatus(true /* Driver is active */); 1113 1112 if (RT_FAILURE(rc)) 1114 LogRel Func(("VBoxReportGuestDriverStatus failed, rc=%Rrc\n", rc));1113 LogRel(("VBoxGuestInitDevExt: VBoxReportGuestDriverStatus failed, rc=%Rrc\n", rc)); 1115 1114 1116 1115 /** @todo Move heartbeat initialization into a separate function. */ … … 1129 1128 rc = VbglGRAlloc(&pDevExt->pReqGuestHeartbeat, sizeof(*pDevExt->pReqGuestHeartbeat), VMMDevReq_GuestHeartbeat); 1130 1129 if (RT_FAILURE(rc)) 1131 LogRel Func(("VbglGRAlloc(VMMDevReq_GuestHeartbeat) %Rrc\n", rc));1130 LogRel(("VBoxGuestInitDevExt: VbglGRAlloc(VMMDevReq_GuestHeartbeat) %Rrc\n", rc)); 1132 1131 1133 1132 if (RT_SUCCESS(rc)) 1134 1133 { 1135 LogFlowFunc(("Setting up heartbeat to trigger every %RU64 sec\n", pDevExt->cNsHeartbeatInterval / 1000000000)); 1134 LogRel(("VBoxGuestInitDevExt: Setting up heartbeat to trigger every %RU64 sec\n", 1135 pDevExt->cNsHeartbeatInterval / 1000000000)); 1136 1136 rc = RTTimerCreateEx(&pDevExt->pHeartbeatTimer, pDevExt->cNsHeartbeatInterval, 1137 1137 0, (PFNRTTIMER)VBoxGuestHeartbeatTimerHandler, pDevExt); … … 1142 1142 rc = RTTimerStart(pDevExt->pHeartbeatTimer, 0); 1143 1143 if (RT_FAILURE(rc)) 1144 LogRel Func(("Heartbeat timer failed to start, rc=%Rrc\n", rc));1144 LogRel(("VBoxGuestInitDevExt: Heartbeat timer failed to start, rc=%Rrc\n", rc)); 1145 1145 } 1146 1146 if (RT_FAILURE(rc)) 1147 1147 { 1148 LogRel Func(("Failed to set up the timer, guest heartbeat is disabled\n"));1148 LogRel(("VBoxGuestInitDevExt: Failed to set up the timer, guest heartbeat is disabled\n")); 1149 1149 /* Disable host heartbeat check if we failed */ 1150 1150 VBoxGuestHeartbeatHostConfigure(pDevExt, false); … … 1155 1155 } 1156 1156 else 1157 LogRel Func(("Failed to configure host for heartbeat checking, rc=%Rrc\n", rc));1157 LogRel(("VBoxGuestInitDevExt: Failed to configure host for heartbeat checking, rc=%Rrc\n", rc)); 1158 1158 } 1159 1159 … … 1161 1161 return VINF_SUCCESS; 1162 1162 } 1163 else 1164 LogRelFunc(("Failed to set host flags, rc=%Rrc\n", rc));1163 1164 LogRel(("VBoxGuestInitDevExt: failed to set host flags, rc=%Rrc\n", rc)); 1165 1165 } 1166 1166 else 1167 LogRel Func(("VBoxGuestInitDevExt: VBoxReportGuestInfo failed, rc=%Rrc\n", rc));1167 LogRel(("VBoxGuestInitDevExt: VBoxReportGuestInfo failed, rc=%Rrc\n", rc)); 1168 1168 VbglGRFree((VMMDevRequestHeader *)pDevExt->pIrqAckEvents); 1169 1169 } 1170 1170 else 1171 LogRel Func(("VBoxGRAlloc failed, rc=%Rrc\n", rc));1171 LogRel(("VBoxGuestInitDevExt: VBoxGRAlloc failed, rc=%Rrc\n", rc)); 1172 1172 1173 1173 VbglTerminate(); 1174 1174 } 1175 1175 else 1176 LogRel Func(("VbglInit failed, rc=%Rrc\n", rc));1176 LogRel(("VBoxGuestInitDevExt: VbglInit failed, rc=%Rrc\n", rc)); 1177 1177 1178 1178 rc2 = RTSemFastMutexDestroy(pDevExt->MemBalloon.hMtx); AssertRC(rc2); … … 1341 1341 1342 1342 *ppSession = pSession; 1343 LogFlow Func(("pSession=%p proc=%RTproc (%d) r0proc=%p\n",1344 1343 LogFlow(("VBoxGuestCreateKernelSession: pSession=%p proc=%RTproc (%d) r0proc=%p\n", 1344 pSession, pSession->Process, (int)pSession->Process, (uintptr_t)pSession->R0Process)); /** @todo %RTr0proc */ 1345 1345 return VINF_SUCCESS; 1346 1346 } … … 1419 1419 if (!pWait) 1420 1420 { 1421 static unsigned s_cErrors = 0;1422 1421 int rc; 1423 1422 … … 1425 1424 if (!pWait) 1426 1425 { 1427 if (s_cErrors++ < 32) 1428 LogRelFunc(("Out of memory, returning NULL\n")); 1426 LogRelMax(32, ("VBoxGuestWaitAlloc: out-of-memory!\n")); 1429 1427 return NULL; 1430 1428 } … … 1433 1431 if (RT_FAILURE(rc)) 1434 1432 { 1435 if (s_cErrors++ < 32) 1436 LogRelFunc(("RTSemEventMultiCreate failed with rc=%Rrc\n", rc)); 1433 LogRelMax(32, ("VBoxGuestCommonIOCtl: RTSemEventMultiCreate failed with rc=%Rrc!\n", rc)); 1437 1434 RTMemFree(pWait); 1438 1435 return NULL; … … 1564 1561 if (RT_FAILURE(rc)) 1565 1562 { 1566 Log FlowFunc(("Failed to allocate %u (%#x) bytes to cache the request; rc=%Rrc\n",1567 1563 Log(("VBoxGuestSetGuestCapabilities: failed to allocate %u (%#x) bytes to cache the request. rc=%Rrc!!\n", 1564 sizeof(*pReq), sizeof(*pReq), rc)); 1568 1565 return rc; 1569 1566 } … … 1574 1571 rc = VbglGRPerform(&pReq->header); 1575 1572 if (RT_FAILURE(rc)) 1576 Log FlowFunc(("VbglGRPerform failed, rc=%Rrc\n", rc));1573 Log(("VBoxGuestSetGuestCapabilities: VbglGRPerform failed, rc=%Rrc!\n", rc)); 1577 1574 1578 1575 VbglGRFree(&pReq->header); … … 1593 1590 int VBoxGuestCommonIOCtlFast(unsigned iFunction, PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession) 1594 1591 { 1595 LogFlow Func(("iFunction=%#x pDevExt=%p pSession=%p\n", iFunction, pDevExt, pSession));1592 LogFlow(("VBoxGuestCommonIOCtlFast: iFunction=%#x pDevExt=%p pSession=%p\n", iFunction, pDevExt, pSession)); 1596 1593 1597 1594 NOREF(iFunction); … … 1612 1609 static int VBoxGuestCommonIOCtl_GetVMMDevPort(PVBOXGUESTDEVEXT pDevExt, VBoxGuestPortInfo *pInfo, size_t *pcbDataReturned) 1613 1610 { 1614 LogFlow FuncEnter();1611 LogFlow(("VBoxGuestCommonIOCtl: GETVMMDEVPORT\n")); 1615 1612 1616 1613 pInfo->portAddress = pDevExt->IOPortBase; … … 1632 1629 int VBoxGuestCommonIOCtl_SetMouseNotifyCallback(PVBOXGUESTDEVEXT pDevExt, VBoxGuestMouseSetNotifyCallback *pNotify) 1633 1630 { 1634 LogFlow FuncEnter();1631 LogFlow(("VBoxGuestCommonIOCtl: SET_MOUSE_NOTIFY_CALLBACK\n")); 1635 1632 1636 1633 RTSpinlockAcquire(pDevExt->EventSpinlock); … … 1660 1657 pInfo->u32Result = VBOXGUEST_WAITEVENT_OK; 1661 1658 if (fReqEvents & ~((uint32_t)1 << iEvent)) 1662 LogFlow Func(("WAITEVENT: returns %#x\n", pInfo->u32EventFlagsOut));1659 LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns %#x\n", pInfo->u32EventFlagsOut)); 1663 1660 else 1664 LogFlow Func(("WAITEVENT: returns %#x/%d\n", pInfo->u32EventFlagsOut, iEvent));1661 LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns %#x/%d\n", pInfo->u32EventFlagsOut, iEvent)); 1665 1662 pSession->fPendingCancelWaitEvents = false; 1666 1663 return VINF_SUCCESS; … … 1692 1689 if (RT_UNLIKELY(iEvent < 0)) 1693 1690 { 1694 LogRel((" Invalid input mask %#x\n", fReqEvents));1691 LogRel(("VBoxGuestCommonIOCtl: WAITEVENT: Invalid input mask %#x!!\n", fReqEvents)); 1695 1692 return VERR_INVALID_PARAMETER; 1696 1693 } … … 1707 1704 { 1708 1705 pInfo->u32Result = VBOXGUEST_WAITEVENT_TIMEOUT; 1709 LogFlow Func(("ReturningVERR_TIMEOUT\n"));1706 LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns VERR_TIMEOUT\n")); 1710 1707 return VERR_TIMEOUT; 1711 1708 } … … 1762 1759 pInfo->u32Result = VBOXGUEST_WAITEVENT_OK; 1763 1760 if (fReqEvents & ~((uint32_t)1 << iEvent)) 1764 LogFlow Func(("Returning%#x\n", pInfo->u32EventFlagsOut));1761 LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns %#x\n", pInfo->u32EventFlagsOut)); 1765 1762 else 1766 LogFlow Func(("Returning%#x/%d\n", pInfo->u32EventFlagsOut, iEvent));1763 LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns %#x/%d\n", pInfo->u32EventFlagsOut, iEvent)); 1767 1764 rc = VINF_SUCCESS; 1768 1765 } … … 1772 1769 pInfo->u32Result = VBOXGUEST_WAITEVENT_INTERRUPTED; 1773 1770 rc = VERR_INTERRUPTED; 1774 LogFlow Func(("ReturningVERR_INTERRUPTED\n"));1771 LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns VERR_INTERRUPTED\n")); 1775 1772 } 1776 1773 else if (rc == VERR_TIMEOUT) 1777 1774 { 1778 1775 pInfo->u32Result = VBOXGUEST_WAITEVENT_TIMEOUT; 1779 LogFlow Func(("ReturningVERR_TIMEOUT (2)\n"));1776 LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns VERR_TIMEOUT (2)\n")); 1780 1777 } 1781 1778 else … … 1783 1780 if (RT_SUCCESS(rc)) 1784 1781 { 1785 static unsigned s_cErrors = 0; 1786 if (s_cErrors++ < 32) 1787 LogRelFunc(("Returning %Rrc but no events\n", rc)); 1782 LogRelMax(32, ("VBoxGuestCommonIOCtl: WAITEVENT: returns %Rrc but no events!\n", rc)); 1788 1783 rc = VERR_INTERNAL_ERROR; 1789 1784 } 1790 1785 pInfo->u32Result = VBOXGUEST_WAITEVENT_ERROR; 1791 LogFlow Func(("Returning%Rrc\n", rc));1786 LogFlow(("VBoxGuestCommonIOCtl: WAITEVENT: returns %Rrc\n", rc)); 1792 1787 } 1793 1788 … … 1807 1802 bool fCancelledOne = false; 1808 1803 1809 LogFlow Func(("CANCEL_ALL_WAITEVENTS\n"));1804 LogFlow(("VBoxGuestCommonIOCtl: CANCEL_ALL_WAITEVENTS\n")); 1810 1805 1811 1806 /* … … 1925 1920 { 1926 1921 AssertFailed(); 1927 LogRel((" calling caps set for acquired caps %d\n", pCaps->u32OrMask));1922 LogRel(("VBoxDrv: calling caps set for acquired caps %d\n", pCaps->u32OrMask)); 1928 1923 enmRequired = kLevel_NoOne; 1929 1924 break; … … 2027 2022 const uint32_t cbMinSize = (uint32_t)vmmdevGetRequestSize(enmType); 2028 2023 2029 LogFlow Func(("Type=%d\n", pReqHdr->requestType));2024 LogFlow(("VBoxGuestCommonIOCtl: VMMREQUEST type %d\n", pReqHdr->requestType)); 2030 2025 2031 2026 if (cbReq < cbMinSize) 2032 2027 { 2033 LogRel Func(("Invalid hdr size %#x, expected >= %#x; type=%#x!!\n",2034 2028 LogRel(("VBoxGuestCommonIOCtl: VMMREQUEST: invalid hdr size %#x, expected >= %#x; type=%#x!!\n", 2029 cbReq, cbMinSize, enmType)); 2035 2030 return VERR_INVALID_PARAMETER; 2036 2031 } 2037 2032 if (cbReq > cbData) 2038 2033 { 2039 LogRel Func(("Invalid size %#x, expected >= %#x (hdr); type=%#x!!\n",2040 2034 LogRel(("VBoxGuestCommonIOCtl: VMMREQUEST: invalid size %#x, expected >= %#x (hdr); type=%#x!!\n", 2035 cbData, cbReq, enmType)); 2041 2036 return VERR_INVALID_PARAMETER; 2042 2037 } … … 2044 2039 if (RT_FAILURE(rc)) 2045 2040 { 2046 Log FlowFunc(("Invalid header: size %#x, expected >= %#x (hdr); type=%#x; rc=%Rrc\n",2047 2041 Log(("VBoxGuestCommonIOCtl: VMMREQUEST: invalid header: size %#x, expected >= %#x (hdr); type=%#x; rc=%Rrc!!\n", 2042 cbData, cbReq, enmType, rc)); 2048 2043 return rc; 2049 2044 } … … 2052 2047 if (RT_FAILURE(rc)) 2053 2048 { 2054 Log FlowFunc(("Operation not allowed! type=%#x,rc=%Rrc\n", enmType, rc));2049 Log(("VBoxGuestCommonIOCtl: VMMREQUEST: Operation not allowed! type=%#x rc=%Rrc\n", enmType, rc)); 2055 2050 return rc; 2056 2051 } … … 2066 2061 if (RT_FAILURE(rc)) 2067 2062 { 2068 Log FlowFunc(("Failed to allocate %u (%#x) bytes to cache the request; rc=%Rrc\n",2069 2063 Log(("VBoxGuestCommonIOCtl: VMMREQUEST: failed to allocate %u (%#x) bytes to cache the request. rc=%Rrc!!\n", 2064 cbReq, cbReq, rc)); 2070 2065 return rc; 2071 2066 } … … 2087 2082 } 2088 2083 else if (RT_FAILURE(rc)) 2089 Log FlowFunc(("VbglGRPerform failed; rc=%Rrc\n", rc));2084 Log(("VBoxGuestCommonIOCtl: VMMREQUEST: VbglGRPerform - rc=%Rrc!\n", rc)); 2090 2085 else 2091 2086 { 2092 LogFlowFunc(("Request execution failed; VMMDev rc=%Rrc\n", 2093 pReqCopy->rc)); 2087 Log(("VBoxGuestCommonIOCtl: VMMREQUEST: request execution failed; VMMDev rc=%Rrc!\n", pReqCopy->rc)); 2094 2088 rc = pReqCopy->rc; 2095 2089 } … … 2230 2224 && ( !fInterruptible 2231 2225 || rc != VERR_INTERRUPTED)) 2232 LogRel Flow(("wait failed! %Rrc\n", rc));2226 LogRel(("VBoxGuestHGCMAsyncWaitCallback: wait failed! %Rrc\n", rc)); 2233 2227 2234 2228 VBoxGuestWaitFreeUnlocked(pDevExt, pWait); … … 2245 2239 { 2246 2240 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pvUser; 2247 LogFlow Func(("requestType=%d\n", pHdr->header.requestType));2241 LogFlow(("VBoxGuestHGCMAsyncWaitCallback: requestType=%d\n", pHdr->header.requestType)); 2248 2242 return VBoxGuestHGCMAsyncWaitCallbackWorker((VMMDevHGCMRequestHeader volatile *)pHdr, 2249 2243 pDevExt, … … 2262 2256 { 2263 2257 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pvUser; 2264 LogFlow Func(("requestType=%d\n", pHdr->header.requestType));2258 LogFlow(("VBoxGuestHGCMAsyncWaitCallbackInterruptible: requestType=%d\n", pHdr->header.requestType)); 2265 2259 return VBoxGuestHGCMAsyncWaitCallbackWorker((VMMDevHGCMRequestHeader volatile *)pHdr, 2266 2260 pDevExt, … … 2281 2275 * to deal with cancelled requests. 2282 2276 */ 2283 Log FlowFunc(("%.128s\n",2284 2285 2277 Log(("VBoxGuestCommonIOCtl: HGCM_CONNECT: %.128s\n", 2278 pInfo->Loc.type == VMMDevHGCMLoc_LocalHost || pInfo->Loc.type == VMMDevHGCMLoc_LocalHost_Existing 2279 ? pInfo->Loc.u.host.achName : "<not local host>")); 2286 2280 2287 2281 rc = VbglR0HGCMInternalConnect(pInfo, VBoxGuestHGCMAsyncWaitCallback, pDevExt, RT_INDEFINITE_WAIT); 2288 2282 if (RT_SUCCESS(rc)) 2289 2283 { 2290 Log FlowFunc(("u32Client=%RX32 result=%Rrc (rc=%Rrc)\n",2291 2284 Log(("VBoxGuestCommonIOCtl: HGCM_CONNECT: u32Client=%RX32 result=%Rrc (rc=%Rrc)\n", 2285 pInfo->u32ClientID, pInfo->result, rc)); 2292 2286 if (RT_SUCCESS(pInfo->result)) 2293 2287 { … … 2307 2301 if (i >= RT_ELEMENTS(pSession->aHGCMClientIds)) 2308 2302 { 2309 static unsigned s_cErrors = 0;2310 2303 VBoxGuestHGCMDisconnectInfo Info; 2311 2312 if (s_cErrors++ < 32) 2313 LogRelFunc(("Too many HGCMConnect calls for one session\n")); 2314 2304 LogRelMax(32, ("VBoxGuestCommonIOCtl: HGCM_CONNECT: too many HGCMConnect calls for one session!\n")); 2315 2305 Info.result = 0; 2316 2306 Info.u32ClientID = pInfo->u32ClientID; … … 2347 2337 if (i >= RT_ELEMENTS(pSession->aHGCMClientIds)) 2348 2338 { 2349 static unsigned s_cErrors = 0; 2350 if (s_cErrors++ > 32) 2351 LogRelFunc(("u32Client=%RX32\n", u32ClientId)); 2339 LogRelMax(32, ("VBoxGuestCommonIOCtl: HGCM_DISCONNECT: u32Client=%RX32\n", u32ClientId)); 2352 2340 return VERR_INVALID_HANDLE; 2353 2341 } … … 2358 2346 * to deal with cancelled requests. 2359 2347 */ 2360 Log FlowFunc(("u32Client=%RX32\n", pInfo->u32ClientID));2348 Log(("VBoxGuestCommonIOCtl: HGCM_DISCONNECT: u32Client=%RX32\n", pInfo->u32ClientID)); 2361 2349 rc = VbglR0HGCMInternalDisconnect(pInfo, VBoxGuestHGCMAsyncWaitCallback, pDevExt, RT_INDEFINITE_WAIT); 2362 2350 if (RT_SUCCESS(rc)) 2363 2351 { 2364 LogFlow Func(("Disconnected with rc=%Rrc\n", pInfo->result)); /** int32_t vs. int! */2352 LogFlow(("VBoxGuestCommonIOCtl: HGCM_DISCONNECT: result=%Rrc\n", pInfo->result)); 2365 2353 if (pcbDataReturned) 2366 2354 *pcbDataReturned = sizeof(*pInfo); … … 2394 2382 if (pInfo->cParms > 4096) /* (Just make sure it doesn't overflow the next check.) */ 2395 2383 { 2396 LogRel Func(("cParm=%RX32 is not sane\n", pInfo->cParms));2384 LogRel(("VBoxGuestCommonIOCtl: HGCM_CALL: cParm=%RX32 is not sane\n", pInfo->cParms)); 2397 2385 return VERR_INVALID_PARAMETER; 2398 2386 } … … 2407 2395 if (cbData < cbActual) 2408 2396 { 2409 LogRel Func(("cbData=%#zx (%zu) required size is %#zx (%zu)\n",2410 2397 LogRel(("VBoxGuestCommonIOCtl: HGCM_CALL: cbData=%#zx (%zu) required size is %#zx (%zu)\n", 2398 cbData, cbData, cbActual, cbActual)); 2411 2399 return VERR_INVALID_PARAMETER; 2412 2400 } … … 2422 2410 if (RT_UNLIKELY(i >= RT_ELEMENTS(pSession->aHGCMClientIds))) 2423 2411 { 2424 static unsigned s_cErrors = 0; 2425 if (s_cErrors++ > 32) 2426 LogRelFunc(("Invalid handle; u32Client=%RX32\n", u32ClientId)); 2412 LogRelMax(32, ("VBoxGuestCommonIOCtl: HGCM_CALL: Invalid handle. u32Client=%RX32\n", u32ClientId)); 2427 2413 return VERR_INVALID_HANDLE; 2428 2414 } … … 2434 2420 * be interruptible (should add a flag for this later I guess). 2435 2421 */ 2436 LogFlow Func(("u32Client=%RX32\n", pInfo->u32ClientID));2422 LogFlow(("VBoxGuestCommonIOCtl: HGCM_CALL: u32Client=%RX32\n", pInfo->u32ClientID)); 2437 2423 fFlags = !fUserData && pSession->R0Process == NIL_RTR0PROCESS ? VBGLR0_HGCMCALL_F_KERNEL : VBGLR0_HGCMCALL_F_USER; 2438 2424 uint32_t cbInfo = (uint32_t)(cbData - cbExtra); … … 2455 2441 if (RT_SUCCESS(rc)) 2456 2442 { 2457 LogFlow Func(("Result rc=%Rrc\n", pInfo->result)); /** int32_t vs. int! */2443 LogFlow(("VBoxGuestCommonIOCtl: HGCM_CALL: result=%Rrc\n", pInfo->result)); 2458 2444 if (pcbDataReturned) 2459 2445 *pcbDataReturned = cbActual; … … 2463 2449 if ( rc != VERR_INTERRUPTED 2464 2450 && rc != VERR_TIMEOUT) 2465 { 2466 static unsigned s_cErrors = 0; 2467 if (s_cErrors++ < 32) 2468 LogRelFunc(("%s-bit call failed; rc=%Rrc\n", 2469 f32bit ? "32" : "64", rc)); 2470 } 2451 LogRelMax(32, ("VBoxGuestCommonIOCtl: HGCM_CALL: %s Failed. rc=%Rrc.\n", f32bit ? "32" : "64", rc)); 2471 2452 else 2472 LogFlowFunc(("%s-bit call failed; rc=%Rrc\n", 2473 f32bit ? "32" : "64", rc)); 2453 Log(("VBoxGuestCommonIOCtl: HGCM_CALL: %s Failed. rc=%Rrc.\n", f32bit ? "32" : "64", rc)); 2474 2454 } 2475 2455 return rc; 2476 2456 } 2457 2477 2458 #endif /* VBOX_WITH_HGCM */ 2478 2479 2459 2480 2460 /** … … 2496 2476 VBoxGuestCheckBalloonInfo *pInfo, size_t *pcbDataReturned) 2497 2477 { 2498 LogFlowFuncEnter(); 2499 2500 int rc = RTSemFastMutexRequest(pDevExt->MemBalloon.hMtx); 2478 VMMDevGetMemBalloonChangeRequest *pReq; 2479 int rc; 2480 2481 LogFlow(("VBoxGuestCommonIOCtl: CHECK_MEMORY_BALLOON\n")); 2482 rc = RTSemFastMutexRequest(pDevExt->MemBalloon.hMtx); 2501 2483 AssertRCReturn(rc, rc); 2502 2484 … … 2507 2489 if ( pDevExt->MemBalloon.pOwner != pSession 2508 2490 && pDevExt->MemBalloon.pOwner == NULL) 2509 {2510 2491 pDevExt->MemBalloon.pOwner = pSession; 2511 }2512 2492 2513 2493 if (pDevExt->MemBalloon.pOwner == pSession) 2514 2494 { 2515 VMMDevGetMemBalloonChangeRequest *pReq; 2516 rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(VMMDevGetMemBalloonChangeRequest), 2517 VMMDevReq_GetMemBalloonChangeRequest); 2495 rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(VMMDevGetMemBalloonChangeRequest), VMMDevReq_GetMemBalloonChangeRequest); 2518 2496 if (RT_SUCCESS(rc)) 2519 2497 { … … 2544 2522 } 2545 2523 else 2546 LogRel Func(("VbglGRPerform failed;rc=%Rrc\n", rc));2524 LogRel(("VBoxGuestCommonIOCtl: CHECK_MEMORY_BALLOON: VbglGRPerform failed. rc=%Rrc\n", rc)); 2547 2525 VbglGRFree(&pReq->header); 2548 2526 } … … 2552 2530 2553 2531 RTSemFastMutexRelease(pDevExt->MemBalloon.hMtx); 2554 2555 LogFlowFunc(("Returns %Rrc\n", rc)); 2532 LogFlow(("VBoxGuestCommonIOCtl: CHECK_MEMORY_BALLOON returns %Rrc\n", rc)); 2556 2533 return rc; 2557 2534 } … … 2572 2549 VBoxGuestChangeBalloonInfo *pInfo, size_t *pcbDataReturned) 2573 2550 { 2574 int rc = RTSemFastMutexRequest(pDevExt->MemBalloon.hMtx); 2551 int rc; 2552 2553 LogFlow(("VBoxGuestCommonIOCtl: CHANGE_BALLOON\n")); 2554 rc = RTSemFastMutexRequest(pDevExt->MemBalloon.hMtx); 2575 2555 AssertRCReturn(rc, rc); 2576 2556 … … 2587 2567 if (pDevExt->MemBalloon.pOwner == pSession) 2588 2568 { 2589 rc = vboxGuestSetBalloonSizeFromUser(pDevExt, pSession, pInfo->u64ChunkAddr, 2590 !!pInfo->fInflate); 2569 rc = vboxGuestSetBalloonSizeFromUser(pDevExt, pSession, pInfo->u64ChunkAddr, !!pInfo->fInflate); 2591 2570 if (pcbDataReturned) 2592 2571 *pcbDataReturned = 0; … … 2614 2593 { 2615 2594 VMMDevReqWriteCoreDump *pReq = NULL; 2616 int rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(VMMDevReqWriteCoreDump), 2617 VMMDevReq_WriteCoreDump); 2595 int rc; 2596 2597 LogFlow(("VBoxGuestCommonIOCtl: WRITE_CORE_DUMP\n")); 2598 rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(*pReq), VMMDevReq_WriteCoreDump); 2618 2599 if (RT_FAILURE(rc)) 2619 2600 { 2620 Log FlowFunc(("Failed to allocate %u (%#x) bytes to cache the request; rc=%Rrc\n",2621 sizeof(VMMDevReqWriteCoreDump), sizeof(VMMDevReqWriteCoreDump), rc));2601 Log(("VBoxGuestCommonIOCtl: WRITE_CORE_DUMP: failed to allocate %u (%#x) bytes to cache the request. rc=%Rrc!!\n", 2602 sizeof(*pReq), sizeof(*pReq), rc)); 2622 2603 return rc; 2623 2604 } … … 2626 2607 rc = VbglGRPerform(&pReq->header); 2627 2608 if (RT_FAILURE(rc)) 2628 Log FlowFunc(("VbglGRPerform failed, rc=%Rrc\n", rc));2609 Log(("VBoxGuestCommonIOCtl: WRITE_CORE_DUMP: VbglGRPerform failed, rc=%Rrc!\n", rc)); 2629 2610 2630 2611 VbglGRFree(&pReq->header); … … 2658 2639 } 2659 2640 2641 2660 2642 static bool VBoxGuestCommonGuestCapsValidateValues(uint32_t fCaps) 2661 2643 { … … 2665 2647 return true; 2666 2648 } 2649 2667 2650 2668 2651 /** Check whether any unreported VMM device events should be reported to any of … … 2725 2708 if (!VBoxGuestCommonGuestCapsValidateValues(fOrMask)) 2726 2709 { 2727 LogRel Func(("pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- invalid fOrMask\n",2728 2710 LogRel(("VBoxGuestCommonGuestCapsAcquire: pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- invalid fOrMask\n", 2711 pSession, fOrMask, fNotMask, enmFlags)); 2729 2712 return VERR_INVALID_PARAMETER; 2730 2713 } … … 2733 2716 && enmFlags != VBOXGUESTCAPSACQUIRE_FLAGS_NONE) 2734 2717 { 2735 LogRel Func(("pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- invalid enmFlags %d\n",2736 2718 LogRel(("VBoxGuestCommonGuestCapsAcquire: pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- invalid enmFlags %d\n", 2719 pSession, fOrMask, fNotMask, enmFlags)); 2737 2720 return VERR_INVALID_PARAMETER; 2738 2721 } … … 2740 2723 if (!VBoxGuestCommonGuestCapsModeSet(pDevExt, fOrMask, true, &fSetCaps)) 2741 2724 { 2742 LogRel Func(("pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- calling caps acquire for set caps\n",2743 2725 LogRel(("VBoxGuestCommonGuestCapsAcquire: pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- calling caps acquire for set caps\n", 2726 pSession, fOrMask, fNotMask, enmFlags)); 2744 2727 return VERR_INVALID_STATE; 2745 2728 } … … 2747 2730 if (enmFlags & VBOXGUESTCAPSACQUIRE_FLAGS_CONFIG_ACQUIRE_MODE) 2748 2731 { 2749 Log RelFunc(("pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- configured acquire caps: 0x%x\n",2750 2732 Log(("VBoxGuestCommonGuestCapsAcquire: pSession(0x%p), OR(0x%x), NOT(0x%x), flags(0x%x) -- configured acquire caps: 0x%x\n", 2733 pSession, fOrMask, fNotMask, enmFlags)); 2751 2734 return VINF_SUCCESS; 2752 2735 } … … 2788 2771 if (fOtherConflictingCaps) 2789 2772 { 2790 Log FlowFunc(("Caps 0x%x were busy\n", fOtherConflictingCaps));2773 Log(("VBoxGuestCommonGuestCapsAcquire: Caps 0x%x were busy\n", fOtherConflictingCaps)); 2791 2774 return VERR_RESOURCE_BUSY; 2792 2775 } … … 2802 2785 if (RT_FAILURE(rc)) 2803 2786 { 2804 LogRel Func(("VBoxGuestSetGuestCapabilities failed, rc=%Rrc\n", rc));2787 LogRel(("VBoxGuestCommonGuestCapsAcquire: VBoxGuestSetGuestCapabilities failed, rc=%Rrc\n", rc)); 2805 2788 2806 2789 /* Failure branch … … 2829 2812 } 2830 2813 2814 2831 2815 static int VBoxGuestCommonIOCTL_GuestCapsAcquire(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, VBoxGuestCapsAquire *pAcquire) 2832 2816 { 2833 2817 int rc = VBoxGuestCommonGuestCapsAcquire(pDevExt, pSession, pAcquire->u32OrMask, pAcquire->u32NotMask, pAcquire->enmFlags); 2834 2818 if (RT_FAILURE(rc)) 2835 LogRel Func(("Failed,rc=%Rrc\n", rc));2819 LogRel(("VBoxGuestCommonIOCtl: GUEST_CAPS_ACQUIRE failed rc=%Rrc\n", rc)); 2836 2820 pAcquire->rc = rc; 2837 2821 return VINF_SUCCESS; … … 2858 2842 { 2859 2843 int rc; 2860 LogFlow Func(("iFunction=%#x, pDevExt=%p, pSession=%p, pvData=%p,cbData=%zu\n",2861 2844 LogFlow(("VBoxGuestCommonIOCtl: iFunction=%#x pDevExt=%p pSession=%p pvData=%p cbData=%zu\n", 2845 iFunction, pDevExt, pSession, pvData, cbData)); 2862 2846 2863 2847 /* … … 3070 3054 default: 3071 3055 { 3072 LogRel Func(("Unknown request iFunction=%#x,stripped size=%#x\n",3073 3056 LogRel(("VBoxGuestCommonIOCtl: Unknown request iFunction=%#x stripped size=%#x\n", 3057 iFunction, VBOXGUEST_IOCTL_STRIP_SIZE(iFunction))); 3074 3058 rc = VERR_NOT_SUPPORTED; 3075 3059 break; … … 3078 3062 } 3079 3063 3080 LogFlow Func(("Returning%Rrc *pcbDataReturned=%zu\n", rc, pcbDataReturned ? *pcbDataReturned : 0));3064 LogFlow(("VBoxGuestCommonIOCtl: returns %Rrc *pcbDataReturned=%zu\n", rc, pcbDataReturned ? *pcbDataReturned : 0)); 3081 3065 return rc; 3082 3066 } … … 3127 3111 PVBOXGUESTWAIT pSafe; 3128 3112 3129 #ifndef DEBUG_andy 3130 LogFlowFunc(("Acknowledge events succeeded: %#RX32\n", fEvents)); 3131 #endif 3113 Log3(("VBoxGuestCommonISR: acknowledge events succeeded %#RX32\n", fEvents)); 3114 3132 3115 /* 3133 3116 * VMMDEV_EVENT_MOUSE_POSITION_CHANGED can only be polled for. … … 3139 3122 #ifndef RT_OS_WINDOWS 3140 3123 if (pDevExt->MouseNotifyCallback.pfnNotify) 3141 pDevExt->MouseNotifyCallback.pfnNotify 3142 (pDevExt->MouseNotifyCallback.pvUser); 3124 pDevExt->MouseNotifyCallback.pfnNotify(pDevExt->MouseNotifyCallback.pvUser); 3143 3125 #endif 3144 3126 } … … 3194 3176 } 3195 3177 else /* something is serious wrong... */ 3196 LogFlowFunc(("Acknowledging events failed, rc=%Rrc (events=%#x)\n", 3197 pReq->header.rc, pReq->events)); 3198 } 3199 #ifndef DEBUG_andy 3178 Log(("VBoxGuestCommonISR: acknowledge events failed rc=%Rrc (events=%#x)!!\n", 3179 pReq->header.rc, pReq->events)); 3180 } 3200 3181 else 3201 LogFlowFunc(("Not ours\n")); 3202 #endif 3182 Log3(("VBoxGuestCommonISR: not ours\n")); 3203 3183 3204 3184 RTSpinlockRelease(pDevExt->EventSpinlock);
Note:
See TracChangeset
for help on using the changeset viewer.