On 7/9/20 8:36 PM, Daniel P. Berrangé wrote:
When accessing libvirtd over a SSH tunnel, the remote driver must
spawn
the remote 'nc' process, pointing it to the libvirtd socket path. This
is problematic for a number of reasons:
- The socket path varies according to the --prefix chosen at build
time. The remote client is seeing the local prefix, but what we
need is the remote prefix
- The socket path varies according to remote env variables, such as
the XDG_RUNTIME_DIR location. Again we see the local XDG_RUNTIME_DIR
value, but what we need is the remote value (if any)
- We can not able to autospawn the libvirtd daemon for session mode
access
To address these problems this patch introduces the 'virtd-nc' helper
program which takes the URI for the remote driver as a CLI parameter.
It then figures out the socket path to connect to using the same
code as the remote driver does on the remote host.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
build-aux/syntax-check.mk | 2 +-
po/POTFILES.in | 1 +
src/remote/Makefile.inc.am | 30 +++
src/remote/remote_nc.c | 424 +++++++++++++++++++++++++++++++++++++
src/rpc/virnetsocket.h | 1 +
5 files changed, 457 insertions(+), 1 deletion(-)
create mode 100644 src/remote/remote_nc.c
The spec file needs to be updated too.
Michal