Commit Graph

966 Commits

Author SHA1 Message Date
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
Daniel P. Berrangé
7090a82041 admin: set XDR_CFLAGS when building admin server
The XDR_CFLAGS variable is needed when the XDR headers are not
part of the stock glibc install

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-01-31 19:05:45 +00:00
Daniel P. Berrange
ce7ae55ea1 lockd: add support for admin protocol in virtlockd
Add a virtlockd-admin-sock can serves the admin protocol for the virtlockd
daemon and define a virtlockd:///{system,session}  URI scheme for
connecting to it.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-31 15:18:36 +00:00
Daniel P. Berrange
85d45ff05d logd: add support for admin protocol in virtlogd
Add a virtlogd-admin-sock can serves the admin protocol for the virtlogd
daemon and define a virtlogd:///{system,session}  URI scheme for
connecting to it.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-31 15:17:47 +00:00
Daniel P. Berrange
b1e03dad86 admin: move admins server impl/dispatch into src/admin directory
The admin server functionality is a generic concept that should be wired
up into all libvirt daemons, but is currently integrated with the
libvirtd code. Move it all into the src/admin directory to prepare for
broader reuse.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-31 15:12:30 +00:00
Erik Skultety
f83c7c88c5 nodedev: Move the sysfs-related cap handling to node_device_conf.c
The capabilities are defined/parsed/formatted/queried from this module,
no reason for 'update' not being part of the module as well. This also
involves some module-specific prefix changes.
This patch also drops the node_device_linux_sysfs module from the repo
since:
a) it only contained the capability handlers we just moved
b) it's only linked with the driver (by design) and thus unreachable to
other modules
c) we touch sysfs across all the src/util modules so the module being
deleted hasn't been serving its original intention for some time already.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2018-01-29 15:34:30 +01:00
Martin Kletzander
a64c761c27 resctrl: Add functions to work with resctrl allocations
With this commit we finally have a way to read and manipulate basic resctrl
settings.  Locking is done only on exposed functions that read/write from/to
resctrlfs.  Not in functions that are exposed in virresctrlpriv.h as those are
only supposed to be used from tests.

More information about how resctrl works:

  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/x86/intel_rdt_ui.txt

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2018-01-25 17:16:08 +01:00
Andrea Bolognani
5e07b28a7a util: Print architecture name in /proc/cpuinfo parser
Instead of a generic "your architecture", print the actual
architecture name.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
2018-01-08 13:48:44 +01:00
Daniel P. Berrange
917047de61 Update to latest keycodemapdb content
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-12-12 16:34:12 +00:00
Dawid Zamirski
0eda09f490 vbox: Add support for 5.2.x
Simply add the 5.2 SDK header to the existing unified framework. No
other special handling is needed as there's no API break between
existing 5.1 and the just added 5.2.
2017-11-09 17:09:41 -05:00
Andrea Bolognani
3e7db8d3e8 Remove backslash alignment attempts
Right-aligning backslashes when defining macros or using complex
commands in Makefiles looks cute, but as soon as any changes is
required to the code you end up with either distractingly broken
alignment or unnecessarily big diffs where most of the changes
are just pushing all backslashes a few characters to one side.

Generated using

  $ git grep -El '[[:blank:]][[:blank:]]\\$' | \
    grep -E '*\.([chx]|am|mk)$$' | \
    while read f; do \
      sed -Ei 's/[[:blank:]]*[[:blank:]]\\$/ \\/g' "$f"; \
    done

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2017-11-03 13:24:12 +01:00
Wim ten Have
6c200c76f1 build: isolate core libvirt libs deps from xen runtime
Generating libvirt packages per make rpm, "with-libxl=1" and "with-xen=1",
adds strict runtime dependencies per libxenlight for xen-libs package from
core libvirt-libs package.  This is not necessary and unfortunate since
those dependencies set demand to "xen-libs" package even when there's no
need for libvirt xen or libxl driver components.

This patch is to have two separate xenconfig lib tool libraries: one for
core libvirt (without XL), and a another that contains xl for libxl driver
(libvirt_driver_libxl_impl.la) which when loading the driver, loads the
remaining symbols (xen{Format,Parse}XL. For the user/sysadmin, this means
the xen dependencies are moved into libxl driver, instead of core libvirt.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Wim ten Have <wim.ten.have@oracle.com>
Reviewed-by:   Jim Fehlig <jfehlig@suse.com>
2017-10-06 10:21:37 -06:00
Daniel P. Berrange
c120ce1609 Link libvirt_util.la with gnutls
The util/vircrypto.c file uses gnutls, so we must directly link
libvirt_util.la with gnutls to avoid errors on OS which do not
resolve symbols against indirectly linked libraries.

This fixes a build failure on Ubuntu Trusty

  CCLD     storagevolxml2argvtest
/usr/bin/ld: ../src/.libs/libvirt_util.a(libvirt_util_la-vircrypto.o): undefined reference to symbol 'gnutls_strerror@@GNUTLS_1_4'

//usr/lib/x86_64-linux-gnu/libgnutls.so.26: error adding symbols: DSO missing from command line

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-09-20 09:40:53 +01:00