Commit Graph

332 Commits

Author SHA1 Message Date
Michal Privoznik
09da661006 virt-nss: Introduce more checks before enabling NSS
The plugin depends on more modules than we currently check for,
i.e. network driver and yajl library.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2017-01-02 13:25:42 +01:00
Andrea Bolognani
e64f2fab92 m4/virt-arg: Rename LIBVIRT_ARG_WITH* macros
LIBVIRT_ARG_WITH_ALT is more generic than LIBVIRT_ARG_WITH, which
is tailored at switching features on and off.

Rename the macros according to their intended purpose, and add
some documentation to help developers pick between the two.
2016-12-22 15:20:05 +01:00
Andrea Bolognani
bd4255680d m4/virt-arg: Move LIBVIRT_ARG_* macros to their own file
They're not just used, or supposed to be just used, for
library-related arguments, so they deserve to have their
own separate file.
2016-12-22 15:20:05 +01:00
Pavel Hrdina
aac34eca90 m4/virt-gnutls: properly backup CFLAGS and LIBS for AC_CHECK_* macros
Commit 943ddcb712 partially fixed this bug in gnutls configure code.
However we also need to backup and modify CFLAGS and do if for
AC_CHECK_HEADERS as well.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-22 14:14:40 +01:00
Pavel Hrdina
ba5d9dd476 m4/virt-gnutls: use AC_CHECK_FUNCS to detect availability of functions
Sigh, autoconf has AC_CHECK_FUNC and AC_CHECK_FUNCS and both check
whether some function exists or not.  However in addition to the obvious
difference that the later is able to check multiple functions it also
defines HAVE_FUNCTION_NAME for each function.

Commit 680d2f49da moved the code to separate file, but also blindly
changed the macro to AC_CHECK_FUNC without confronting the
documentation.

Reported-by: John Ferlan <jferlan@redhat.com>

