Changeset 75858 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Dec 1, 2018 10:13:05 PM (6 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxService
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
r75469 r75858 787 787 } 788 788 else 789 VGSvcError("vbsvcAutomounterQueryMountDirAndPrefix: RTPathAbs(%s) -> %Rrc\n", rc);789 VGSvcError("vbsvcAutomounterQueryMountDirAndPrefix: RTPathAbs(%s) -> %Rrc\n", pszDir, rc); 790 790 791 791 … … 967 967 */ 968 968 FILE *pFile = setmntent("/proc/mounts", "r"); 969 int iErrMounts = errno; 969 970 if (!pFile) 970 971 pFile = setmntent("/etc/mtab", "r"); … … 988 989 else 989 990 VGSvcError("vbsvcAutomounterQueryMountPoint: Could not open mount tab '%s' (errno=%d) or '/proc/mounts' (errno=%d)\n", 990 _PATH_MOUNTED, errno );991 _PATH_MOUNTED, errno, iErrMounts); 991 992 992 993 #elif defined(RT_OS_SOLARIS) -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.h
r75807 r75858 251 251 /** Whether the guest process thread was started or not. */ 252 252 bool fStarted; 253 /** Client ID. */254 uint32_t uClientID;255 253 /** Context ID. */ 256 254 uint32_t uContextID; -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp
r75807 r75858 516 516 pProcess->uPID, pProcess->StartupInfo.szCmd, pProcess->uContextID, 517 517 pProcess->StartupInfo.szUser, pProcess->StartupInfo.uTimeLimitMS); 518 VBGLR3GUESTCTRLCMDCTX ctxStart = { pProcess->uClientID, pProcess->uContextID };518 VBGLR3GUESTCTRLCMDCTX ctxStart = { g_idControlSvcClient, pProcess->uContextID }; 519 519 rc = VbglR3GuestCtrlProcCbStatus(&ctxStart, 520 520 pProcess->uPID, PROC_STS_STARTED, 0 /* u32Flags */, … … 694 694 } 695 695 696 VGSvcVerbose(3, "[PID %RU32]: Loop ended: rc=%Rrc, fShutdown=%RTbool, fProcessAlive=%RTbool, fProcessTimedOut=%RTbool, MsProcessKilled=%RU64 \n",696 VGSvcVerbose(3, "[PID %RU32]: Loop ended: rc=%Rrc, fShutdown=%RTbool, fProcessAlive=%RTbool, fProcessTimedOut=%RTbool, MsProcessKilled=%RU64 (%RX64)\n", 697 697 pProcess->uPID, rc, pProcess->fShutdown, fProcessAlive, fProcessTimedOut, MsProcessKilled, MsProcessKilled); 698 698 VGSvcVerbose(3, "[PID %RU32]: *phStdOutR=%s, *phStdErrR=%s\n", … … 832 832 else 833 833 VGSvcVerbose(1, "[PID %RU32]: Handling process status %u not implemented\n", pProcess->uPID, ProcessStatus.enmReason); 834 VBGLR3GUESTCTRLCMDCTX ctxEnd = { g_idControlSvcClient, pProcess->uContextID }; 834 835 VGSvcVerbose(2, "[PID %RU32]: Ended, ClientID=%u, CID=%u, Status=%u, Flags=0x%x\n", 835 pProcess->uPID, pProcess->uClientID, pProcess->uContextID, uStatus, fFlags); 836 837 VBGLR3GUESTCTRLCMDCTX ctxEnd = { pProcess->uClientID, pProcess->uContextID }; 836 pProcess->uPID, ctxEnd.uClientID, pProcess->uContextID, uStatus, fFlags); 837 838 838 rc2 = VbglR3GuestCtrlProcCbStatus(&ctxEnd, pProcess->uPID, uStatus, fFlags, NULL /* pvData */, 0 /* cbData */); 839 839 if ( RT_FAILURE(rc2) … … 1448 1448 VGSvcVerbose(3, "Thread of process pThread=0x%p = '%s' started\n", pProcess, pProcess->StartupInfo.szCmd); 1449 1449 1450 int rc = VbglR3GuestCtrlConnect(&pProcess->uClientID); 1451 if (RT_FAILURE(rc)) 1452 { 1453 VGSvcError("Process thread '%s' (%p) failed to connect to the guest control service, rc=%Rrc\n", 1454 pProcess->StartupInfo.szCmd, pProcess, rc); 1455 RTThreadUserSignal(RTThreadSelf()); 1456 return rc; 1457 } 1458 1459 VGSvcVerbose(3, "Guest process '%s' got client ID=%u, flags=0x%x\n", 1460 pProcess->StartupInfo.szCmd, pProcess->uClientID, pProcess->StartupInfo.uFlags); 1461 1462 /* Legacy setting: */ 1463 if (!VbglR3GuestCtrlSupportsOptimizations(pProcess->uClientID)) 1464 { 1465 rc = VbglR3GuestCtrlMsgFilterSet(pProcess->uClientID, 0 /* Skip all */, 1466 0 /* Filter mask to add */, 0 /* Filter mask to remove */); 1467 if (RT_FAILURE(rc)) 1468 VGSvcError("Unable to set message filter, rc=%Rrc\n", rc); /* Non-critical. */ 1469 } 1470 1471 rc = VGSvcGstCtrlSessionProcessAdd(pProcess->pSession, pProcess); 1450 VGSvcVerbose(3, "Guest process '%s', flags=0x%x\n", pProcess->StartupInfo.szCmd, pProcess->StartupInfo.uFlags); 1451 1452 int rc = VGSvcGstCtrlSessionProcessAdd(pProcess->pSession, pProcess); 1472 1453 if (RT_FAILURE(rc)) 1473 1454 { … … 1583 1564 { 1584 1565 uint32_t uFlags = RTPOLL_EVT_ERROR; 1585 1566 #if 0 1586 1567 /* Add reading event to pollset to get some more information. */ 1587 1568 uFlags |= RTPOLL_EVT_READ; 1588 1569 #endif 1589 1570 /* Stdin. */ 1590 1571 if (RT_SUCCESS(rc)) … … 1698 1679 } 1699 1680 1700 if (pProcess->uClientID) 1701 { 1702 if (RT_FAILURE(rc)) 1703 { 1704 VBGLR3GUESTCTRLCMDCTX ctx = { pProcess->uClientID, pProcess->uContextID }; 1705 int rc2 = VbglR3GuestCtrlProcCbStatus(&ctx, 1706 pProcess->uPID, PROC_STS_ERROR, rc, 1707 NULL /* pvData */, 0 /* cbData */); 1708 if ( RT_FAILURE(rc2) 1709 && rc2 != VERR_NOT_FOUND) 1710 VGSvcError("[PID %RU32]: Could not report process failure error; rc=%Rrc (process error %Rrc)\n", 1711 pProcess->uPID, rc2, rc); 1712 } 1713 1714 /* Disconnect this client from the guest control service. This also cancels all 1715 * outstanding host requests. */ 1716 VGSvcVerbose(3, "[PID %RU32]: Disconnecting (client ID=%u) ...\n", pProcess->uPID, pProcess->uClientID); 1717 VbglR3GuestCtrlDisconnect(pProcess->uClientID); 1718 pProcess->uClientID = 0; 1681 if (RT_FAILURE(rc)) 1682 { 1683 VBGLR3GUESTCTRLCMDCTX ctx = { g_idControlSvcClient, pProcess->uContextID }; 1684 int rc2 = VbglR3GuestCtrlProcCbStatus(&ctx, 1685 pProcess->uPID, PROC_STS_ERROR, rc, 1686 NULL /* pvData */, 0 /* cbData */); 1687 if ( RT_FAILURE(rc2) 1688 && rc2 != VERR_NOT_FOUND) 1689 VGSvcError("[PID %RU32]: Could not report process failure error; rc=%Rrc (process error %Rrc)\n", 1690 pProcess->uPID, rc2, rc); 1719 1691 } 1720 1692 … … 1808 1780 { 1809 1781 static uint32_t s_uCtrlExecThread = 0; 1810 if (s_uCtrlExecThread++ == UINT32_MAX) 1782 if (s_uCtrlExecThread++ == UINT32_MAX) /** @todo r=bird: ????????????? */ 1811 1783 s_uCtrlExecThread = 0; /* Wrap around to not let IPRT freak out. */ 1812 1784 rc = RTThreadCreateF(&pProcess->Thread, vgsvcGstCtrlProcessThread, -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp
r75853 r75858 256 256 else 257 257 { 258 VGSvcError("[File %s] empty filename!\n" );258 VGSvcError("[File %s] empty filename!\n", szFile); 259 259 rc = VERR_INVALID_NAME; 260 260 } … … 1499 1499 rc = VbglR3GuestCtrlSessionAccept(idClient, idSession, abSecretKey, sizeof(abSecretKey)); 1500 1500 if (RT_SUCCESS(rc)) 1501 VGSvcVerbose(3, "Session %u accepted \n");1501 VGSvcVerbose(3, "Session %u accepted (client ID %u)\n", idClient, idSession); 1502 1502 else 1503 VGSvcError("Failed to accept session : %Rrc\n", rc);1503 VGSvcError("Failed to accept session %u (client ID %u): %Rrc\n", idClient, idSession, rc); 1504 1504 } 1505 1505 else … … 1509 1509 VBOX_GUESTCTRL_FILTER_BY_SESSION(idSession), 0); 1510 1510 if (RT_SUCCESS(rc)) 1511 VGSvcVerbose(3, "Session %u filtering successfully enabled\n" );1511 VGSvcVerbose(3, "Session %u filtering successfully enabled\n", idSession); 1512 1512 else 1513 1513 VGSvcError("Failed to set session filter: %Rrc\n", rc); … … 1549 1549 return VGSvcError("Error connecting to guest control service, rc=%Rrc\n", rc); 1550 1550 g_fControlSupportsOptimizations = VbglR3GuestCtrlSupportsOptimizations(idClient); 1551 g_idControlSvcClient = idClient; 1551 1552 1552 1553 rc = vgsvcGstCtrlSessionReadKeyAndAccept(idClient, pSession->StartupInfo.uSessionID); … … 1618 1619 VGSvcVerbose(3, "Disconnecting client ID=%RU32 ...\n", idClient); 1619 1620 VbglR3GuestCtrlDisconnect(idClient); 1621 g_idControlSvcClient = 0; 1620 1622 1621 1623 VGSvcVerbose(3, "Session worker returned with rc=%Rrc\n", rc); -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h
r70346 r75858 182 182 #endif 183 183 184 extern RTEXITCODE VGSvcSyntax(const char *pszFormat, ...) ;185 extern RTEXITCODE VGSvcError(const char *pszFormat, ...) ;186 extern void VGSvcVerbose(unsigned iLevel, const char *pszFormat, ...) ;184 extern RTEXITCODE VGSvcSyntax(const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(1, 2); 185 extern RTEXITCODE VGSvcError(const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(1, 2); 186 extern void VGSvcVerbose(unsigned iLevel, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(2, 3); 187 187 extern int VGSvcLogCreate(const char *pszLogFile); 188 extern void VGSvcLogV(const char *pszFormat, va_list va) ;188 extern void VGSvcLogV(const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(1, 0); 189 189 extern void VGSvcLogDestroy(void); 190 190 extern int VGSvcArgUInt32(int argc, char **argv, const char *psz, int *pi, uint32_t *pu32,
Note:
See TracChangeset
for help on using the changeset viewer.