Commit Graph

978 Commits

Author SHA1 Message Date
Daniel P. Berrangé
d3d8b1bca8 make: split secret driver build rules into secret/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-03-05 17:09:49 +00:00
Daniel P. Berrangé
c6d59fb935 make: split nodedev driver build rules into node_device/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-03-05 17:09:48 +00:00
Daniel P. Berrangé
684388d902 make: split nwfilter driver build rules into nwfilter/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-03-05 17:09:08 +00:00
Daniel P. Berrangé
6d1d414c36 make: split network driver build rules into network/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-03-05 17:08:36 +00:00
Daniel P. Berrangé
09e771c376 make: split interface driver build rules into interface/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-03-05 17:08:35 +00:00
Jan Palus
43523d7421 make sure libvirt is linked first
so it's not affected by flags that might be passed in $(*_LIBS) like
-L/usr/lib which might result in linking against system library and
requiring incorrect version of private symbols

Signed-off-by: Jan Palus <atler@pld-linux.org>
2018-03-05 16:49:50 +00:00
Andrea Bolognani
65024c8939 src: Fix checking for clang
The check was trying to use the shell variable $CC instead of
the make variable $(CC); it also interpreted grep's return code
wrong: 1 means the provided pattern was *not* matched. As a
result, pdwtags was never run, not even when building with gcc.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-03-01 17:47:54 +01:00
Daniel P. Berrangé
900383f5b8 make: skip pdwtags when building with CLang
When building with CLang the structs that are emitted by pdwtags appear
in a completely different order than with GCC, which causes the
comparison against expected data to fail.

