Commit Graph

271 Commits

Author SHA1 Message Date
Daniel P. Berrangé
c0a8ea450d po: provide custom make rules for po file management
Historically we have relied on autopoint/gettextize to install a
standard po/Makefile.in.in. There is very limited scope for customizing
this and it also causes a bunch of extra stuff to be pulled into
configure.ac which potentially clashes with gnulib. Writing make rules
for po file management is no more difficult than any other rules libvirt
has, so stop using autopoint/gettextize.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-19 10:35:58 +01:00
Jim Fehlig
1dac5fbbbb Remove the xend driver
xend was deprecated in Xen 4.2 and removed from the Xen sources
before the Xen 4.5 release. The last Xen release to contain xend
was Xen 4.4, which was retired upstream in March 2017.

Remove xend support from libvirt since it is unrealistic to use
modern libvirt with ancient Xen.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-09 11:38:05 -06:00
Ján Tomko
5123e6ed1f polkit: reintroduce check for pkcheck
Commit 2499d1a0 was too eager and possibly enabled polkit
on all platforms with D-Bus, regardless of whether they use polkit.

Reintroduce the usage of pkcheck as a witness for --with-polkit=check,
but do not require it for --with-polkit=yes.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reported-by: Jiří Denemark <jdenemar@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-03-25 22:27:22 +02:00
Rainer Müller
c28d837c0f build: Remove --with-xml-catalog-file option
After validation against XHTML 1.0 was dropped in f802c9de0,
the XML_CATALOG_FILE is not in use anymore. Therefore the checks in
configure can be removed.

Signed-off-by: Rainer Müller <raimue@codingfarm.de>
2018-03-25 19:49:25 +02:00
Andrea Bolognani
5433ec02ad m4: Fix xenstore detection
Commit 596fc3e389 introduced the ability to detect xenstore
using pkg-config for systems with Xen 4.9, but accidentally broke
detection for all other systems. Fix the logic so that it works
in all cases.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-03-14 16:07:31 +01:00
Ján Tomko
2499d1a095 Do not check for pkcheck
All we need is D-Bus.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2018-03-14 12:46:26 +01:00
Ján Tomko
0d4b988b3e Merge WITH_POLKIT1 and WITH_POLKIT
There is just one polkit now.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2018-03-14 12:46:26 +01:00
Ján Tomko
af41cf5957 Remove Policy-Kit support
Policy-Kit has been replaced by polkit (referred to, respectively,
as POLKIT0 and POLKIT1 in our Makefiles).

The last build fix with old Policy-Kit was in May 2013:
commit <442eb2ba> and build with -Wunused-label was broken
since April 2016: commit <8437130>

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2018-03-14 12:46:26 +01:00
Olaf Hering
596fc3e389 m4: use pkgconfig to detect xenstore
Since Xen 4.9 a pkgconfig file exists to gather info about building
against libxenstore.so. Use it if available.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2018-03-14 08:48:31 +01:00
Daniel P. Berrangé
67966ad518 m4: enforce that all enum cases are listed in switch statements
As a general rule any time we switch() on something that is an enum, we
want to have a case for every enum constant. The -Wswitch warning will
report any switch where we've violated this rule, except if that switch
has a default case.

Unfortunately it is reasonable to want to list all enum constants *and*
also have a default case. To get a warning in that scenario requires
that we turn on -Wswitch-enum.

In a few cases where we explicitly don't want to list all enum cases, we
can discard the enum type checking by casting the value to a plain int.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-21 16:59:48 +00:00
Daniel P. Berrangé
9148293018 m4: disable gcc8 -Wcast-function-type warnings from -Wextra
The -Wextra flag bundle gained a new warning -Wcast-function-type.
This complains if you cast between two function prototypes where
the number of parameters or their data types are not compatible.
Unfortunately we need such "bad" function casts for our event
callbacks. It is possible to silence the warning by first casting
to the generic "void (*)(void)" function prototype, but that is
rather ugly to add throughout libvirt code.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-02-16 14:37:04 +00: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. Berrange
ed45361044 libxl: add explicit linkage to xenstore library
Since

  commit eee7bd4ecb
  Author: Joao Martins <joao.m.martins@oracle.com>
  Date:   Tue Jul 26 00:45:14 2016 +0100

    libxl: implement virDomainBlockStats

    Introduce initial support for domainBlockStats API