<https://www.redhat.com/archives/libvir-list/2016-December/msg01086.html>

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-22 10:30:10 +01:00
Pavel Hrdina
513824a8be m4/virt-lib: use correct format of package name for AC_ARG_* macros
Introduced by commit 25034b3c40 and reused by commit 4519e94b74.
This patch silences warning printed by configure:

  configure: WARNING: unrecognized options: --with-qemu-user

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 22:24:55 +01:00
Pavel Hrdina
83390dac2f m4/virt-loader-nvram: use quotation for list of loader:nvram pairs
The bug was introduced by commit 08c2d1480b.  The string must be quoted
because it is used as function argument.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 21:29:30 +01:00
Pavel Hrdina
decce786a3 configure: move storage ZFS check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:43 +01:00
Pavel Hrdina
ef386bf7a2 configure: move storage Gluster check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:43 +01:00
Pavel Hrdina
9a9073a132 configure: move storage Sheepdog check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:43 +01:00
Pavel Hrdina
173f8a2f7b configure: move storage RBD check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:43 +01:00
Pavel Hrdina
dfa5820b67 configure: move storage disk check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:43 +01:00
Pavel Hrdina
c5241454dd configure: move storage mpath check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:43 +01:00
Pavel Hrdina
0a5af1b93c configure: move storage SCSI check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:43 +01:00
Pavel Hrdina
9290a748e9 configure: move storage iSCSI check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:43 +01:00
Pavel Hrdina
ed46a79213 configure: move storage LVM check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:43 +01:00
Pavel Hrdina
61418e5584 configure: move storage fs check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:43 +01:00
Pavel Hrdina
9f092db85a configure: move storage dir check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:42 +01:00
Pavel Hrdina
2700764acc configure: move AppArmor secdriver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:42 +01:00
Pavel Hrdina
2caf4d6cdf configure: move SELinux secdriver check into its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:42 +01:00
Pavel Hrdina
01463beb79 configure: move parallels version definition to m4/virt-driver-vz
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:42 +01:00
Pavel Hrdina
66611879f1 configure: move interface driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:42 +01:00
Pavel Hrdina
bdfb892ba8 configure: move network driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:42 +01:00
Pavel Hrdina
13b238dc86 configure: move libvirtd driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:42 +01:00
Pavel Hrdina
35d07e3da5 configure: move Hyper-V driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:42 +01:00
Pavel Hrdina
ceb2e03912 configure: move ESX driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:42 +01:00
Pavel Hrdina
572e79df7e configure: move vbox driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:42 +01:00
Pavel Hrdina
5f1ace8e38 configure: move remote driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:42 +01:00
Pavel Hrdina
da2cef55b2 configure: move test driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:42 +01:00
Pavel Hrdina
8577d4a049 configure: move PHYP driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:41 +01:00
Pavel Hrdina
12050cf11c m4/virt-driver-xenapi: use LIBVIRT_CHECK_LIB macro
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:41 +01:00
Pavel Hrdina
02957106a0 configure: move XenAPI driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:41 +01:00
Pavel Hrdina
7f0caf57cc m4/virt-libxl: cleanup storing CFLAGS and LIBS variables
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:41 +01:00
Pavel Hrdina
5767a2da4b m4/virt-libxl: properly check for required libxl version
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:41 +01:00
Pavel Hrdina
2620fa178d m4/virt-libxl: use LIBVIRT_CHECK_(PKG|LIB) macros
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:41 +01:00
Pavel Hrdina
9dcfa182a2 configure: move libxl driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:41 +01:00
Pavel Hrdina
10ecd90213 configure: move XEN driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:41 +01:00
Pavel Hrdina
07b1d80a2a configure: move LXC driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:41 +01:00
Pavel Hrdina
68649d1007 configure: move qemu bridge helper check to qemu driver file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:41 +01:00
Pavel Hrdina
3138d6993e configure: move qemu privileges check to qemu driver file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:41 +01:00
Pavel Hrdina
32af9539a3 configure: move QEMU driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:41 +01:00
Pavel Hrdina
6827072857 configure: move VMware driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:41 +01:00
Pavel Hrdina
c0c7fdaf24 configure: move OpenVZ driver check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:41 +01:00
Pavel Hrdina
eea1d6dc90 configure: move debug check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:40 +01:00
Pavel Hrdina
7d55c6003c configure: move xml catalog file check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:40 +01:00
Pavel Hrdina
634cf2bb1e configure: move TLS priority check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:40 +01:00
Pavel Hrdina
fcdcb7353e configure: move default editor check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:40 +01:00
Pavel Hrdina
a26ed14a4a configure: move loader/nvram check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:40 +01:00
Pavel Hrdina
b1b9d15a05 configure: move chrdev lock files check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:40 +01:00
Pavel Hrdina
24ef6bccfb configure: move sysctl config check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:40 +01:00
Pavel Hrdina
a02992a246 configure: move numad check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:40 +01:00
Pavel Hrdina
1dec40f870 configure: move DTrace check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:40 +01:00
Pavel Hrdina
b51714bd05 m4/virt-parted: use LIBVIRT_CHECK_PKG
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:40 +01:00
Pavel Hrdina
597efd7a26 configure: move libparted check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:40 +01:00
Pavel Hrdina
60af91ca85 m4/virt-devmapper: use LIBVIRT_CHECK_(PKG|LIB)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:39 +01:00
Pavel Hrdina
f1a7a624d0 configure: move devmapper check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:39 +01:00
Pavel Hrdina
71844322a4 configure: move pm-utils check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:39 +01:00
Pavel Hrdina
9461a9f94b configure: move nwfilter check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:39 +01:00
Pavel Hrdina
ed4cae50da configure: move windres check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:39 +01:00
Pavel Hrdina
349727dc46 configure: move windows symbols check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:39 +01:00
Pavel Hrdina
4675c6dd36 configure: move MinGW check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:39 +01:00
Pavel Hrdina
e62541be0f configure: move Cygwin check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:39 +01:00
Pavel Hrdina
9587319333 configure: move windows common check to its own file
This renames MSCOM_LIBS to WIN32_EXTRA_LIBS to make it consistent with
WIN32_EXTRA_CFLAGS.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:39 +01:00
Pavel Hrdina
21b3f33978 configure: move libnl check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:39 +01:00
Pavel Hrdina
994fe998b7 configure: move virtualport check to its own file
This patch moves the virtualport result out of *Driver* section because
it's not a driver.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:39 +01:00
Pavel Hrdina
e0a39ba09d configure: move macvtap check to its own file
This patch moves the macvtap result out of *Driver* section because
it's not a driver.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:39 +01:00
Pavel Hrdina
604f6ef85f m4/virt-libpcap: error out if asked for libpcap but it was not found
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:39 +01:00
Pavel Hrdina
368e143a1c m4/virt-libpcap: remove unreasonable dependency on QEMU
Libpcap is used by nwfilter driver and it could be build without QEMU
driver.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:38 +01:00
Pavel Hrdina
41872ffade configure: move libpcap check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:38 +01:00
Pavel Hrdina
438c8c1626 configure: move XDR check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:38 +01:00
Pavel Hrdina
e18108acb4 configure: move atomic check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:38 +01:00
Pavel Hrdina
9a9623a68a configure: move pthread check it its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:38 +01:00
Pavel Hrdina
5b2d616c9e configure: move polkit check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:38 +01:00
Pavel Hrdina
00125bdf58 configure: move firewalld check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:38 +01:00
Pavel Hrdina
aee0043bd7 configure: move with-driver-modules check to its own file
Rename DRIVER_MODULE_(LDFLAGS|LIBS|CFLAGS) to unify the naming.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:38 +01:00
Pavel Hrdina
a811e45824 configure: move dlopen check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:38 +01:00
Pavel Hrdina
71cf49b774 m4/virt-libxml: use LIBVIRT_CHECK_PKG
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:38 +01:00
Pavel Hrdina
46ccbea870 m4/virt-libxml: use only pkg-config to check for libxml2
Pkg-config file libxml-2.0.pc was introduced in libxml2-2.2.4 and we
require at least 2.6.0 so the crazy xml2-config check can be dropped.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:38 +01:00
Pavel Hrdina
4c71c20eff configure: move libxml check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:38 +01:00
Pavel Hrdina
4565980313 m4/virt-lib: add new parameter to override default fail action
This allows to use two or more LIBVIRT_CHECK_(LIB|LIB_ALT|PKG) macros
for one library.  For example, when we check for existence of
pgk-config file of some library and we know that not all versions of
that library that libvirt requires provides this file, we can fallback
to use library check.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:38 +01:00
Pavel Hrdina
eeccee1870 m4/virt: introduce LIBVIRT_ARG_* macros for all library checks
Usage of AC_REQUIRE will mess with order how LIBVIRT_CHECK_* macros
are composed into configure.ac.  This ensures that the output of
configure --help is properly ordered and grouped into sections.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:37 +01:00
Pavel Hrdina
e03d43714a m4/virt-lib: move LIBVIRT_ARG_WITH out of LIBVIRT_CHECK_(LIB|LIB_ALT|PKG)
Following patch will update LIBVIRT_CHECK_(LIB|LIB_ALT|PKG) macros in
a way that you will be able to call a another macro as a fallback if
the first one fails.  To allow that, we need to move the
LIBVIRT_ARG_WITH out of those macro to not have two or more same lines
in output of "configure --help".

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:37 +01:00
Pavel Hrdina
ca01aeb57f configure: use LIBVIRT_ARG_ENABLE macro
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:37 +01:00
Pavel Hrdina
08c2d1480b configure: use LIBVIRT_ARG_WITH(_ALT) macros
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:37 +01:00
Pavel Hrdina
7f1e6e9d5a m4/virt-lib: introduce LIBVIRT_ARG_ENABLE macro
This macro helps create unified output of "configure --help".

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:37 +01:00
Pavel Hrdina
4519e94b74 m4/virt-lib: introduce LIBVIRT_ARG_WITH(_ALT) macro
These macros help create unified output of "configure --help".

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:37 +01:00
Pavel Hrdina
ec1a663195 m4/virt: use LIBVIRT_RESULT macro instead of AC_MSG_NOTICE
The LIBVIRT_RESULT does a nice formatting of the output and ensures
that the format is unified.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:37 +01:00
Pavel Hrdina
c093fb1fdc m4/virt: create result macros for the remaining virt check
All checks that prints result at the end of configure uses
LIBVIRT_RESULT_${CHECK_NAME}.  Create those macros for remaining check.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:37 +01:00
Pavel Hrdina
90d376a75a configure: move external programs check to its own file
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:37 +01:00
Pavel Hrdina
5bacfec2da m4/virt-netcf: fix bug where we overwrite LIBS
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-21 15:39:37 +01:00
Pavel Hrdina
d3f851c516 m4/virt-lib: properly pass header_name in LIBVIRT_CHECK_LIB(_ALT)
The *header_name* cannot be quoted, otherwise it is not translated to
the passed argument.  Without this fix the generated configure contains
*ac_cv_header_header_name*, but there should be for example
*ac_cv_header_sals_sasl_h* for "sasl/sasl.h".

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-12-07 16:21:31 +01:00
Nikos Mavrogiannopoulos
943ddcb712 virt-gnutls.m4: fixed check for gnutls_rnd and gnutls_cipher_encrypt 2016-11-30 14:29:46 +00:00
Pino Toscano
6917467c2b libssh_transport: add new libssh-based transport
Implement a new libssh transport, which uses libssh to communicate with
remote hosts, and add all the build system stuff (search of libssh,
private symbols, etc) to built it.

