]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: add info about g_get_user_*_dir directories to log banner master
authorLaine Stump <laine@redhat.com>
Tue, 7 Apr 2026 00:38:32 +0000 (20:38 -0400)
committerLaine Stump <laine@redhat.com>
Thu, 9 Apr 2026 05:12:24 +0000 (01:12 -0400)
commit792cb6bf60e774ee8ecf9e7d3cd2b6f21011ab43
tree13a0940d59bd8b6f78f3d1d16d778e75c369a029
parent92dd8a5d6c62459941a7984135e4bf9dd93ea665
util: add info about g_get_user_*_dir directories to log banner

When running in session/unprivileged mode, nearly all paths are
prefixed with the returns from one of glib's g_get_user_*_dir()
functions, which in turn base their selected paths on the settings of
a few items in the user's environment ($XDG_*, or a subdirectory of
$HOME if the relevant $XDG_* isn't set).

This patch logs the settings of these directories in the log banner in
an attempt to help diagnose the problem when a file/socket open/create
fails.

An example of the banner:

libvirt version: 12.3.0, package: 1.fc43 (Unknown, 2026-04-07-22:43:30, vhost)
hostname: 83be0e173e02, uid: 107
home dir: '/' (HOME='/')
runtime dir: '/.cache' (XDG_RUNTIME_DIR='(unset)')
config dir: '/.config' (XDG_CONFIG_HOME='(unset)')
log dir: '/.cache' (XDG_CACHE_HOME='(unset)')
libvirt: XML-RPC error : Cannot create user runtime directory '/.cache/libvirt': Permission denied

Resolves: https://redhat.atlassian.net/browse/RHEL-70222
Resolves: https://redhat.atlassian.net/browse/RHEL-105490
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/util/virlog.c