Changeset 86877 in vbox
- Timestamp:
- Nov 12, 2020 6:32:51 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuestLib.h
r86876 r86877 812 812 VBGLR3DECL(int) VbglR3WriteCoreDump(void); 813 813 814 /** @} */ 815 816 /** @name DRM client handling 817 * @{ */ 818 VBGLR3DECL(bool) VbglR3DRMClientIsNeeded(void); 819 VBGLR3DECL(bool) VbglR3DRMClientIsRunning(void); 820 VBGLR3DECL(int) VbglR3DRMClientStart(void); 814 821 /** @} */ 815 822 -
trunk/src/VBox/Additions/common/VBoxGuest/lib/Makefile.kmk
r83655 r86877 122 122 VBoxGuestR3LibCpuHotPlug.cpp \ 123 123 VBoxGuestR3LibCredentials.cpp \ 124 VBoxGuestR3LibDRMClient.cpp \ 124 125 VBoxGuestR3LibEvent.cpp \ 125 126 VBoxGuestR3LibGuestUser.cpp \ -
trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp
r86876 r86877 894 894 } 895 895 896 #ifdef VBOX_WITH_VBOXSERVICE_DRMRESIZE897 /**898 * Check for a guest property and start VBoxDRMClient if it exists.899 *900 */901 static void startDRMResize(void)902 {903 uint32_t uGuestPropSvcClientID;904 int rc = VbglR3GuestPropConnect(&uGuestPropSvcClientID);905 if (RT_SUCCESS(rc))906 {907 rc = VbglR3GuestPropExist(uGuestPropSvcClientID, "/VirtualBox/GuestAdd/DRMResize");908 if (RT_SUCCESS(rc))909 {910 RTMsgInfo("Starting DRM resize service");911 char szDRMClientPath[RTPATH_MAX];912 RTPathExecDir(szDRMClientPath, RTPATH_MAX);913 RTPathStripSuffix(szDRMClientPath);914 RTPathAppend(szDRMClientPath, RTPATH_MAX, "VBoxDRMClient");915 const char *apszArgs[1] = { NULL };916 rc = RTProcCreate("VBoxDRMClient", apszArgs, RTENV_DEFAULT,917 RTPROC_FLAGS_DETACHED | RTPROC_FLAGS_SEARCH_PATH, NULL);918 if (rc == -1)919 RTMsgError("Could not start DRM resize service");920 }921 }922 }923 #endif /* VBOX_WITH_VBOXSERVICE_DRMRESIZE */924 896 925 897 int main(int argc, char **argv) … … 1188 1160 1189 1161 #ifdef VBOX_WITH_VBOXSERVICE_DRMRESIZE 1190 startDRMResize(); 1162 if (VbglR3DRMClientIsNeeded()) 1163 { 1164 rc = VbglR3DRMClientStart(); 1165 if (RT_FAILURE(rc)) 1166 VGSvcError("Starting DRM resizing client failed with %Rrc\n", rc); 1167 } 1191 1168 #endif /* VBOX_WITH_VBOXSERVICE_DRMRESIZE */ 1192 1169 -
trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp
r86876 r86877 670 670 const char *pSessionType; 671 671 672 if (pDisplayType != NULL) {672 if (pDisplayType != NULL) 673 673 return true; 674 } 675 pSessionType = getenv("XDG_SESSION_TYPE"); 676 if ((pSessionType != NULL) && (RTStrIStartsWith(pSessionType, "wayland"))) {674 675 pSessionType = getenv("XDG_SESSION_TYPE"); /** @todo r=andy Use RTEnv API. */ 676 if ((pSessionType != NULL) && (RTStrIStartsWith(pSessionType, "wayland"))) 677 677 return true; 678 } 679 return false; 680 } 681 682 /** 683 * We start VBoxDRMClient from VBoxService in case some guest property is set. 684 * We check the same guest property here and dont start this service in case 685 * it (guest property) is set. 686 */ 687 static bool checkDRMClient(void) 688 { 689 bool fStartClient = false; 690 691 uint32_t idClient; 692 int rc = VbglR3GuestPropConnect(&idClient); 693 if (RT_SUCCESS(rc)) 694 { 695 fStartClient = VbglR3GuestPropExist(idClient, "/VirtualBox/GuestAdd/DRMResize" /*pszPropName*/); 696 VbglR3GuestPropDisconnect(idClient); 697 } 698 699 return fStartClient; 700 } 701 702 static bool startDRMClient(void) 703 { 704 char* argv[] = {NULL}; 705 char* env[] = {NULL}; 706 char szDRMClientPath[RTPATH_MAX]; 707 RTPathExecDir(szDRMClientPath, RTPATH_MAX); 708 RTPathAppend(szDRMClientPath, RTPATH_MAX, "VBoxDRMClient"); 709 VBClLogInfo("Starting DRM client.\n"); 710 int rc = execve(szDRMClientPath, argv, env); 711 if (rc == -1) 712 VBClLogFatalError("execve for '%s' returns the following error %d: %s\n", szDRMClientPath, errno, strerror(errno)); 713 /* This is reached only when execve fails. */ 678 714 679 return false; 715 680 } … … 723 688 * So for 32-bit GAs we use our DRM client. */ 724 689 #if ARCH_BITS == 32 725 /* igore rc */ startDRMClient(); 726 return VERR_NOT_AVAILABLE; 690 int rc = VbglR3DRMClientStart(); 691 if (RT_FAILURE(rc)) 692 VBClLogError("Starting DRM resizing client (32-bit) failed with %Rrc\n", rc); 693 return VERR_NOT_AVAILABLE; /** @todo r=andy Why ignoring rc here? */ 727 694 #endif 728 695 729 696 /* If DRM client is already running don't start this service. */ 730 if ( checkDRMClient())731 { 732 VBClLog FatalError("DRM resizing is already running. Exiting this service\n");697 if (VbglR3DRMClientIsRunning()) 698 { 699 VBClLogInfo("DRM resizing is already running. Exiting this service\n"); 733 700 return VERR_NOT_AVAILABLE; 734 701 } 702 735 703 if (isXwayland()) 736 return startDRMClient(); 704 { 705 int rc = VbglR3DRMClientStart(); 706 if (RT_FAILURE(rc)) 707 VBClLogError("Starting DRM resizing client failed with %Rrc\n", rc); 708 return rc; 709 } 737 710 738 711 x11Connect(); 712 739 713 if (x11Context.pDisplay == NULL) 740 return false; 714 return VERR_NOT_AVAILABLE; 715 741 716 /* don't start the monitoring thread if related randr functionality is not available. */ 742 717 if (x11Context.fMonitorInfoAvailable) 718 { 743 719 if (RT_FAILURE(startX11MonitorThread())) 744 return false; 745 return true; 720 return VERR_NOT_AVAILABLE; 721 } 722 723 return VINF_SUCCESS; 746 724 } 747 725
Note:
See TracChangeset
for help on using the changeset viewer.