Ideally the test would not be sensitive to the ordering, because even
future GCC could cause changes, but that's not easy to fix. So for now
just skip the test when using clang.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-28 17:53:23 +00:00
Daniel P. Berrangé
e1ab81b339 storage: fix sheepdog driver / test linking to avoid duplicating source
The libvirt_storage_backend_sheepdog_priv.la library depends on symbols
provided in the libvirt_driver_storage_impl.la library. As such the
latter must be listed 2nd when passed to the linker to avoid symbol
resolution problems. This mistake is being masked by the sheepdog
driver linking in a second copy of the storage driver code. Remove
this duplicate linkage of backend source and fix the test link order.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-27 14:51:12 +00:00
Daniel P. Berrangé
19d3d2633c make: fix uninstall of subdirectory data
A typo in the uninstall-data-extra rule expansion meant we just called
the install rule again, instead of the uninstall rule. While fixing
this, just inline the dependancy, since the intermediate
install-data-extra rule adds no value.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-27 14:50:57 +00:00
Daniel P. Berrangé
ddedcd0e14 make: split lxc driver build rules into lxc/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:26 +00:00
Daniel P. Berrangé
7b621870df make: split vz driver build rules into vz/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:26 +00:00
Daniel P. Berrangé
4edef9c3b3 make: split xenapi driver build rules into xenapi/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:26 +00:00
Daniel P. Berrangé
2cd876eb7f make: split xen driver build rules into xen/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:26 +00:00
Daniel P. Berrangé
ea7c61255f make: split libxl driver build rules into libxl/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:26 +00:00
Daniel P. Berrangé
cdfbb0666f make: split xenconfig driver build rules into xenconfig/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:26 +00:00
Daniel P. Berrangé
cf2c4c9e15 make: split bhyve driver build rules into bhyve/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:26 +00:00
Daniel P. Berrangé
abe060a4fa make: split qemu driver build rules into qemu/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:26 +00:00
Daniel P. Berrangé
1158bf0db1 make: split openvz driver build rules into openvz/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:26 +00:00
Daniel P. Berrangé
0ca89a95ac make: split vbox driver build rules into vbox/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:26 +00:00
Daniel P. Berrangé
af04f5c023 make: split vmware driver build rules into vmware/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:25 +00:00
Daniel P. Berrangé
253b528c3f make: split hyperv driver build rules into hyperv/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:25 +00:00
Daniel P. Berrangé
100864c042 make: split ESX driver build rules into esx/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:25 +00:00
Daniel P. Berrangé
c8da8363d2 make: split test driver build rules into test/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:25 +00:00
Daniel P. Berrangé
82ef8c49ae make: split PHyp driver build rules into phyp/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:25 +00:00
Daniel P. Berrangé
44fc16ec7f make: split UML driver build rules into uml/Makefile.inc.am
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 13:14:25 +00:00
Daniel P. Berrangé
1351a0f8b4 make: fix VPATH install of upstart files
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-23 11:56:25 +00:00
Daniel P. Berrangé
595ecf29d2 make: fix long line in makefile that violate syntax-check rules
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-22 15:45:38 +00:00
Daniel P. Berrangé
3340f3070a make: fix another VPATH bug impacting install of sysconf files
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-22 14:54:48 +00:00
Michal Privoznik
800443f49a src: Clean *.logrotate, .aug and libvirtd.policy files on 'make clean'
Before 3f055b5997 we were doing that. However after the commit
we are leaving the files behind.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-02-22 14:34:16 +01:00
Daniel P. Berrangé
c2090b1189 make: fix VPATH build for libvirtd augeas check
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-22 13:33:26 +00:00
Daniel P. Berrangé
3f055b5997 daemon: move logrotate files to src/remote/
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-22 12:26:57 +00:00
Daniel P. Berrangé
21ea3828f7 daemon: move misc libvirtd policy files to src/remote/
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-22 12:26:50 +00:00
Daniel P. Berrangé
168bcca95d daemon: move configuration files to src/remote
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-22 12:26:39 +00:00
Daniel P. Berrangé
0f6260ada3 daemon: move init system files into src/remote/
Move the systemd, sysvinit, upstart and sysconfig files into the
src/remote/ directory.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-22 12:21:21 +00:00
Daniel P. Berrangé
98faaf173f daemon: move libvirtd POD manpage into src/remote/
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-22 12:21:09 +00:00
Daniel P. Berrangé
91fd3dc932 daemon: move libvirtd code into src/remote/ directory
Having a daemon/ directory makes little sense from a code structure
point of view, as 90% of the code that is built into libvirtd already
lives in the src/ directory. The virtlockd and virlogd daemons also live
entirely in src/{locking,logging} directories. This moves the source
code for libvirtd into src/remote/, alongside the client code.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-22 12:21:08 +00:00
Daniel P. Berrangé
5f998681df src: simplify sysconfig file handling in make rules
Remove lots of duplication in the sysconfig file handling, so we can
add more conf files without modifying so many places.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-22 11:30:36 +00:00
Daniel P. Berrangé
cd191ba0bb src: simplify sysv init file handling in make rules
Remove lots of duplication in the sysv init file handling, so we can
add more init files without modifying so many places.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-22 10:54:10 +00:00
Daniel P. Berrangé
3422cca648 src: simplify systemd unit file handling in make rules
Remove lots of duplication in the systemd unit file handling, so we can
add more unit files without modifying so many places.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-22 10:54:10 +00:00
Daniel P. Berrangé
b7d0e27238 src: remove WITH_LIBVIRTD condition around hal/udev build
Currently building --without-libvirtd causes a failure to link the node
device driver:

node_device/.libs/libvirt_driver_nodedev_la-node_device_driver.o: In function `nodedevRegister':
/home/berrange/src/virt/libvirt/src/node_device/node_device_driver.c:649: undefined reference to `udevNodeRegister'
collect2: error: ld returned 1 exit status

because it causes us to build the core nodedev driver, but then skip the
implementations, despite udev being available.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-21 15:21:03 +00:00
John Ferlan
f65e8a9527 lockd: Install the admin sockets
Commit id 'ce7ae55e' added support for the lockd admin socket, but
forgot to add the socket to the make and spec files for installation
purposes.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
2018-02-09 06:34:20 -05:00
John Ferlan
bffdd6c303 logd: Install the admin sockets
Commit id '85d45ff0' added support for the logd admin socket, but
forgot to add the socket to the make and spec files for installation
purposes.

