There's nothing RPC specific about virnettlscontext.c or virnetsocket.c. We use TLS for other things than just RPC encryption (e.g. for generating random numbers) and sockets can be used even without RPC. Move these two sources into a static library (virt_socket) so that other areas can use it even when RPC is disabled. Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> --- src/libvirt_remote.syms | 56 ----------------------------------- src/libvirt_socket.syms | 65 +++++++++++++++++++++++++++++++++++++++++ src/rpc/meson.build | 24 +++++++++++++-- 3 files changed, 87 insertions(+), 58 deletions(-) create mode 100644 src/libvirt_socket.syms diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms index 942e1013a6..1089796066 100644 --- a/src/libvirt_remote.syms +++ b/src/libvirt_remote.syms @@ -225,62 +225,6 @@ virNetServerServiceTimerActive; virNetServerServiceToggle; -# rpc/virnetsocket.h -virNetSocketAccept; -virNetSocketAddIOCallback; -virNetSocketCheckProtocols; -virNetSocketClose; -virNetSocketDupFD; -virNetSocketGetFD; -virNetSocketGetPath; -virNetSocketGetPort; -virNetSocketGetSELinuxContext; -virNetSocketGetUNIXIdentity; -virNetSocketHasCachedData; -virNetSocketHasPassFD; -virNetSocketHasPendingData; -virNetSocketIsLocal; -virNetSocketListen; -virNetSocketLocalAddrStringSASL; -virNetSocketNewConnectCommand; -virNetSocketNewConnectExternal; -virNetSocketNewConnectLibSSH2; -virNetSocketNewConnectSockFD; -virNetSocketNewConnectSSH; -virNetSocketNewConnectTCP; -virNetSocketNewConnectUNIX; -virNetSocketNewListenFD; -virNetSocketNewListenTCP; -virNetSocketNewListenUNIX; -virNetSocketNewPostExecRestart; -virNetSocketPreExecRestart; -virNetSocketRead; -virNetSocketRecvFD; -virNetSocketRemoteAddrStringSASL; -virNetSocketRemoteAddrStringURI; -virNetSocketRemoveIOCallback; -virNetSocketSendFD; -virNetSocketSetBlocking; -virNetSocketSetTLSSession; -virNetSocketUpdateIOCallback; -virNetSocketWrite; - - -# rpc/virnettlscontext.h -virNetTLSContextCheckCertificate; -virNetTLSContextNewClient; -virNetTLSContextNewClientPath; -virNetTLSContextNewServer; -virNetTLSContextNewServerPath; -virNetTLSInit; -virNetTLSSessionGetHandshakeStatus; -virNetTLSSessionGetKeySize; -virNetTLSSessionGetX509DName; -virNetTLSSessionHandshake; -virNetTLSSessionNew; -virNetTLSSessionRead; -virNetTLSSessionSetIOCallbacks; -virNetTLSSessionWrite; # Let emacs know we want case-insensitive sorting diff --git a/src/libvirt_socket.syms b/src/libvirt_socket.syms new file mode 100644 index 0000000000..3669166225 --- /dev/null +++ b/src/libvirt_socket.syms @@ -0,0 +1,65 @@ +# +# TLS and socket specific symbols +# + +# rpc/virnetsocket.h +virNetSocketAccept; +virNetSocketAddIOCallback; +virNetSocketCheckProtocols; +virNetSocketClose; +virNetSocketDupFD; +virNetSocketGetFD; +virNetSocketGetPath; +virNetSocketGetPort; +virNetSocketGetSELinuxContext; +virNetSocketGetUNIXIdentity; +virNetSocketHasCachedData; +virNetSocketHasPassFD; +virNetSocketHasPendingData; +virNetSocketIsLocal; +virNetSocketListen; +virNetSocketLocalAddrStringSASL; +virNetSocketNewConnectCommand; +virNetSocketNewConnectExternal; +virNetSocketNewConnectLibSSH2; +virNetSocketNewConnectSockFD; +virNetSocketNewConnectSSH; +virNetSocketNewConnectTCP; +virNetSocketNewConnectUNIX; +virNetSocketNewListenFD; +virNetSocketNewListenTCP; +virNetSocketNewListenUNIX; +virNetSocketNewPostExecRestart; +virNetSocketPreExecRestart; +virNetSocketRead; +virNetSocketRecvFD; +virNetSocketRemoteAddrStringSASL; +virNetSocketRemoteAddrStringURI; +virNetSocketRemoveIOCallback; +virNetSocketSendFD; +virNetSocketSetBlocking; +virNetSocketSetTLSSession; +virNetSocketUpdateIOCallback; +virNetSocketWrite; + + +# rpc/virnettlscontext.h +virNetTLSContextCheckCertificate; +virNetTLSContextNewClient; +virNetTLSContextNewClientPath; +virNetTLSContextNewServer; +virNetTLSContextNewServerPath; +virNetTLSInit; +virNetTLSSessionGetHandshakeStatus; +virNetTLSSessionGetKeySize; +virNetTLSSessionGetX509DName; +virNetTLSSessionHandshake; +virNetTLSSessionNew; +virNetTLSSessionRead; +virNetTLSSessionSetIOCallbacks; +virNetTLSSessionWrite; + +# Let emacs know we want case-insensitive sorting +# Local Variables: +# sort-fold-case: t +# End: diff --git a/src/rpc/meson.build b/src/rpc/meson.build index cc1424140a..6c32610d29 100644 --- a/src/rpc/meson.build +++ b/src/rpc/meson.build @@ -1,10 +1,30 @@ genprotocol_prog = find_program('genprotocol.pl') gendispatch_prog = find_program('gendispatch.pl') -rpc_sources = [ - 'virnetmessage.c', +socket_sources = [ 'virnettlscontext.c', 'virnetsocket.c', +] + +virt_socket_lib = static_library( + 'virt_socket', + [ + socket_sources, + ], + dependencies: [ + gnutls_dep, + src_dep, + ], +) + +libvirt_libs += [ + virt_socket_lib +] + +used_sym_files += 'libvirt_socket.syms' + +rpc_sources = [ + 'virnetmessage.c', 'virkeepalive.c', ] -- 2.32.0