Commit Graph

735 Commits

Author SHA1 Message Date
Daniel P. Berrangé
b9103e62e4 src: optionally include xlocale.h header
On macOS some definitions are in xlocale.h, instead of in
locale.h. GNULIB hides this difference by making the latter
include the former.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-02-04 14:00:45 +00:00
Daniel P. Berrangé
ab36f72947 src: introduce a wrapper for the pipe2() system call
This hides the differences between Windows and UNIX,
and adds standard error reporting.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-02-04 14:00:44 +00:00
Daniel P. Berrangé
7c8b144d4a configure: request 64-bit APIs on 32-bit platforms
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-02-04 14:00:44 +00:00
Michal Privoznik
a37a8c569d Drop virAtomic module
Now, that every use of virAtomic was replaced with its g_atomic
equivalent, let's remove the module.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-02-02 16:36:58 +01:00
Daniel P. Berrangé
fc920f704c src: convert all code to use virsocket.h
There are a large number of different header files that
are related to the sockets APIs. The virsocket.h header
includes all of the relevant headers for Windows and UNIX
in one convenient place. If virsocketaddr.h is already
included, then there's no need for virsocket.h

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-01-29 14:51:40 +00:00
Daniel P. Berrangé
5c455d9081 configure: request system specific extensions
The AC_USE_SYSTEM_EXTENSIONS macro causes things like
"USE_GNU" to be defined, which enables access to OS
specific extensions to POSIX. We currently got this
indirectly via GNULIB's 'extensions' module which is
a dependancy of other GNULIB modules we use.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-01-29 14:51:40 +00:00
Daniel P. Berrangé
cf308f13db configure: add check for sys/ioctl.h
We currently get the sys/ioctl.h check indirectly
via GNULIB, but this will soon stop happening.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-01-29 14:51:40 +00:00
Daniel P. Berrangé
7f3eb533f4 src: conditionalize use of net/if.h
The net/if.h is not portable so we must check for its
existance and avoid using it when missing. Some use
of net/if.h was redundant and could be removed.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-01-29 14:51:40 +00:00
Daniel P. Berrangé
32fe38646a src: remove all traces of Cygwin support
Cygwin is not a supported build platform for libvirt and
has no testing coverage in our CI systems. Stop pretending
the code is usable and remove it so there is less to port
to Meson.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-01-29 14:51:40 +00:00
Daniel P. Berrangé
f80c009cb3 build: generate configmake.h in root directory
Currently we rely on gnulib creating configmake.h, but we
can easily create it ourselves instead.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-01-29 14:51:39 +00:00
Pavel Hrdina
71d3098e59 bootstrap.conf: drop gnulib tests from libvirt
We are in process of removing gnulib and adopting meson as our build
system.  In order to help with the transition let's drop gnulib tests.

This will also help with the fact that before we will be able to drop
gnulib completely we will store output of bootstrap in git.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-01-17 16:04:26 +01:00
Pavel Hrdina
e664e284d7 configure.ac: add check for getegid function
We already use this function and so far we've been lucky that the same
check is done by gnulib.  This will change once we will drop gnulib and
also make it obvious that we have to do the same check in Meson as well.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-01-17 15:52:37 +01:00
Daniel P. Berrangé
7c828af858 src: conditionally exclude cfmakeraw/termios.h on WIN32
The GNULIB termios module ensures termios.h exists (but
is none the less empty) when building for Windows. We
already exclude usage of the functions that would exist
in a real termios.h, so having an empty termios.h is
not especially useful.

It is simpler to just put all use of termios.h related
functions behind a "#ifndef WIN32" conditional.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-01-17 10:02:01 +00:00
Daniel P. Berrangé
f650e86703 util: add detection of openpty function
All UNIX platforms we care about have openpty() in the libutil
library. Use of pty.h must also be made conditional, excluding
Win32.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-01-17 09:59:08 +00:00
Ján Tomko
4c121af81b maint: Post-release version bump to 6.1.0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2020-01-15 16:51:12 +01:00
Cole Robinson
f854e051b9 Remove phyp driver
The phyp driver was added in 2009 and does not appear to have had any
real feature change since 2011. There's virtually no evidence online
of users actually using it. IMO it's time to kill it.

