mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-29 01:48:31 +00:00
ipc: Allow IPC path to be set dynamically
Uses cache for XRT_IPC_MSG_SOCK_FILE
This commit is contained in:
parent
74d82ff37f
commit
cc2e7b6da3
|
@ -305,6 +305,7 @@ option_with_deps(XRT_BUILD_DRIVER_SIMULAVR "Enable simula driver" DEPENDS XRT_HA
|
|||
option(XRT_BUILD_DRIVER_SIMULATED "Enable simulated driver" ON)
|
||||
|
||||
option(XRT_BUILD_SAMPLES "Enable compiling sample code implementations that will not be linked into any final targets" ON)
|
||||
set(XRT_IPC_MSG_SOCK_FILENAME monado_comp_ipc CACHE STRING "Service socket filename")
|
||||
|
||||
# cmake-format: on
|
||||
|
||||
|
|
|
@ -28,3 +28,4 @@
|
|||
#cmakedefine XRT_FEATURE_TRACING
|
||||
#cmakedefine XRT_FEATURE_CLIENT_DEBUG_GUI
|
||||
#cmakedefine XRT_FEATURE_WINDOW_PEEK
|
||||
#cmakedefine XRT_IPC_MSG_SOCK_FILENAME "@XRT_IPC_MSG_SOCK_FILENAME@"
|
||||
|
|
|
@ -132,7 +132,7 @@ ipc_connect(struct ipc_connection *ipc_c)
|
|||
|
||||
char sock_file[PATH_MAX];
|
||||
|
||||
int size = u_file_get_path_in_runtime_dir(IPC_MSG_SOCK_FILE, sock_file, PATH_MAX);
|
||||
int size = u_file_get_path_in_runtime_dir(XRT_IPC_MSG_SOCK_FILENAME, sock_file, PATH_MAX);
|
||||
if (size == -1) {
|
||||
IPC_ERROR(ipc_c, "Could not get socket file name");
|
||||
return -1;
|
||||
|
|
|
@ -88,7 +88,7 @@ create_listen_socket(struct ipc_server_mainloop *ml, int *out_fd)
|
|||
|
||||
char sock_file[PATH_MAX];
|
||||
|
||||
int size = u_file_get_path_in_runtime_dir(IPC_MSG_SOCK_FILE, sock_file, PATH_MAX);
|
||||
int size = u_file_get_path_in_runtime_dir(XRT_IPC_MSG_SOCK_FILENAME, sock_file, PATH_MAX);
|
||||
if (size == -1) {
|
||||
U_LOG_E("Could not get socket file name");
|
||||
return -1;
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
#include "xrt/xrt_compositor.h"
|
||||
#include "xrt/xrt_device.h"
|
||||
#include "xrt/xrt_tracking.h"
|
||||
#include "xrt/xrt_config_build.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#define IPC_MSG_SOCK_FILE "monado_comp_ipc"
|
||||
#define IPC_MAX_SWAPCHAIN_HANDLES 8
|
||||
#define IPC_CRED_SIZE 1 // auth not implemented
|
||||
#define IPC_BUF_SIZE 512 // must be >= largest message length in bytes
|
||||
|
|
|
@ -225,7 +225,7 @@ do_connect(struct ipc_connection *ipc_c)
|
|||
|
||||
char sock_file[PATH_MAX];
|
||||
|
||||
int rt_size = u_file_get_path_in_runtime_dir(IPC_MSG_SOCK_FILE, sock_file, PATH_MAX);
|
||||
int rt_size = u_file_get_path_in_runtime_dir(XRT_IPC_MSG_SOCK_FILENAME, sock_file, PATH_MAX);
|
||||
if (rt_size == -1) {
|
||||
PE("Could not get socket file name");
|
||||
return -1;
|
||||
|
|
|
@ -7,6 +7,7 @@ set(XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_FILES @XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_F
|
|||
set(conflicts @conflicts@)
|
||||
set(exit_on_disconnect @exit_on_disconnect@)
|
||||
set(service_path "monado-service")
|
||||
set(XRT_IPC_MSG_SOCK_FILENAME @XRT_IPC_MSG_SOCK_FILENAME@)
|
||||
if(XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_FILES)
|
||||
set(service_path "${CMAKE_INSTALL_PREFIX}/@CMAKE_INSTALL_BINDIR@/${service_path}")
|
||||
endif()
|
||||
|
|
|
@ -7,7 +7,7 @@ ConditionUser=!root
|
|||
Conflicts=@conflicts@.socket
|
||||
|
||||
[Socket]
|
||||
ListenStream=%t/monado_comp_ipc
|
||||
ListenStream=%t/@XRT_IPC_MSG_SOCK_FILENAME@
|
||||
RemoveOnStop=true
|
||||
|
||||
[Install]
|
||||
|
|
Loading…
Reference in a new issue