Changeset 86871 in vbox for trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp
- Timestamp:
- Nov 12, 2020 10:15:18 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp
r86469 r86871 733 733 * it (guest property) is set. 734 734 */ 735 static bool checkDRMClient( )735 static bool checkDRMClient(void) 736 736 { 737 737 uint32_t uGuestPropSvcClientID; … … 745 745 } 746 746 747 static bool startDRMClient( )747 static bool startDRMClient(void) 748 748 { 749 749 char* argv[] = {NULL}; … … 755 755 int rc = execve(szDRMClientPath, argv, env); 756 756 if (rc == -1) 757 VBClLogFatalError("execve for % returns the following error %d%s\n", szDRMClientPath, errno, strerror(errno));757 VBClLogFatalError("execve for '%s' returns the following error %d: %s\n", szDRMClientPath, errno, strerror(errno)); 758 758 /* This is reached only when execve fails. */ 759 759 return false; 760 760 } 761 761 762 static bool init() 763 { 762 /** @copydoc VBCLSERVICE::pfnInit */ 763 static int vbclSVGAInit(void) 764 { 765 /* In 32-bit guests GAs build on our release machines causes an xserver hang. 766 * So for 32-bit GAs we use our DRM client. */ 767 #if ARCH_BITS == 32 768 /* igore rc */ startDRMClient(); 769 return VERR_NOT_AVAILABLE; 770 #endif 771 764 772 /* If DRM client is already running don't start this service. */ 765 773 if (checkDRMClient()) 766 774 { 767 775 VBClLogFatalError("DRM resizing is already running. Exiting this service\n"); 768 return false;776 return VERR_NOT_AVAILABLE; 769 777 } 770 778 if (isXwayland()) … … 781 789 } 782 790 783 static void cleanup() 791 /** @copydoc VBCLSERVICE::pfnStop */ 792 static void vbclSVGAStop(void) 784 793 { 785 794 if (mpMonitorPositions) … … 788 797 mpMonitorPositions = NULL; 789 798 } 790 stopX11MonitorThread(); 799 800 stopX11MonitorThread(); /** @todo r=andy We ignore rc!? */ 801 791 802 if (x11Context.pRandLibraryHandle) 792 803 { … … 1331 1342 } 1332 1343 1333 static const char *getName() 1334 { 1335 return "Display SVGA X11"; 1336 } 1337 1338 static const char *getPidFilePath() 1339 { 1340 return ".vboxclient-display-svga-x11.pid"; 1341 } 1342 1343 static int run(struct VBCLSERVICE **ppInterface, bool fDaemonised) 1344 { 1345 RT_NOREF(ppInterface, fDaemonised); 1346 1347 /* In 32-bit guests GAs build on our release machines causes an xserver hang. 1348 * So for 32-bit GAs we use our DRM client. */ 1349 #if ARCH_BITS == 32 1350 startDRMClient(); 1351 return VERR_NOT_AVAILABLE; 1352 #endif 1353 1354 if (!init()) 1355 return VERR_NOT_AVAILABLE; 1344 static int vbclSVGAWorker(bool volatile *pfShutdown) 1345 { 1346 RT_NOREF(pfShutdown); 1356 1347 1357 1348 /* Do not acknowledge the first event we query for to pick up old events, … … 1369 1360 if (rc == VERR_RESOURCE_BUSY) /* Someone else has already acquired it. */ 1370 1361 return VERR_RESOURCE_BUSY; 1362 1363 /* Let the main thread know that it can continue spawning services. */ 1364 RTThreadUserSignal(RTThreadSelf()); 1365 1371 1366 for (;;) 1372 1367 { … … 1442 1437 VBClLogFatalError("Failure waiting for event, rc=%Rrc\n", rc); 1443 1438 } 1444 cleanup(); 1445 } 1446 1447 static struct VBCLSERVICE interface = 1448 { 1449 getName,1450 getPidFilePath,1451 VBClServiceDefaultHandler, /* Init*/1452 run,1453 VBClServiceDefaultCleanup1454 }, *pInterface = &interface; 1455 1456 struct VBCLSERVICE **VBClDisplaySVGAX11Service() 1457 { 1458 return &pInterface;1459 } 1439 } 1440 1441 VBCLSERVICE g_SvcDisplaySVGA = 1442 { 1443 "dp-svga-x11", /* szName */ 1444 "SVGA X11 display", /* pszDescription */ 1445 ".vboxclient-display-svga-x11.pid", /* pszPidFilePath */ 1446 NULL, /* pszUsage */ 1447 NULL, /* pszOptions */ 1448 NULL, /* pfnOption */ 1449 vbclSVGAInit, /* pfnInit */ 1450 vbclSVGAWorker, /* pfnWorker */ 1451 vbclSVGAStop, /* pfnStop*/ 1452 NULL /* pfnTerm */ 1453 }; 1454
Note:
See TracChangeset
for help on using the changeset viewer.