This was discussed a bit in April 2016:
https://www.redhat.com/archives/libvir-list/2016-April/msg01060.html

Final discussion is here:
https://www.redhat.com/archives/libvir-list/2019-December/msg01162.html

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-12-20 12:25:42 -05:00
Cole Robinson
faeaf6f15d tests: use PYTHON detected from configure
Extend configure to pass the detect python binary to C code, and
use it in the test suite, rather than searching PATH

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-12-10 09:55:45 -05:00
Daniel P. Berrangé
f0b3840fb6 build: only support python3 binary
python2 will be end of life by the time of the next
libvirt release. All our supported build targets, including
CentOS7, have a python3 build available.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-12-04 13:13:01 +00:00
Ján Tomko
3bbe10205b maint: post-version bump version bump to 6.0.0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2019-12-03 12:42:28 +01:00
Jim Fehlig
e8a8ee92bd maint: Post-release version bump to 5.11.0
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2019-12-02 21:20:37 -07:00
Pavel Hrdina
30b6ddc44c vircgroup: introduce virCgroupV2DevicesAvailable
There is no exact way how to figure out whether BPF devices support is
compiled into kernel.  One way is to check kernel configure options but
this is not reliable as it may not be available.  Let's try to do
syscall to which will list BPF cgroup device programs.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-11-15 12:58:04 +01:00
Pavel Hrdina
07946d6e39 util: introduce virbpf helpers
In order to implement devices controller with cgroup v2 we need to
add support for BPF programs, cgroup v2 doesn't have devices controller.

This introduces required helpers wrapping linux syscalls.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-11-15 12:58:00 +01:00
Pavel Hrdina
f96395e78e build: mandate use of a build dir != src dir
Historically we've allowed builds in the main src dir, but meson does
not support this. Explicitly force separate build dir in autotools to
align with meson. We must re-enable dependency tracking which the RPM
%configure macro turns off. Without this, the build dir doesn't get
the source directory tree mirrored.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-11-08 17:07:35 +01:00
Andrea Bolognani
f5420e60f2 maint: Post-release version bump to 5.10.0
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-11-06 15:49:10 +01:00
Daniel P. Berrangé
6c748c8e2d util: use glib base64 encoding/decoding APIs
Replace use of the gnulib base64 module with glib's own base64 API family.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-10-14 10:54:42 +01:00
Daniel P. Berrangé
58e7c9bc05 build: probe for glib-2 library in configure
Prepare for linking with glib by probing for it at configure
time. Per supported platforms target, the min glib versions on
relevant distros are:

  RHEL-8: 2.56.1
  RHEL-7: 2.50.3
  Debian (Buster): 2.58.3
  Debian (Stretch): 2.50.3
  OpenBSD (Ports): 2.58.3
  FreeBSD (Ports): 2.56.3
  OpenSUSE Leap 15: 2.54.3
  SLE12-SP2: 2.48.2
  Ubuntu (Xenial): 2.48.0
  macOS (Homebrew): 2.56.0

This suggests that a minimum glib of 2.48 is a reasonable target.
This aligns with the minimum version required by qemu too.

We must disable the bad-function-cast warning as various GLib APIs
and macros will trigger this.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-10-14 10:54:42 +01:00
Daniel P. Berrangé
fd3b8fe7ad tests: delete objectlocking test code
The object locking test code is not run by any CI tests and has
bitrotted to the point where it isn't worth the effort to try to
fix it.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-10-10 12:49:52 +01:00
Daniel P. Berrangé
56bd0665c7 build: import gnulib's syntax-check make rules
We're going to be eliminating autotools and gnulib, but we still wish to
have the 'make syntax-check' functionality.

This imports the minimal set of gnulib files required to keep this
working.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-10-09 13:36:29 +01:00
Daniel P. Berrangé
80830cb34d Revert "build: use autobuild module to make build logs nicer"
This reverts commit 83aca30f1e.