the libxl driver calls a couple of xenstore APIs, so it must explicitly
link to this library rather than rely on indirect linkage via libxl or
other xen libraries.

Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-25 09:30:54 +00:00
Ján Tomko
33dd664c50 Raise the frame limit for tests
After the latest CPU additions, the build fails with clang:
cputest.c:905:1: error: stack frame size of 26136 bytes
  in function 'mymain' [-Werror,-Wframe-larger-than=]

Raise the relaxed limit which is used for tests.
2018-01-18 10:16:41 +01:00
Michal Privoznik
74416b1d48 m4: Check for rl_completion_quote_character
Apparently we can't assume that people run readline recent enough
to have rl_completion_quote_character (added in readline-5.0
released in 2011). However, we can't compile without it. So if
not present, disable readline.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018-01-15 17:59:26 +01:00
Michal Privoznik
72ac507f42 m4: Don't enable bash-completion by default
Due to the way that check logic was written we basically enabled
bash completion whenever readline was enabled. This is not right
because it made bash-completion pkg-config module required.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018-01-12 10:43:30 +01:00
Michal Privoznik
f0d390bc16 tools: Provide bash autompletion file
The only purpose of this file is to be sourced. After that one
can use completion even for their bash:

  # virsh list --<TAB><TAB>
  --all                   --inactive ...

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2018-01-11 18:53:04 +01:00
Andrea Bolognani
fbe315bdc8 m4: Disable -Wdisabled-optimization
After b4f7793ce2, qemuxml2xmltest has apparently become big enough
to trigger a compilation error when using --enable-test-coverage on
aarch64:

    CC       qemuxml2xmltest.o
  qemuxml2xmltest.c: In function 'mymain':
  qemuxml2xmltest.c:1216:1: error: const/copy propagation disabled: 4361 basic blocks and 99285 registers [-Werror=disabled-optimization]
   }
   ^
  qemuxml2xmltest.c:1216:1: error: PRE disabled: 4361 basic blocks and 99285 registers [-Werror=disabled-optimization]
  qemuxml2xmltest.c:1216:1: error: const/copy propagation disabled: 4361 basic blocks and 99285 registers [-Werror=disabled-optimization]
  qemuxml2xmltest.c:1216:1: error: const/copy propagation disabled: 4361 basic blocks and 99285 registers [-Werror=disabled-optimization]

However, as the GCC documentation states, this warning is not really
caused by issues in our code, so it makes sense to disable it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
2017-09-06 09:06:26 +02:00
Eric Blake
b887d7b0c7 maint: correct quoting for gl_WARN_ADD
3 out of 4 uses of gl_WARN_ADD() were incorrectly adding "" around
the argument, which in turn resulted in the argument being used
unquoted (configure had gl_positive=""-fstack-protector-all"",
rather than the intended gl_positive="-fstack-protector-all").

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2017-08-28 10:15:05 -05:00
Daniel P. Berrange
1c21dd711c m4: workaround clang/glibc problem with isnan()
When building libvirt with clang we get bogus warnings about
'double' being promoted to 'long double' when calling isnan().

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

Detect this broken isnan() / compiler combination and disable
the -Wdouble-promotion flag.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-11 17:48:06 +01:00
Jim Fehlig
d8e8b63d30 libxl: Add a test suite for libxl_domain_config generator
The libxl library allows a libxl_domain_config object to be serialized
from/to a JSON string. Use this to allow testing of the XML to
libxl_domain_config conversion process. Test XML is converted to
libxl_domain_config, which is then serialized to json. A json template
corresponding to the test XML is converted to a libxl_domain_config
object using libxl_domain_config_from_json(), and then serialized
back to json using libxl_domain_config_to_json(). The two json
docs are then compared.