NB: Includes breaking up the long %systemd_ lists across multiple lines
    for ease of reading

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
2018-02-09 06:34:20 -05:00
Daniel P. Berrangé
a1f6030def build: passing the "-z defs" linker flag to prevent undefined symbols
Undefined symbols are a bad thing in general because they can get
resolved in unexpected ways at runtime if multiple sources provide the
same symbol name. For example both glibc and libtirpc may provide XDR
symbols and we want to ensure that we resolve to libtirpc if that's what
we originally built against.

The toolchain maintainers thus strongly recommend that all applications
use the '-z defs' linker flag to prevent undefined symbols. This is
shortly becoming part of the default linker flags for RPMs. As an added
benefit this aligns Linux builds with Windows builds, where the linker
has never permitted undefined symbols.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-02-09 11:05:10 +00:00
Daniel P. Berrangé
9e3c9af98a build: provide a AM_FLAGS_MOD for loadable modules
Dynamic loadable modules all need a common set of linker flags

  -module -avoid-version $(AM_LDFLAGS)

Bundle those up into a $(AM_LDFLAGS_MOD) to avoid repetition.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-09 11:05:10 +00:00
Daniel P. Berrangé
21639744f6 build: explicitly link all modules with libvirt.so
The dlopened modules we currently build all use various symbols from
libvirt.so, but don't actually link to it. They rely on the libvirtd
daemon re-exporting the libvirt.so symbols. This means that at the
time the modules are linked, they contain a huge number of undefined
symbols. It also means that these undefined symbols are not versioned,
so despite us providing a LIBVIRT_PRIVATE_XXXX version that
intentionally changes on every release, the loadable modules could
actually be loaded into any libvirtd regardless of version.

This change explicitly links all modules against libvirt.so so
that they don't rely on the re-export behave and can be fully resolved
at build time. This will give us a stronger guarantee modules will
actually be loadable at runtime and that we're using modules from the
matched build.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-02-09 11:05:10 +00:00
Daniel P. Berrangé
5cbe0b1085 build: link libvirt_lxc against libvirt.so
Rather than static linking in various of the helper libraries to
libvirt_lxc, just link against the main libvirt.so. This is more memory
and time efficient because it will already be cached in memory and
sharable between processes.

CAPNG flags need adding because the LXC code directly calls various
libcapng APIs and no longer inherits the CAPNG flags via the statically
linked .a libs.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-09 11:05:10 +00:00
Daniel P. Berrangé
c3b24e7051 rpc: don't link in second copy of RPC code to libvirtd & lockd plugin
The libvirt_driver_remote.la static library is linked into the
libvirt.so dynamic library, providing both the generic RPC layer code
and the remote protocol client driver. The libvirtd daemon the itself
links to libvirt_driver_remote.la, in order to get access to the generic
RPC layer code and the XDR functions for the remote driver. This means
we get multiple copies of the same code in libvirtd, one direct and one
indirect via libvirt.so. The same mistake affects the lockd plugin.

The libvirtd daemon should instead just link aganist the generic RPC
layer code that's in libvirt.so. This is easily doable if we add exports
for the few symbols we've previously missed, and wildcard export xdr_*
to expose the auto-generated XDR marshallers.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-09 11:05:10 +00:00
Daniel P. Berrangé
064fec69be storage: move storage file backend framework into util directory
The QEMU driver loadable module needs to be able to resolve all ELF
symbols it references against libvirt.so. Some of its symbols can only
be resolved against the storage_driver.so loadable module which creates
a hard dependancy between them. By moving the storage file backend
framework into the util directory, this gets included directly in the
libvirt.so library. The actual backend implementations are still done as
loadable modules, so this doesn't re-add deps on gluster libraries.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-02-09 11:05:10 +00:00
Daniel P. Berrangé
3be2d1684a storage: extract storage file backend from main storage driver backend
The storage driver backends are serving the public storage pools API,
while the storage file backends are serving the internal QEMU driver and
/ or libvirt utility code.

To prep for moving this storage file backend framework into the utility
code, split out the backend definitions.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-02-09 11:05:10 +00:00