While the motivation of the original commit is fine, we are intending to
drop autoconf in favour of meson, and similarly wish to drop use of
gnulib. Removing this feature is part of that conversion work.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-10-07 11:34:24 +01:00
Peter Krempa
ba17721db1 maint: Post-release version bump to 5.9.0
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2019-10-07 08:00:47 +02:00
Daniel P. Berrangé
ada268012a build: force a UTF-8 locale for python
Python3 versions less than 3.7 have very unhelpful handling
of the C locale where they assume data is 7-bit only. This
violates POSIX which requires the C locale to be 8-bit clean.
Python3 >= 3.7 now assumes that the C locale is always UTF-8.

Set env variables to force LC_CTYPE to en_US.UTF-8 so that
we get UTF-8 handling on all python versions. Note we do
not use C.UTF-8 since not all C libraries support that.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-09-24 15:46:22 +01:00
Shi Lei
bc1e4389f5 maint: Use flake8 to check python code
Replace 'sc_prohibit_semicolon_at_eol_in_python' with generic 'sc_flake8' rule
to check python code style.

Now 'sc_flake8' just check the error E703: 'statement ends with a semicolon'.
In future, we could use '--select' to introduce more rules.

Signed-off-by: Shi Lei <shi_lei@massclouds.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2019-09-18 14:12:07 +02:00
Daniel P. Berrangé
2c52ecd960 util: purge all code for testing OOM handling
The OOM handling requires special build time options which we never
enable in our CI. Even once enabled the tests are incredibly slow and
typically require manual inspection of the results to weed out false
positives.

Since there was previous agreement to switch to abort on OOM in libvirt
code, there's no point continuing to keep the unused OOM testing code.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-09-13 10:05:17 +01:00
Michal Privoznik
fe98219596 configure: Prefer LIBVIRT_RESULT over AC_MSG_NOTICE
One of the advantages is that LIBVIRT_RESULT aligns the resulting
message for us.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-09-12 12:12:54 +02:00
Jim Fehlig
2171442d62 xenapi: remove driver
The xenapi driver has not seen any development since its initial
contribution 9 years ago. There have been no bug reports, no patches,
and no queries about the driver on the developer or user mailing lists.
Remove the driver from the libvirt sources.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-09-03 15:37:54 -06:00
Jim Fehlig
357ce1e30c maint: Post-release version bump to 5.8.0
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2019-09-03 15:19:22 -06:00
Daniel P. Berrangé
390997925a build: support customization of runstatedir variable with old autoconf
Many distros have moved /var/run to /run with the introduction of
systemd. /var/run still exists as a symlink to /run, but its usage
is deprecated.

autoconf added a --runstatedir option back in 2013 but there's still no
new release of autoconf that includes this.

gnulib meanwhile added support to propagate this arg's value to
configmake.h, but it falls back to $localstatedir/run for autoconf 2.69
and older, which is what every distro today has.

To deal with this problem we add a --with-runstatedir arg that then sets
the $runstatedir env variable that future autoconf's --runstatedir arg
will also use. This finally enables $runstatedir to be pointed to /run.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-27 10:23:16 +01:00
Jim Fehlig
ecc4d75d01 xenconfig: move contents to libxl driver and remove directory
After the legacy xen driver was removed the libxl driver became
the only consumer of xenconfig. Move the few files in xenconfig
to the libxl driver and remove the directory.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-08-26 11:06:12 -06:00
Roman Bolshakov
740f181c47 build: Use flat namespace for libvirt on macOS
>From ld(1):

  By default all references resolved to a dynamic library record the
  library to which they were resolved. At runtime, dyld uses that
  information to directly resolve symbols. The alternative is to use the
  -flat_namespace option.  With flat namespace, the library is not
  recorded.  At runtime, dyld will search each dynamic library in load
  order when resolving symbols. This is slower, but more like how other
  operating systems resolve symbols.

That fixes the set of tests that preload a mock library to replace
library symbols:
  qemublocktest
  qemumonitorjsontest
  viriscsitest
  virmacmaptest
  virnetserverclienttest

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
2019-08-23 11:26:26 +01:00
Michal Privoznik
8b802f13cb util: Introduce virhostuptime
This module contains function to get host boot time.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2019-08-22 16:46:44 +02:00
Jiri Denemark
8a62a1592a Revert "configure: Remove --enable-test-coverage"
This reverts commit f38d553e2d.