Using libxl to convert the json template to a libxl_domain_config
object and then back to json provides a simple way to account for
any changes or additions to the json representation across Xen
releases.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
[update to v3.5.0-rc1, improve error reporting, use /bin/true emulator]
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
2017-08-04 10:17:55 -06:00
Daniel P. Berrange
94d2d6429d docs: make xmllint & xsltproc compulsory
We already require libxml to be installed, so it is not unreasonable
to require xmllint and xsltproc to be installed too - any platform
with the former will have the latter too.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-02 17:00:11 +01:00
Daniel P. Berrange
f802c9de09 docs: drop XHTML 1.0 validation of website
The HTML pages are currently validated against an XHTML 1.0 DTD.
This makes it impossible to take advantage of features that are
introduced in HTML 5, because they'll fail validation.

There is intentionally no DTD defined for HTML 5, so there's no
alternative to XHTML 1.0 DTD that we could switch to. The only
options are to stick with XHTML 1.0 forever, or drop the DTD
validation, and we pick the latter.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-02 17:00:11 +01:00
Peter Krempa
5aec02dc37 make: Drop building without driver modules
Driver modules proved to be reliable for a long time. Since support for
not building modules complicates the code and makefiles drop it.

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
2017-07-27 12:00:35 +02:00
Pino Toscano
1df47a70fb configure: fix typo in nss error message
This error message refers to the lack of network, not to yajl.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2017-07-10 10:00:43 +02:00
Daniel P. Berrange
f1acc4130c Temporarily disable format truncation warnings
GCC 7.1 introduces a new -Wformat-truncation warning
flag that reports if it thinks the maximum possible
size of the formatted output will exceed the provided
fixed buffer. This is enabled automatically by the
-Wformat warning flag. There are quite a few places
hit by this in libvirt which need rewriting. This is
non-trivial work in some places, so temporarily
disable the new warning until those fixes can be
implemented.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-06-15 14:22:54 +01:00
Daniel P. Berrange
1ba693994a Disable the -Wduplicated-branches warning
Depending on the platform/architecture, a number of conditionals
in libvirt code expand the same on both branches. This is expected
behaviour and harmless, so disable the warning to avoid creating
unexpected build failures

Two examples, mingw32:

../../src/util/vircommand.c: In function 'virCommandWait':
../../src/util/vircommand.c:2562:51: error: this condition has identical branches [-Werror=duplicated-branches]
             *exitstatus = cmd->rawStatus ? status : WEXITSTATUS(status);
                                                   ^
and gcc7.1

In file included from util/virobject.c:28:0:
util/virobject.c: In function 'virClassNew':
util/viratomic.h:176:46: error: this condition has identical branches [-Werror=duplicated-branches]
            (void)(0 ? *(atomic) ^ *(atomic) : 0);                      \
                                             ^
util/virobject.c:144:20: note: in expansion of macro 'virAtomicIntInc'
    klass->magic = virAtomicIntInc(&magicCounter);
                   ^~~~~~~~~~~~~~~

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-06-15 13:26:51 +01:00
Roman Bogorodskiy
9ea3424a17 virsh: workaround readline prototypes warnings
When building with clang 4.0.0, virsh build fails like this:

gmake[3]: Entering directory '/usr/home/novel/code/libvirt/tools'
  CC       virsh-virsh.o
In file included from virsh.c:45:
In file included from /usr/local/include/readline/readline.h:31:
/usr/local/include/readline/rltypedefs.h:35:22: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
typedef int Function () __attribute__ ((deprecated));
                     ^
                      void
