]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: activate directory override when used from library
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 29 Aug 2019 10:52:08 +0000 (11:52 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 10 Sep 2019 10:03:35 +0000 (11:03 +0100)
commitb1b878c512cd0fc56863a86c9dd6036dcb05e137
tree07c9dec3fcb191b2e6091588936a07abbd1d640a
parent29307fa84da1c572b5f44c32343103b5ed98d42a
util: activate directory override when used from library

The Perl bindings for libvirt use the test driver for unit tests. This
tries to load the cpu_map/index.xml file, and when run from an
uninstalled build will fail.

The problem is that virFileActivateDirOverride is called by our various
binaries like libvirtd, virsh, but is not called when a 3rd party app
uses libvirt.so

To deal with this we allow the LIBVIRT_DIR_OVERRIDE=1 env variable to be
set and make virInitialize look for this. The 'run' script will set it,
so now build using this script to run against an uninstalled tree we
will correctly resolve files to the source tree.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
12 files changed:
run.in
src/libvirt.c
src/libvirt_private.syms
src/locking/lock_daemon.c
src/logging/log_daemon.c
src/remote/remote_daemon.c
src/security/virt-aa-helper.c
src/util/virfile.c
src/util/virfile.h
tests/testutils.c
tools/virsh.c
tools/virt-admin.c