This new transport supports all the common ssh authentication methods,
making use of libvirt's auth callbacks for interaction with the user.
2016-11-15 15:50:51 +01:00
Andrea Bolognani
7b3b254063 wireshark: Use ${exec_prefix} instead of ${prefix}
${exec_prefix} and ${prefix} point to the same directory in
most setups, but when that's not the case the former should
be used for architecture-dependent data such as shared objects,
which makes it the best fit for our Wireshark dissector.

While at it, change all uses of $(var) to ${var}: they are
absolutely identicaly as far as make's concerned, but autoconf
itself seems to prefer the latter form so we might as well
follow suit.
2016-11-07 10:16:06 +01:00
Andrea Bolognani
054fd1a7d0 wireshark: Make fallback path construction more reliable
We only need to strip $ws_prefix from $ws_plugindir if we've
retrieved it from pkg-config: if we're building it ourselves
from $libdir, we can just use it without further processing.
2016-11-07 10:16:06 +01:00
Pavel Hrdina
a55fdc3f25 configure: check gnutls related stuff only if gnutls was found
This fixes a build issue with old gnutls.
Broken by commit 680d2f49da.

Reported-by: Olga Krishtal <okrishtal@virtuozzo.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-11-03 15:45:16 +01:00
Pavel Hrdina
0c62ccf927 m4/virt-gnutls: remove code for gnutls < 2.2.0
Commit d8a8af3492 changed the minimal required version of gnutls
so it's safe to remove the code for older versions.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-11-02 10:19:09 +01:00
Pavel Hrdina
680d2f49da configure: move gnutls check into virt-gnutls.m4
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-11-02 10:19:09 +01:00
Andrea Bolognani
3cbf054995 wireshark: Rename plugindir to ws_plugindir
Since we're using autoconf to substitute the right value in
Makefile.am now, we can use a less generic name without running
into circular dependencies.
2016-10-26 17:00:21 +02:00
Andrea Bolognani
c587c73549 wireshark: Inject $(prefix) at the right time
Adding $(prefix) in Makefile.am, as we were doing, means that
it would be prepended even when using --with-ws-plugindir,
which is something we don't want to happen.