Gnulib's make coverage (or init-coverage, build-coverage, gen-coverage)
is not a 1-1 replacement for the original configure option. Our old
--enable-test-coverage seems to be close to gnulib's make build-coverage
except gnulib runs lcov in that phase and the build actually fails for
me even before lcov is run. And since we want to be able to just build
libvirt without running lcov, I suggest reverting to our own
implementation.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-By: Eric Blake <eblake@redhat.com>
2019-08-14 09:28:06 +02:00
Daniel P. Berrangé
ac0d21c762 build: drop libvirt setuid library build
The virt-login-shell setuid program is now a tiny piece of code
that only uses standard libc functions, and santizes the execution
environment before invoking the real virt-login-shell-helper.
The latter is thus able to use the normal libvirt.so build,
allowing us to delete the special cut down setuid library build.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-07 16:54:01 +01:00
Michal Privoznik
61819282a0 maint: Post-release version bump to 5.7.0
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2019-08-05 19:23:46 +02:00
Michal Privoznik
d81d089e17 maint: Post-release version bump to 5.6.0
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2019-07-03 08:30:52 +02:00
Daniel P. Berrangé
5a148ce846 remote: delete the avahi mDNS support
Libvirtd has long had integration with avahi for advertising libvirtd
using mDNS when TCP/TLS listening is enabled. For a long time the
virt-manager application had support for auto-detecting libvirtds
on the local network using mDNS, but this was removed last year

  commit fc8f8d5d7e3ba80a0771df19cf20e84a05ed2422
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Sat Oct 6 20:55:31 2018 -0400

    connect: Drop avahi support

    Libvirtd can advertise itself over avahi. The feature is disabled by
    default though and in practice I hear of no one actually using it
    and frankly I don't think it's all that useful

    The 'Open Connection' wizard has a disproportionate amount of code
    devoted to this feature, but I don't think it's useful or worth
    maintaining, so let's drop it

I've never heard of any other applications having support for using
mDNS to detect libvirtd instances. Though it is theoretically possible
something exists out there, it is clearly going to be a niche use case
in the virt ecosystem as a whole.

By removing avahi integration we can cut down the dependency chain for
the basic libvirtd install and reduce our code maint burden.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-06-21 12:59:42 +01:00
Andrea Bolognani
0e331942a0 maint: Post-release version bump to 5.5.0
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-06-03 17:19:28 +02:00
Andrea Bolognani
6716c997f6 docs: Install documentation under $(docdir)
At the moment we allow the user to specify exactly where
they want the HTML documentation to be installed with an
extreme level of precision through the --with-html-dir and
--with-html-subdir configure options.

Most of the time, of course, the user will stick with the
default, that is $(datadir)/doc/$(PACKAGE)-$(VERSION)/html.

So close to $(docdir)! Including the version number in
the path, specifically, seems entirely unnecessary since
different releases of libvirt are not going to be able to
coexist on the same system anyway.

Drop all these custom flexibilty for flexibilty's sake
shenaningans in favor of the standard, well understood
$(docdir).

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Acked-by: Michal Privoznik <mprivozn@redhat.com>
2019-05-13 12:02:13 +02:00
Michal Privoznik
1cdea0f929 maint: Post-release version bump to 5.4.0
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2019-05-04 23:39:23 +02:00
Andrea Bolognani
9d7b9cf166 Fix spelling for macOS
Though it used to be called "Mac OS X" and "OS X" in the past,
it was never "MacOS X" nor "OS-X", and it's just "macOS" now.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-04-15 11:09:10 +02:00
Ján Tomko
8bfb36db40 configure.ac: add foreign to AM_INIT_AUTOMAKE
We do not care about the portability warnings implied by the implicit
'gnu' option. Switch to 'foreign' to opt out of checking the files
present in the top directory to let us drop ChangeLog completely.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-04-03 13:30:47 +02:00