/usr/local/include/readline/rltypedefs.h:36:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
typedef void VFunction () __attribute__ ((deprecated));
                       ^
                        void
/usr/local/include/readline/rltypedefs.h:37:26: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
typedef char *CPFunction () __attribute__ ((deprecated));
                         ^
                          void
/usr/local/include/readline/rltypedefs.h:38:28: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
typedef char **CPPFunction () __attribute__ ((deprecated));
                           ^
                            void
In file included from virsh.c:45:
/usr/local/include/readline/readline.h:385:23: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
extern int rl_message ();
                      ^
                       void
5 errors generated.
gmake[3]: *** [Makefile:2823: virsh-virsh.o] Error 1

Fix that by adding -D_FUNCTION_DEF to READLINE_CFLAGS to fix *Function
related warnings and add a check for stdarg.h so we have HAVE_STDARG_H
defined that's needed by the readline headers to use proper rl_message
declaration.

Bug report on the readline mailing list:

 http://lists.gnu.org/archive/html/bug-readline/2017-05/msg00004.html
2017-06-08 21:03:34 +04:00
Erik Skultety
5970b13982 udev: Fix build on older platforms
Caused by commit @d1eea6c1 due to the missing symbol on older platforms.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2017-05-31 13:28:24 +02:00
Julio Faracco
424a21a9c8 m4: Fix missing with_acl variable
This commit fixes an acl missing variable. The virt-acl.m4 inside the
macro directory does not contain the variable 'with_acl'. So, it is
being set as an empty string "with_acl=''". This is causing a missing
option during the configuration, even if you have acl libs installed.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
2017-05-26 11:37:44 +02:00
Jiri Denemark
23377c539b locking: Add support for sanlock_strerror
The recently added sanlock_strerror function can be used to translate
sanlock's numeric errors into human readable strings.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2017-04-27 11:44:11 +02:00
Daniel P. Berrange
4d80317655 virt-storage-rbd: fix typo s/RDB/RBD/ in configure check
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-04-19 15:01:17 +01:00
Daniel P. Berrange
354191c5f1 Fix detection of required RBD version
If building libvirt against Ubuntu precise, the librbd.h is lacking
many functions that libvirt expects. We have no version check, so
we were enabling RBD even though it cannot compile. This configure
check uses existance of 'rbd_get_features' as an identifier for the
min required version.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-04-19 10:51:51 +01:00
Ján Tomko
e73889b631 Split out -Wframe-larger-than warning from WARN_CLFAGS
Introduce STRICT_FRAME_LIMIT_CFLAGS that will be used for
production code and RELAXED_FRAME_LIMIT_CFLAGS for tests.

Raising the limit for tests allows building them with clang
with optimizations disabled.
2017-04-06 12:29:35 +02:00
Peter Krempa
17c4b07a38 configure: Fix configure output for RBD storage backend
We'd print status for the 'dir' backend instead of the correct one.
2017-02-21 08:19:11 +01:00
Andrea Bolognani
c315ead702 configure: Move ACL checks to a separate file 2017-02-14 19:06:30 +01:00
Peter Krempa
a7ae7ca9d4 configure: Fix copy-paste error in vstorage backend check
The 'fs' backend m4 code was copied, but one of the condition were not
changed which resulted into:

configure:    Gluster: yes
configure:        ZFS: yes
configure: Virtuozzo storage: check

Make the code turn on the virtuozzo driver automatically if the tools
are found.
2017-01-27 10:37:56 +01:00
Olga Krishtal
e590d5301e storage: Introduce Virtuozzo vstorage backend
Added general definitions for vstorage pool backend including
the build options to add --with-storage-vstorage checking.
In order to use vstorage as a backend for a storage pool
vstorage tools (vstorage and vstorage-mount) need to be installed.

Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com>
2017-01-26 10:43:42 -05:00
Boris Fiuczynski
16dd2f030a configure: fix indentation in TLS priority result
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
2017-01-24 17:24:14 +01:00
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