Instead, we add it beforehand but take care that it doesn't
get expanded until make is called.
2016-10-26 17:00:21 +02:00
Andrea Bolognani
debf2f0b8a wireshark: Strip prefix correctly
Even when we're building $plugindir ourselves because we can't
retrieve it using pkg-config, we still want to strip the prefix,
except in that case it would be the same prefix we're using for
building libvirt.

The fact that $plugindir is missing also doesn't tell us
anything about $ws_prefix, so we have to handle the two variables
separately.
2016-10-26 17:00:21 +02:00
Andrea Bolognani
c64a0a8e32 wireshark: Hoist $ws_prefix declaration
Keep all variable declarations close together.
2016-10-26 17:00:21 +02:00
Andrea Bolognani
182517013e wireshark: Introduce $ws_modversion
Use a separate variable instead of setting it inline for
slightly cleaner code.
2016-10-26 17:00:20 +02:00
Michal Privoznik
35e45760ee virt-wireshark.m4: Defer $(prefix) substitution
The autoconf manual says we shouldn't be using this variable (and
some others) outside of Makefiles as it prevents users providing
their own prefix at the installation phase.

https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Installation-Directory-Variables.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-10-21 09:27:33 +08:00
Andrea Bolognani
a0da41349c m4: Drop PKG_PROG_PKG_CONFIG compatibility code
This was needed for RHEL 4 vintage distributions, which we
haven't supported for a long time now.
2016-10-06 17:36:05 +02:00
Martin Kletzander
36e73cb70b virt-yajl: Fix detection of yajl requirements
Running the output of qemu -help doesn't make any sense.  We should be
looking for libvirt being mentioned in the output.  This worked by
accident, let's make it work as expected it to.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-10-06 13:35:42 +02:00
Michal Privoznik
2bca7cec0b m4: Check for sanlock_write_lockspace
Currently, we are checking for sanlock_add_lockspace_timeout
which is good for now. But in a subsequent patch we are going to
use sanlock_write_lockspace (which sets an initial value for io
timeout for sanlock). Now, there is no reason to check for both
functions in sanlock library as the sanlock_write_lockspace was
introduced in 2.7 release and the one we are currently checking
for in the 2.5 release. Therefore it is safe to assume presence
of sanlock_add_lockspace_timeout when sanlock_write_lockspace
is detected.

Moreover, the macro for conditional compilation is renamed to
HAVE_SANLOCK_IO_TIMEOUT (as it now encapsulates two functions).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-09-29 16:59:11 +02:00
Michal Privoznik
5c2bc001a2 virt-wireshark: Properly substract wireshark prefix
So, when building wireshark plugin, we get the plugindir variable
from the wireshark.pc as well as prefix. Then we replace the
prefix in the plugindir with our own prefix where libvirt is
building to:

  plugindir="${prefix}${plugindir#ws_prefix}"

However, as you can see, there's '$' missing in front of the
ws_prefix variable. This results in the mangled plugindir, for
instance like this:

  plugindir='/usr/usr/lib64/wireshark/plugins'

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-07-27 17:01:18 +02:00
Fabian Freyer
b436a8ae5c gnulib: add getopt module
Unconditionally use gnulib's getopt module. This is needed by the bhyve driver
to provide a reentrant interface for getopt.

Several gnulib headers rely on features.h being included by ctype.h to provide
__GNUC_PREREQ, but on systems without glibc, this is not provided. In these
cases __GNUC_PREREQ gets redefined to 0, which causes build errors from checks
in src/internal.h.
Therefore, define __GNUC_PREREQ as early as possible. config-post.h is probably
the first header that is included, before any other headers.
2016-07-10 15:39:44 -04:00
Roman Bogorodskiy
a5059b9b02 virt-login-shell: mark as Linux only
Currently, virt-login-shell is not allowed to build on Windows.
However, as it's designed around LXC, it does not make sense to
build it on anything but Linux, so make the check stricter and allow to
enable it on Linux only.
2016-06-13 12:51:17 +03:00
Daniel P. Berrange
c0bc172383 systemd: directly notify systemd instead of using sd_notify
The sd_notify method is used to tell systemd when libvirtd
has finished starting up. All it does is send a datagram
containing the string parameter to systemd on a UNIX socket
named in the NOTIFY_SOCKET environment variable. Rather than
pulling in the systemd libraries for this, just code the
notification directly in libvirt as this is a stable ABI
from systemd's POV which explicitly allows independant
implementations:

See "Reimplementable Independently" column in the
"$NOTIFY_SOCKET Daemon Notifications" row:

https://www.freedesktop.org/wiki/Software/systemd/InterfacePortabilityAndStabilityChart/

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1314881

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-06-07 09:37:57 +01:00
Roman Bogorodskiy
4a5f8669cc uml: only build on Linux 2016-05-10 07:42:35 +03:00
Roman Bogorodskiy
f1f08e63c6 configure: split out UML driver checks
Move all the UML driver related routines into m4/virt-driver-uml.m4.
2016-05-10 07:42:30 +03:00
Andrea Bolognani
801a0a57ba configure: Remove nested conditionals in LIBVIRT_CHECK_INIT_SCRIPT
We don't need them any longer; moreover, the previous structure
made it very easy for bugs to slip in, by having the result of one
check influence the following one.

By placing the check for "$with_init_script" = check front and
center, hopefully this won't happen (as easily) again.
2016-05-03 16:10:43 +02:00
Andrea Bolognani
8a38f96487 configure: Change RHEL default from systemd+redhat to systemd
We don't want to install legacy init scripts on modern,
systemd-native hosts.
2016-05-03 16:10:43 +02:00
Andrea Bolognani
6620cd1efc configure: Introduce LIBVIRT_{CHECK,RESULT}_INIT_SCRIPT
Move the code dealing with init scripts to a separate file
so configure.ac itself can be a little bit smaller.
2016-05-02 17:18:05 +02:00
Michal Privoznik
dc3002b46c wireshark: Fix distcheck
Our distcheck is broken. Well, it works but only by pure chance.
When wireshark plugin is enabled, we try to query which path
should the plugin be installed into. Firstly, we try to ask
pkg-config as some releases of wireshark already sets
corresponding variable in their pkg-config files. However, if we
obtained no value from there we try to construct the path on our
own. Based on our observations it usually is:
$libdir/wireshark/plugins/$version/.
Now, the problem is in the way we are deciding whether we have
obtained the plugin directory from pkg-config or not. Simply
said, we are checking wrong variable. The variable we are
checking has never been set, thus in our test is empty and
therefore we will always construct the plugin dir path on our
own, regardless of its presence in the pkg-config file.
To make things worse, after fixing this problem, VPATH build was
broken as it now tried to install plugin into correct directory.
Yes, this is problem, because --prefix was not honoured and
everything but the plugin was installed into given prefix. I've
managed to resolve this issue by replacing plugin dir prefix with
our own. So when doing regular installation (our prefix ==
wireshark prefix), nothing changes. When doing VPATH build &
installation plugin is installed into correctly prefixed dir.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-04-25 18:56:48 +02:00
Andrea Bolognani
edebc16607 configure: Make virt-host-validate optional
virt-host-validate, just like virt-login-shell, doesn't make sense
on Windows, so we should avoid building it.

Make the tool optional and build it by default on all platforms
except Windows, erroring out if the user attempts to build it
anyway.
2016-04-13 10:06:29 +02:00
Pavel Hrdina
d713a6b120 build: add GCC 6.0 -Wlogical-op workaround
fdstream.c: In function 'virFDStreamWrite':
fdstream.c:390:29: error: logical 'or' of equal expressions [-Werror=logical-op]
        if (errno == EAGAIN || errno == EWOULDBLOCK) {
                            ^~

Fedora rawhide now uses gcc 6.0 and there is a bug with -Wlogical-op
producing false warnings.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602

Use GCC pragma push/pop and ignore -Wlogical-op for GCC that supports
push/pop pragma and also has this bug.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-04-11 12:09:14 +02:00
Pavel Hrdina
7fb81831fc build: cleanup GCC < 4.6 -Wlogical-op workaround
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-04-11 12:09:11 +02:00
Andrea Bolognani
ccf58bd72a configure: Fix check for --with-login-shell on Windows
The check is supposed to stop users from trying to compile
virt-login-shell on Windows by erroring out during the
configure phase; however, there are two flaws in it:

  * the value of "x$with_win" is compared to "yes" instead
    of "xyes" (note the "x" in the first string)

  * "test" is not being used, so the script will actually
    try to run a command called "x$with_win" instead of
    performing string comparison

This patch fixes both issues.
2016-04-11 09:02:49 +02:00
Roman Bogorodskiy
7572a3e2ec nss: fix typo in configure help string
Servie -> Service
2016-04-09 07:52:33 +03:00
Roman Bogorodskiy
45408cd892 nss: FreeBSD support
* tools/nss/libvirt_nss.[ch]: add BSD-comptabile wrappers and
   register via the nss_module_register() interface
 * m4/virt-nss.m4: add checks if we're building NSS for FreeBSD
 * tools/Makefile.am: handle target library name differences, as
   Linux needs libnss_libvirt.so.2 and FreeBSD needs
   nss_libvirt.so.1. Also, different syms files have to be used
   as Linux needs to export all the methods while FreeBSD
   only needs to have nss_module_register()
 * tests/nsstest.c, tests/nssmock.c: s/__linux__/NSS/
 * tests/nssmock.c: pass int instead of mode_t to va_arg() to please
   gcc 4.8
 * libvirt_nss_bsd.syms: FreeBSD syms file
2016-03-30 10:21:44 +03:00
Michal Privoznik
859cb18d54 Initial support for NSS plugin skeleton
Name Service Switch is a glibc feature responsible for many
things. Translating domain names into IP addresses and vice versa
is just one of them. However, currently it's the only
functionality that this commit is tickling. Well, in this commit
the plugin skeleton is introduced. Implementation to come in next
patches.
Because of the future testing, where the implementation is to be
linked with a test, this needs to go into static library. Linking
a program with an .so statically is not portable. Therefore a
dummy libnss_libvirt_impl library is being introduced too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-03-18 17:29:53 +01:00
Eric Blake
5ea3a690a2 build: accomodate selinux 2.5 header API change
Yet again, selinux has been adding const-correctness; this change
is ABI-compatible, but breaks API, which affects us when we try to
override things in our testsuite:

../../tests/securityselinuxhelper.c:307:24: error: conflicting types for 'selabel_open'
 struct selabel_handle *selabel_open(unsigned int backend,
                        ^~~~~~~~~~~~
In file included from ../../tests/securityselinuxhelper.c:32:0:
/usr/include/selinux/label.h:73:24: note: previous declaration of 'selabel_open' was here

The problem is a new 'const' prior to the second parameter.

Fix it the same way we did in commit 292d3f2d: check for the new
const at configure time.

Signed-off-by: Eric Blake <eblake@redhat.com>
2016-02-24 15:14:30 -07:00
Martin Kletzander
d498a89950 Fix '-pie' build with clang
Commit 97e70a5935 added the option -pie to
CFLAGS and LDFLAGS, however '-pie' is just a linker option.  That
wouldn't be a problem.  However, clang is checking for that and outputs
an error or unused argument:

error: argument unused during compilation: '-pie'

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-02-09 13:29:53 +01:00
Michal Privoznik
50078cfbcb wireshark: Install into DESTDIR
Like everything we install, it should be prefixed with DESTDIR.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-01-12 18:51:38 +01:00
Michal Privoznik
7bf3c13d9c tools: Disable virt-login-shell on mingw
So, after bec787ee9d we are building virt-login-shell
independent of LXC driver. This is nice, but the binary is
enabled by default which makes no sense on mingw. In fact, it
triggers some compilation errors there:

  CC       virt_login_shell-virt-login-shell.o
../../tools/virt-login-shell.c: In function 'main':
../../tools/virt-login-shell.c:289:15: error: implicit declaration of function 'sysconf' [-Werror=implicit-function-declaration]
     openmax = sysconf(_SC_OPEN_MAX);
               ^
../../tools/virt-login-shell.c:289:5: error: nested extern declaration of 'sysconf' [-Werror=nested-externs]
     openmax = sysconf(_SC_OPEN_MAX);
     ^
../../tools/virt-login-shell.c:289:23: error: '_SC_OPEN_MAX' undeclared (first use in this function)
     openmax = sysconf(_SC_OPEN_MAX);
                       ^
../../tools/virt-login-shell.c:289:23: note: each undeclared identifier is reported only once for each function it appears in
cc1: all warnings being treated as errors

While we could workaround sysconf(_SC_OPEN_MAX) issue, the binary
itself makes no sense on systems where no LXC can be spawned.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-12-24 18:03:50 +01:00
Cédric Bosdonnat
bec787ee9d Allow building lxc without virt-login-shell
Add a configure option to disable virt-login-shell build even if lxc is
enabled.
2015-12-17 15:49:06 +01:00
Michal Privoznik
bd3e16a3cf locking: Add io_timeout to sanlock
https://bugzilla.redhat.com/show_bug.cgi?id=1251190

So, if domain loses access to storage, sanlock tries to kill it
after some timeout. So far, the default is 80 seconds. But for
some scenarios this might not be enough. We should allow users to
adjust the timeout according to their needs.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-11-18 10:56:56 +01:00
Michal Privoznik
7c8250d765 wireshark: Install to generic plugin directory
There has been a report on the list [1] that we are not
installing the wireshark dissector into the correct plugin
directory. And in fact we are not. The problem is, the plugin
directory path is constructed at compile time. However, it's
dependent on the wireshark version, e.g.

  /usr/lib/wireshark/plugins/1.12.6

This is rather unfortunate, because if libvirt RPMs were built
with one version, but installed on a system with newer one, the
plugins are not really loaded. This problem lead fedora packagers
to unify plugin path to:

  /usr/lib/wireshark/plugins/

Cool! But this was enabled just in wireshark-1.12.6-4. Therefore,
we must require at least that version.

And while at it, on some distributions, the wireshark.pc file
already has a variable that defines where plugin dir is. Use that
if possible.

1: https://www.redhat.com/archives/libvirt-users/2015-October/msg00063.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-10-29 13:55:06 +01:00
Michal Privoznik
541a99cc8a virt-driver-vz: Require parallels-7.0.22 at least
With the latest patch to the vz driver (7d73ca06ce) I was
getting some compilation errors. It turned out, my installation
of the parallels SDK was not as fresh as it could be. Parallels
installed in my system were missing the
PRL_USE_VNET_NAME_FOR_BRIDGE_NAME symbol which simply was not
introduced at the time I was installing the SDK. The symbol was
introduced in 86e62a5d which was then part of the 7.0.22 release.
Require that version at least therefore.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-07-13 19:46:10 +03:00
Michal Privoznik
09040915c5 configure: Move Virtuozzo checks to a specific module
Eventually, every driver will be moved to a special module.
But for today the winner is Virtuozzo driver.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-07-13 19:46:10 +03:00
Eric Blake
3502f79198 maint: update to latest gnulib
Time to update to new gnulib before a release.

gcc 5.1 introduced a new -Wformat-signedness, and new gnulib now
turns it on by default.  However, it is still rather lame at the
moment, because it warns for enums, even though there is no way
to control the signeness of an enum which does not use any members
that are negative or larger than INT_MAX, and even though such an
enum would always print the same for both %d and %u:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66249

In file included from ../../src/util/virarch.c:26:0:
../../src/util/virarch.c: In function 'virArchFromHost':
../../src/util/virarch.c:180:15: error: format '%d' expects argument of type 'int', but argument 9 has type 'unsigned int' [-Werror=format=]
     VIR_DEBUG("Mapped %s to %d (%s)",

So this patch turns off the new warning as part of enabling all
other new gcc 5.1 warnings that gnulib now enables.

* .gnulib: Update to latest, in part for gcc 5.1 interaction.
* m4/virt-compile-warnings.m4: Ignore -Wformat-signedness, for now.

Signed-off-by: Eric Blake <eblake@redhat.com>
2015-05-26 10:53:12 -06:00
Roman Bogorodskiy
97e70a5935 maint: extend PIE support check
GCC installed from FreeBSD ports doesn't support building PIE executables
and fails with:

/usr/local/bin/ld: /usr/lib/crt1.o: relocation R_X86_64_32 against
`_DYNAMIC' can not be used when making a shared object; recompile with
-fPIC
/usr/lib/crt1.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

However, the configure check for '-fPIC -DPIC' doesn't catch that. In
order to catch this case, add '-pie' to CFLAGS in m4/virt-compile-pie.m4
so it could detect lack of PIE support on configure time and don't fail
the build.
2015-05-11 20:08:47 +03:00
Pavel Hrdina
373973206a rpm-build: use pkg-config to detect wireshark presence
Wireshark supports pkg-config since 1.11.3.  Right now we build
wireshark-dissectior tool as default trough rpm build only on
fedora >= 21 and there is new wireshark that supports pkg-config.
If someone wants to build libvirt with wireshark-dissector against old
wireshark, they should specify the location by hand.

This patch is mainly to fix wrong dependency on wireshark binary as it
doesn't make sense to require that binary file to just get version info
of that package in makefile.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-03-16 22:58:54 +01:00
Daniel P. Berrange
87fa184910 Conditionalize use of -Wno-suggest-attribute=format pragma
Many GCC versions don't understand -Wno-suggest-attribute=format
so the pragma must only be used when supported
2015-01-16 17:12:27 +00:00
Daniel P. Berrange
a93a3b975c avoid using deprecated udev logging functions
In systemd >= 218, the udev_set_log_fn method has been marked
deprecated and turned into a no-op. Nothing in the udev client
library will print to stderr by default anymore, so we can
just stop installing a logging hook for new enough udev.
2014-12-15 18:08:45 +00:00
Eric Blake
c0e7022161 build: fix build with older dbus headers
Compilation on a RHEL 5 host failed, due to the older dbus headers
present on that machine, and triggered by commit 2aa167ca:

util/virdbus.c: In function 'virDBusMessageIterDecode':
util/virdbus.c:952: error: 'DBusBasicValue' undeclared (first use in this function)

* m4/virt-dbus.m4 (LIBVIRT_CHECK_DBUS): Check for DBusBasicValue.
* src/util/virdbuspriv.h (DBusBasicValue): Provide fallback.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-11-20 06:41:53 -07:00
Ján Tomko
046a441f3d build: prefer -fstack-protector-strong to -all
Try -fstack-protector-strong first on Linux. If that fails,
fall back to -fstack-protector-all.
2014-06-12 08:16:03 +02:00
Ján Tomko
5567baa973 build: remove ssp-buffer-size
This option only makes sense for -fstack-protector.
With -fstack-protector-all or -fstack-protector-strong,
functions are protected regardless of buffer size.

https://bugzilla.redhat.com/show_bug.cgi?id=1105456
2014-06-12 08:16:03 +02:00
Ján Tomko
fa3519cbe5 build: remove duplicit warning suppression
These warnings have already been added to $dontwarn.
2014-06-12 08:15:54 +02:00
Peter Krempa
df01390afc m4: bhyve: Fix check for the required bhyve programs
bhyveload and bhyvectl wouldn't be checked otherwise as the configure
script wouldn't execute one of the tests:

checking for bhyve... /usr/local/sbin/bhyve
checking for bhyvectl... /usr/local/sbin/bhyvectl
checking for bhyveload... /usr/local/sbin/bhyveload
./configure: line 62602: test: too many arguments

Fix the shell statement testing the 3 binaries.
2014-06-09 09:40:25 +02:00
Michal Privoznik
9e0cbcd888 virnuma: Check for numa_bitmask_isbitset presence
On some systems, libnuma can be present but it's so ancient that
it misses some symbols that virNumaGetDistances() needs. To be
more precise: numa_bitmask_isbitset() and numa_nodes_ptr are the
symbols in question. Fortunately, they were both introduced in
the same release so it's sufficient for us to check for only one
of them. And the winner is numa_bitmask_isbitset().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-06-04 16:06:51 +02:00
Eric Blake
5fa10f3208 maint: fix typo in previous patch
Use correct variable name.

* m4/virt-selinux.m4: Fix one last variable name.
2014-05-28 20:01:57 -06:00
Jim Fehlig
b109c09765 maint: cleanup detection of const'ness of selinux ctx
Commit 292d3f2d fixed the build with libselinux 2.3, but missed
some suggestions by eblake

https://www.redhat.com/archives/libvir-list/2014-May/msg00977.html

This patch changes the macro introduced in 292d3f2d to either be
empty in the case of newer libselinux, or contain 'const' in the
case of older libselinux.  The macro is then used directly in
tests/securityselinuxhelper.c.
2014-05-28 16:52:48 -06:00
Cédric Bosdonnat
292d3f2d38 build: fix build with libselinux 2.3
Several function signatures changed in libselinux 2.3, now taking
a 'const char *' instead of 'security_context_t'.  The latter is
defined in selinux/selinux.h as

  typedef char *security_context_t;

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-05-28 12:17:04 -06:00
Eric Blake
25034b3c40 build: use --with-systemd-daemon as configure option
Commit 68954fb added a configure option --with-systemd_daemon,
which violates the conventions of configure files preferring
dash in all option names.  This fixes it, before we hit a
release where the tarball is baked with an awkward name.

* m4/virt-lib.m4 (LIBVIRT_CHECK_LIB, LIBVIRT_CHECK_LIB_ALT)
(LIBVIRT_CHECK_PKG): Favor - over _ in configure option names.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-02-26 05:59:22 -07:00
Michal Privoznik
68954fb25c virNetServerRun: Notify systemd that we're accepting clients
Systemd does not forget about the cases, where client service needs to
wait for daemon service to initialize and start accepting new clients.
Setting a dependency in client is not enough as systemd doesn't know
when the daemon has initialized itself and started accepting new
clients. However, it offers a mechanism to solve this. The daemon needs
to call a special systemd function by which the daemon tells "I'm ready
to accept new clients". This is exactly what we need with
libvirtd-guests (client) and libvirtd (daemon). So now, with this
change, libvirt-guests.service is invoked not any sooner than
libvirtd.service calls the systemd notify function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-02-24 10:54:48 +01:00
Roman Bogorodskiy
0eb4a5f4f1 bhyve: add a basic driver
At this point it has a limited functionality and is highly
experimental. Supported domain operations are:

  * define
  * start
  * destroy
  * dumpxml
  * dominfo

It's only possible to have only one disk device and only one
network, which should be of type bridge.
2014-02-19 14:21:50 +00:00