Commit Graph

389 Commits

Author SHA1 Message Date
Michal Privoznik
03a25597f1 meson: Provide default values for nonexistent xenlight pkgconfig vars
It may happen that xenlight pkgconfig file does not contain
'xenfirmwaredir' and/or 'libexec_bin' variables, which is okay
and we have code that deals with this situation. But that code is
executed when the queried value is an empty string. This may not
always be the case and we should specifically set 'default_value'
so that the empty string is returned if pkgconfig variable
doesn't exist.

Fixes: 968479adcf
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-12-12 17:10:32 +01:00
Daniel P. Berrangé
0b8c6b5e47 meson: remove obsolete check for BPF_CGROUP_DEVICE
The BPF_CGROUP_DEVICE constant was introduced to Linux in

  commit ebc614f687369f9df99828572b1d85a7c2de3d92
  Author: Roman Gushchin <roman.gushchin@linux.dev>
  Date:   Sun Nov 5 08:15:32 2017 -0500

    bpf, cgroup: implement eBPF-based device controller for cgroup v2

This is old enough that all our supported platforms can be assumed
to have this feature.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:36:58 +00:00
Daniel P. Berrangé
1a6f4db754 meson: remove obsolete check for BPF_PROG_QUERY
The BPF_PROG_QUERY constant was introduced to Linux in

  commit defd9c476fa6b01b4eb5450452bfd202138decb7
  Author: Alexei Starovoitov <ast@kernel.org>
  Date:   Mon Oct 2 22:50:26 2017 -0700

    libbpf: sync bpf.h

This is old enough that all our supported platforms can be assumed
to have this feature.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:36:18 +00:00
Daniel P. Berrangé
191dda058a meson: remove obsolete check for VHOST_VSOCK_SET_GUEST_CID
The VHOST_VSOCK_SET_GUEST_CID constant was introduced to Linux in

  commit 433fc58e6bf2c8bd97e57153ed28e64fd78207b8
  Author: Asias He <asias@redhat.com>
  Date:   Thu Jul 28 15:36:34 2016 +0100

    VSOCK: Introduce vhost_vsock.ko

This is old enough that all our supported platforms can be assumed
to have this feature.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:36:15 +00:00
Daniel P. Berrangé
b41ed60763 meson: remove obsolete check for linux/magic.h
The linux/magic.h header has existed since

  commit e18fa700c9a31360bc8f193aa543b7ef7b39a06b
  Author: Jeff Garzik <jeff@garzik.org>
  Date:   Sun Sep 24 11:13:19 2006 -0400

    Move several *_SUPER_MAGIC symbols to include/linux/magic.h.

This is old enough that all our supported platforms can be assumed
to have this header.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:36:13 +00:00
Daniel P. Berrangé
21f2b9cf9d meson: remove obsolete check for DEVLINK_CMD_ESWITCH_GET
The DEVLINK_CMD_ESWITCH_GET constant was introduced to Linux in

  commit adf200f31c000d707e4afe238ed1d1199e0cce7c
  Author: Jiri Pirko <jiri@mellanox.com>
  Date:   Thu Feb 9 15:54:33 2017 +0100

    devlink: fix the name of eswitch commands

This is old enough that all our supported platforms can be assumed
to have this feature.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:36:10 +00:00
Daniel P. Berrangé
2b23e72599 meson: simplify check for virnetdevbridge.c headers
The headers required by virnetdevbridge.c have all exited since
before Linux moved to git. It is sufficient to check for just
one of them in order to give an error message about needing
kernel headers installed.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:36:08 +00:00
Daniel P. Berrangé
d1c517d965 meson: remove obsolete check for GET_VLAN_VID_CMD
The GET_VLAN_VID_CMD constant has existed since before Linux moved
to git.

This is old enough that all our supported platforms can be assumed
to have this feature.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:36:06 +00:00
Daniel P. Berrangé
efb8acb7f7 meson: remove obsolete check for ETHTOOL_GCOALESCE
The ETHTOOL_GCOALESCE constant has existed since before Linux moved
to git.

This is old enough that all our supported platforms can be assumed
to have this feature.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:36:03 +00:00
Daniel P. Berrangé
8d18f97ec1 meson: remove obsolete check for ETHTOOL_GFEATURES
The ETHTOOL_GFEATURES constant was introduced to Linux in

  commit 5455c6998d34dc983a8693500e4dffefc3682dc5
  Author: Michał Mirosław <mirq-linux@rere.qmqm.pl>
  Date:   Tue Feb 15 16:59:17 2011 +0000

    net: Introduce new feature setting ops

This is old enough that all our supported platforms can be assumed
to have this feature.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:36:01 +00:00
Daniel P. Berrangé
fe2e685ec2 meson: remove obsolete check for ETH_FLAG_RXHASH
The ETH_FLAG_RXHASH constant was introduced to Linux in

  commit b00fabb4020d17bda4bea59507e09fadf573088d
  Author: stephen hemminger <shemminger@vyatta.com>
  Date:   Mon Mar 29 14:47:27 2010 +0000

    netdev: ethtool RXHASH flag

This is old enough that all our supported platforms can be assumed
to have this feature.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:35:58 +00:00
Daniel P. Berrangé
c96190658e meson: remove obsolete check for ETH_FLAG_NTUPLE
The ETH_FLAG_NTUPLE constant was introduced to Linux in

  commit 15682bc488d4af8c9bb998844a94281025e0a333
  Author: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
  Date:   Wed Feb 10 20:03:05 2010 -0800

    ethtool: Introduce n-tuple filter programming support

This is old enough that all our supported platforms can be assumed
to have this feature.

A typo in the existing condition "NTUBLE" instead of "NTUPLE" meant the
code was never enabled in the first place, which is an illustration of
why it is worth eliminating redundant conditional checks.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:35:55 +00:00
Daniel P. Berrangé
4d35922f23 meson: remove obsolete check for ETH_FLAG_TXVLAN/RXVLAN
The ETH_FLAG_TXVLAN/RXVLAN constants were introduced to Linux in

  commit d5dbda23804156ae6f35025ade5307a49d1db6d7
  Author: Jesse Gross <jesse@nicira.com>
  Date:   Wed Oct 20 13:56:07 2010 +0000

    ethtool: Add support for vlan accleration.

This is old enough that all our supported platforms can be assumed
to have this feature.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:35:52 +00:00
Daniel P. Berrangé
74bbf36442 meson: remove obsolete check for ETH_FLAG_LRO
The ETH_FLAG_LRO constant was introduced to Linux in

  commit 3ae7c0b2e3747b50c3a6c63ebb67469e0a6b3203
  Author: Jeff Garzik <jeff@garzik.org>
  Date:   Wed Aug 15 16:00:51 2007 -0700

    [ETHTOOL]: Add ETHTOOL_[GS]FLAGS sub-ioctls

This is old enough that all our supported platforms can be assumed
to have this feature.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:35:50 +00:00
Daniel P. Berrangé
48c9470d0f meson: remove obsolete check for ETHTOOL_GFLAGS
The ETHTOOL_GFLAGS constant was introduced to Linux in

  commit 3ae7c0b2e3747b50c3a6c63ebb67469e0a6b3203
  Author: Jeff Garzik <jeff@garzik.org>
  Date:   Wed Aug 15 16:00:51 2007 -0700

    [ETHTOOL]: Add ETHTOOL_[GS]FLAGS sub-ioctls

This is old enough that all our supported platforms can be assumed
to have this feature.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:35:47 +00:00
Daniel P. Berrangé
6e170c72f5 meson: remove obsolete check for ETHTOOL_GGRO
The ETHTOOL_GGRO constant was introduced to Linux in

  commit b240a0e5644eb817c4a397098a40e1ad42a615bc
  Author: Herbert Xu <herbert@gondor.apana.org.au>
  Date:   Mon Dec 15 23:44:31 2008 -0800

    ethtool: Add GGRO and SGRO ops

This is old enough that all our supported platforms can be assumed
to have this feature.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:35:44 +00:00
Daniel P. Berrangé
26b71905c2 meson: remove obsolete check for ETHTOOL_GGSO
The ETHTOOL_GGSO constant was introduced to Linux in

  commit 37c3185a02d4b85fbe134bf5204535405dd2c957
  Author: Herbert Xu <herbert@gondor.apana.org.au>
  Date:   Thu Jun 22 03:07:29 2006 -0700

    [NET]: Added GSO toggle

This is old enough that all our supported platforms can be assumed
to have this feature.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:35:34 +00:00
Daniel P. Berrangé
3e3b012172 meson: drop check for unshare()
The unshare() syscall was introduced to Linux in

  commit 2da436e00f9a5fdd0fb6b31e4b2b2ba82e8f5ab8
  Author: JANAK DESAI <janak@us.ibm.com>
  Date:   Tue Feb 7 12:59:03 2006 -0800

    [PATCH] unshare system call -v5: system call registration for i386

This is old enough that all our supported platforms can be assumed
to have this feature. Furthermore, the virprocess.c file was already
using unshare() with nothing more than a #ifdef __linux__ check.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:35:29 +00:00
Daniel P. Berrangé
84eb50dbd0 meson: remove obsolete check for LO_FLAGS_AUTOCLEAR
The LO_FLAGS_AUTOCLEAR constant was introduced to Linux in

  commit 96c5865559cee0f9cbc5173f3c949f6ce3525581
  Author: David Woodhouse <dwmw2@infradead.org>
  Date:   Wed Feb 6 01:36:27 2008 -0800

    Allow auto-destruction of loop devices

This is old enough that all our supported platforms can be assumed
to have this feature. For added fun this whole meson check was
semantically insane because EPOLL_CLOEXEC is not a valid arg
to unshare().

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:35:26 +00:00
Daniel P. Berrangé
9edbdb9781 meson: remove obsolete check for EPOLL_CLOEXEC
The EPOLL_CLOEXEC constant was introduced to Linux in

  commit a0998b50c3f0b8fdd265c63e0032f86ebe377dbf
  Author: Ulrich Drepper <drepper@redhat.com>
  Date:   Wed Jul 23 21:29:27 2008 -0700

    flag parameters: epoll_create

This is old enough that all our supported platforms can be assumed
to have this feature. For added fun this whole meson check was
semantically insane because EPOLL_CLOEXEC is not a valid arg
to unshare().

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:35:23 +00:00
Daniel P. Berrangé
cbd6cf45ae meson: remove obsolete check for LOOP_CTL_GET_FREE
The LOOP_CTL_GET_FREE constant was introduced to Linux in

  commit 770fe30a46a12b6fb6b63fbe1737654d28e84844
  Author: Kay Sievers <kay.sievers@vrfy.org>
  Date:   Sun Jul 31 22:08:04 2011 +0200

    loop: add management interface for on-demand device allocation

This is old enough that all our supported platforms can be assumed
to have this feature. As a plus point, this meson check is going
to start failing with future GCC. It fails to set _GNU_SOURCE, thus
'unshare' is not defined by the header, and its relying on an
implicit function decl. For added fun this whole meson check was
semantically insane because LOOP_CTL_GET_FREE is not a valid arg
to unshare().

Fixes https://fedoraproject.org/wiki/Toolchain/PortingToModernC
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-12-12 10:35:10 +00:00
Jiri Denemark
0eb82e6702 Post-release version bump to 9.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-12-01 10:59:27 +01:00
Jiri Denemark
40a8a74be6 Post-release version bump to 8.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-11-01 12:36:50 +01:00
Michal Privoznik
14573868ea meson: Bump minimal required meson version
Bump the minimal required version to 0.56.0. Looking into our CI
this is the oldest version we install.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-10-10 15:06:09 +02:00
Michal Privoznik
968479adcf Replace dep.get_pkgconfig_variable() with dep.get_variable(pkgconfig:)
The get_pkgconfig_variable() method is deprecated in 0.56.0 and
we're recommended to use get_variable(pkgconfig : ...) instead.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-10-10 15:06:09 +02:00
Michal Privoznik
27df3522e6 meson: Replace external_program.path() with external_program.full_path()
The path() method is deprecated in 0.55.0 and we're recommended
to use full_path() instead. Interestingly, we were already doing
do in couple of places, but not all of them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-10-10 15:06:09 +02:00
Michal Privoznik
3395c35f2f meson: Replace meson.source_root() with meson.project_source_root()
The source_root() method is deprecated in 0.56.0 and we're
recommended to use project_source_root() instead.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-10-10 15:06:09 +02:00
Michal Privoznik
5ecdcf8541 meson: Replace meson.build_root() with meson.project_build_root()
The build_root() method is deprecated in 0.56.0 and we're
recommended to use project_build_root() instead.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-10-10 15:06:09 +02:00
Jiri Denemark
55f3ed17d7 Post-release version bump to 8.9.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-10-03 10:03:44 +02:00
Michal Privoznik
7c35778126 meson: Require libssh-0.8.1 or newer
According to repology.org:

              RHEL-8: 0.9.4
              RHEL-9: 0.9.6
           Debian 11: 0.9.5
  openSUSE Leap 15.3: 0.8.7
        Ubuntu 20.04: 0.9.3

And the rest of distros has something newer anyways. Requiring
0.8.1 or newer allows us to drop the terrible hack where we
rename functions at meson level using #define. Note, 0.8.0 is
the version of libssh where the rename happened. It also allows
us to stick with SHA-256 hash algorithm for public keys.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-09-20 09:34:52 +02:00
Peter Krempa
b48469fcdb Revert "build: Decrease maximum stack frame size to 2048"
The bhyve driver still has some frames larger than 2048 bytes, so we
need to keep the limit as is.

The CI failure was masked by the Freebsd-13 failing for unrelated
reasons.

This reverts commit 46302172d4

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2022-09-09 16:49:21 +02:00
Peter Krempa
46302172d4 build: Decrease maximum stack frame size to 2048
After recent cleanups we can now restrict the maximum stack frame size
to 2k.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-09-09 16:11:06 +02:00
Peter Krempa
d4f7850d5b Remove support for building the sheepdog storage driver backend
The sheepdog project is unmaintained, with last commit in 2018 and
numerous unanswered issues reported.

Remove the libvirt storage driver support for it to follow the removal
of the client support in qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-09-01 13:11:09 +02:00
Jiri Denemark
1ed5fa84a8 Post-release version bump to 8.8.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-09-01 12:00:29 +02:00
Daniel P. Berrangé
684fa309ae rpm: merge mingw sub-packages into native spec
One specfile containing both native and mingw builds is the
new best practice for Fedora. This reduces the maint burden
and ensures the mingw packages don't fall behind.

Note this adds many more BuildRequires for anyone building
on Fedora, which will now need installing.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-08-09 09:10:00 -04:00
Jiri Denemark
e5c34c983c Post-release version bump to 8.7.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-08-01 09:39:36 +02:00
Michal Privoznik
4d7e848418 meson: Require gnutls-3.6.0 or newer
Released almost 5 years ago, gnutls-3.6.0 brings some important
features (which are utilized in next commit). Hence, require that
version at least.

Per repology, currently shipped versions are:

                 RHEL-8: 3.6.16
                 RHEL-9: 3.7.3
              Debian 11: 3.7.1
              Debian 12: 3.7.6
     openSUSE Leap 15.3: 3.6.7
       Ubuntu LTS 20.04: 3.6.13
       Ubuntu LTS 22.04: 3.7.3
             FreeBSD 12: 3.7.6
              Fedora 34: 3.7.4
              Fedora 35: 3.7.6

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-01 13:04:58 +02:00
Jiri Denemark
10008f5810 Post-release version bump to 8.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-07-01 11:27:31 +02:00
Jiri Denemark
506210aab9 Post-release version bump to 8.5.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-06-01 09:30:38 +02:00
Michal Privoznik
3663a7d48c virprocess: Drop workaround for setns() wrt old glibc
We have our own implementation of setns() which was introduced in
v1.2.9-rc1~190 and extended afterwards. The reason was that back
in 2014 we were dealing with glibc that in some of its older
versions did not provide the function. Mostly for non-intel
arches. Nevertheless, glibc now offers the function for all
architectures we care about (aarch64 being the freshest
architecture where the function was introduced, in glibc-2.17).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-24 16:15:29 +02:00
Andrea Bolognani
3866a40a95 meson: Drop support for -Wl,-M
This was originally introduced in c2fb8bfee3, reportedly to
support symbol versioning on Solaris; more recently, 30b301c6ea
ported it to meson.

Up until the previous commit this has resulted in passing

  -M .../libvirt/build/src/libvirt.syms

to the linker on macOS, but the implementation of the -M option
on that platform's linker is literally

  else if ( strcmp(arg, "-M") == 0 ) {
      // FIX FIX
  }

so in practice we've been providing an additional input file,
which the linker understandably ignores after printing a warning
since it's not in any format that it recognizes.

Considering that LLVM's linker, which is now used by default on
FreeBSD, supports the same --version-script option as the GNU
linker, that we have introduced special handling for macOS, and
that we don't target Solaris, we can simply drop the branch at
this point.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 11:12:50 +02:00
Andrea Bolognani
b05dfcdfcb meson: Don't attempt to use version scripts on macOS
macOS libraries don't support symbol versioning, so the only
result that we achieve by passing additional flags to the linker
is a bunch of messages like

  ld: warning: ignoring file .../libvirt/build/src/libvirt.syms,
  building for macOS-x86_64 but attempting to link with file built
  for unknown-unsupported file format ( 0x23 0x20 0x57 0x41 ... )

being produced during the build.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 11:12:48 +02:00
Jiri Denemark
a12b2d8f21 Post-release version bump to 8.4.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-05-02 13:37:43 +02:00
Andrea Bolognani
b94239a61e meson: Use dicts to initialize cfg_data objects
Instead of creating an empty object and then setting keys one
at a time, it is possible to pass a dict object to
configuration_data(). This is nicer because it doesn't require
repeating the name of the cfg_data object over and over.

There is one exception: the 'conf' object, where we store values
that are used directly by C code. In that case, using a dict
object is not feasible for two reasons: first of all, replacing
the set_quoted() calls would result in awkward code with a lot
of calls to format(); moreover, since code that modifies it is
sprinkled all over the place, refactoring it would probably
make things more complicated rather than simpler.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-04-01 15:33:19 +02:00
Jiri Denemark
0e4ee0ed3b Post-release version bump to 8.3.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-04-01 12:29:50 +02:00
Paolo Bonzini
5df14f8180 meson: do not look for libparted if not requested
libparted_dep is not used if -Dstorage_disk=disabled. Do not
bother looking for this library if the disk storage backend was
not requested.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2022-03-25 15:31:56 +01:00
Paolo Bonzini
3124cd618d meson: do not look for librbd/librados if not requested
rbd_dep is not used if -Dstorage_rbd=disabled.  Do not bother looking for
the libraries that compose it if the rbd storage backend was not requested.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-03-25 15:24:58 +01:00
Andrea Bolognani
d36ba5fa71 meson: Check for os-release's ID_LIKE in addition to ID
This makes it possible to reduce the number of cases we have to
consider, because 'sles' declares itself to be like 'suse' and
both 'rhel' and 'centos' declare themselves to be like 'fedora'.

We have to move the check for Ubuntu before the one for Debian,
however, because 'ubuntu' declares itself to be like 'debian'
and it would end up with the wrong defaults otherwise.

Suggested-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-03-17 14:46:14 +01:00
Andrea Bolognani
f167c083d7 Drop YouCompleteMe and color_coded integration
I introduced support for these vim plugins several years ago
but have since moved away from them. These days developers
are likely better served by lsp-based tooling, which doesn't
require additional per-project configuration.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-03-17 14:35:05 +01:00
Michal Privoznik
09bb46991d meson: Detect newer fuse
Now that we have support for fuse-3 we can detect it during the
configure phase. Even better, we can detect fuse-3 first and
fallback to old fuse only if the newer version doesn't exist.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-03-07 14:01:48 +01:00
Jiri Denemark
c7b9591ef3 Post-release version bump to 8.2.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-03-01 10:15:17 +01:00
Andrea Bolognani
9f2d3cb472 meson: Don't overwrite includedir
The current implementation of the workaround for yajl's broken
pkg-config file accidentally overwrites the value of includedir
that is later used by the installation process. Rename the
local variable to avoid this issue.

Fixes: c97075e1e4
Closes: https://gitlab.com/libvirt/libvirt/-/issues/271
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-02-03 13:19:23 +01:00
Andrea Bolognani
bdf40b73f7 meson: Optimize handling of qemu_user and qemu_group
If the user has already provided us with the configuration they
want, there's no point in trying to come up with a reasonable
OS-specific default.

Suggested-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-01-27 11:48:36 +01:00
Andrea Bolognani
00c1a47914 meson: Require that both qemu_user and qemu_group are provided
Or that neither is. The current implementation, where if only
one of the two is provided the other one will be based on
OS-specific defaults is more likely to cause confusion than it
is to be helpful.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-01-27 11:48:35 +01:00
Andrea Bolognani
46b5fbd1fe meson: Don't check whether qemu_user and qemu_group exist
QEMU might not be installed on the build system, in which case
the user and group will not be present. We should avoid falling
back to root:root in that case, and assume the user and group
are going to be present in the target system instead.

Suggested-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-01-27 11:48:33 +01:00
Andrea Bolognani
e963390342 meson: Don't require /etc/os-release to be present
It might be part of some non-mandatory package on certain
distros, and our logic deals just fine with its contents not
being available.

Fixes: 4c69d64efa
Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-01-27 11:48:27 +01:00
Olaf Hering
7d54a29138 meson: recognize sles when guessing default_qemu_user
NAME="SLES"
VERSION="15-SP3"
VERSION_ID="15.3"
PRETTY_NAME="SUSE Linux Enterprise Server 15 SP3"
ID="sles"
ID_LIKE="suse"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:15:sp3"
DOCUMENTATION_URL="https://documentation.suse.com/"

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-01-25 18:09:09 +01:00
Martin Kletzander
4c69d64efa meson: Explicitly specify run_command's check parameter
An update to meson 0.61.1 meant that it started showing warnings due to the fact
that the default for run_command's 'check' parameter is going to change.  It
unveiled the fact that we were even missing that parameter in some calls where
we expected different outcome.  To make sure the behaviour does not change
specify the parameter explicitly.  In places where we check for the return code
the parameter should be 'false' so that meson does not fail.  In all other cases
the parameter should be set to 'true' to make sure possible failure also stops
meson.

The warning in meson was added in https://github.com/mesonbuild/meson/pull/9304

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2022-01-24 09:54:35 +01:00
Michal Privoznik
5c98d1cee0 virdnsmasq: Lookup DNSMASQ in PATH
While it's true that our virCommand subsystem is happy with
non-absolute paths, the dnsmasq capability code is not. It stores
the path to dnsmasq within and makes it accessible via
dnsmasqCapsGetBinaryPath(). While strictly speaking no caller
necessarily needs canonicalized path, let's find dnsmasq once and
cache the result.

Therefore, when constructing the capabilities structure look up
the binary path. If DNSMASQ already contains an absolute path
then virFindFileInPath() will simply return a copy.

With this code in place, the virFileIsExecutable() check can be
removed from dnsmasqCapsRefreshInternal() because
virFindFileInPath() already made sure the binary is executable.

But introducing virFindFileInPath() means we have to mock it in
test suite because dnsmasqCaps are created in
networkxml2conftest.

Moreover, we don't need to check for dnsmasq in configure.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-01-18 15:19:47 +01:00
Ivan Teterevkov
19407e8d7d meson: Detect rst2html5 and rst2man only when needed
Detect these commands in docs/meson.build, i.e. only when
users enable documentation.

Signed-off-by: Ivan Teterevkov <ivan.teterevkov@nutanix.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-01-14 18:17:56 +01:00
Jiri Denemark
fdc5f5d7ac Post-release version bump to 8.1.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-01-14 15:17:26 +01:00
Andrea Bolognani
c97075e1e4 meson: Fix yajl workaround
Meson reports

  WARNING: pkgconfig variable 'cflags' not defined for dependency yajl.

which makes sense, because "cflags" is not one of the variables
reported by

  $ pkg-config --print-variables yajl

and

  $ pkg-config --variable=cflags yajl

doesn't work either.

The breakage was introduced when we switched from calling
pkg-config directly to using get_pkgconfig_variable() in 7.5.0
and, somehow, it went undetected until now.

Use "includedir", which is a proper pkg-config variable,
instead.

Fixes: c32c5ca29a
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Tested-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
2022-01-10 09:46:06 +01:00
Andrea Bolognani
4512f3203f meson: Don't look for btrfs and xfs headers
We no longer use them anywhere.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-01-04 15:46:08 +01:00
Andrea Bolognani
5a781738d1 meson: Don't require the parted command at build time
We need libparted to be available at build time otherwise we
can't link against it; we don't, however, need the parted
command to be present until runtime and, just as is the case
for other commands, we already perform a lookup through the
virCommand API so making sure it's available at build time
is unnecessary.

This doesn't make any difference for platform such as Fedora
and CentOS, where both the library and the command are in the
same package, but others like Debian, Ubuntu and openSUSE
have separate packages for the two components and this change
means that we can install one less package at build time.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-01-03 11:39:49 +01:00
Ján Tomko
7a50e524df build: do not search for radvd binary
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-12-15 15:28:17 +01:00
Michal Privoznik
be592a6ebb meson: Detect XDR only when needed
If remote driver was disabled there is no need to check whether
host has a XDR library installed.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/196
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-15 12:12:44 +01:00
Michal Privoznik
a642cc648c meson: Require XDR for wireshark
The way our wireshark dissector works is by providing decoders
for primitive types (like integers, string, double, etc.) and
then parsing virsomethingprotocol.x files and generating complex
decoders for RPC. This obviously means that XDR is required for
the dissector, but corresponding check was missing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-15 12:12:44 +01:00
Andrea Bolognani
c71181b666 meson: Improve network driver enablement logic
The Homebrew package explicitly enables this driver despite us
disabling it by default on macOS, so it must be functional to
at least some extent and certainly can't be causing any build
failures.

Additionally, if the user has explicitly asked for the network
driver to be enabled but libvirtd is disabled for whatever
reason, we should error out instead of silently disabling the
network driver.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-06 11:13:51 +01:00
Jiri Denemark
83131a4ecc Post-release version bump to 8.0.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-12-01 10:53:20 +01:00
Roman Bogorodskiy
537c8e5e24 meson: fix cpuset_getaffinity() detection
The cpuset_getaffinity() function is checked in sys/cpuset.h to see if
BSD CPU affinity APIs are available. This check requires including
sys/param.h to work properly, otherwise the test program fails with
unrelated errors like:

/usr/include/sys/cpuset.h:155:1: error: unknown type name
'__BEGIN_DECLS'
__BEGIN_DECLS
^
/usr/include/sys/cpuset.h:156:12: error: unknown type name 'cpusetid_t';
did you mean 'cpuset_t'?
int     cpuset(cpusetid_t *);

and so forth.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-24 10:43:28 +04:00
Roman Bogorodskiy
c07cf0a686 meson: improve CPU affinity routines check
Recently, FreeBSD has got sched_get/setaffinity(3) implementations and
the sched.h header as well [1]. To make these routines visible,
users have to define _WITH_CPU_SET_T.

This breaks current detection. Specifically, meson sees the
sched_getaffinity() symbol and defines WITH_SCHED_GETAFFINITY. This
define unlocks Linux implementation of virProcessSetAffinity() and other
functions, which fails to build on FreeBSD because cpu_set_t is not
visible as _WITH_CPU_SET_T is not defined.

For now, change detection to the following:

 - Instead of checking sched_getaffinity(), check if 'cpu_set_t' is
   available through sched.h
 - Explicitly check the sched.h header instead of assuming its presence
   if WITH_SCHED_SETSCHEDULER is defined

1:
https://cgit.freebsd.org/src/commit/?id=43736b71dd051212d5c55be9fa21c45993017fbb
https://cgit.freebsd.org/src/commit/?id=160b4b922b6021848b6b48afc894d16b879b7af2
https://cgit.freebsd.org/src/commit/?id=90fa9705d5cd29cf11c5dc7319299788dec2546a

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2021-11-23 15:11:00 +04:00
Andrea Bolognani
794af15f24 meson: Introduce qemu_datadir option
There is no guarantee that QEMU and libvirt have been configured
with the same prefix.

In particular, Homebrew on macOS will pass a different, private
prefix for each package version and then use symlinks to make
the files for a specific version appear in the usual locations.

This works perfectly fine as long as one package doesn't try to
go poking around another package's data - which is exactly what
libvirt needs to do in order to read and parse the QEMU interop
data.

qemu_datadir can now be explicitly provided to make this and
other uncommon scenarios work. The common scenario, where QEMU
and libvirt both use the same prefix, is unaffected.

https://gitlab.com/libvirt/libvirt/-/issues/168

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-11-18 15:48:59 +01:00
Andrea Bolognani
591cb9d0d5 meson: Define qemu_moddir correctly
We can't hardcode /usr here, because the user might have
configured whatever arbitrary prefix.

Everything appeared to be okay because when joining paths
Meson will drop any component that precedes an absolute path
and libdir happens to be absolute, but we should still do
things correctly instead of relying on this.

Fixes: 2ad009eadd
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-11-18 15:48:49 +01:00
Andrea Bolognani
506c3a39d6 meson: Stop looking up ZFS programs at build time
At this point, we're no longer using the availability of the
ZFS programs at build time to decide whether to enable ZFS
support, so the only purpose of these find_program() calls is
to record their absolute paths.

However, the virCommand facilities that we're ultimately using
to run them are already capable of performing this lookup at
runtime, and in fact that's exactly what we already do in the
case of, for example, vstorage.

Drop the build time lookups and always perform them at runtime.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2021-11-04 19:02:06 +01:00
Andrea Bolognani
ca4dc9613f meson: Enable ZFS storage backend even more often
Commit 73a2ff3616 already improved the situation a lot. This
pushes things even further.

If the user or, more likely, the distro packager explicitly
asked for ZFS support to be enabled, then we should comply with
that request regardless of whether the necessary programs are
available at build time.

This is particularly important in the context of Debian, where
ZFS cannot be a build dependency of libvirt due to licensing
issues but it can still be an optional runtime dependency.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2021-11-04 19:01:55 +01:00
Andrea Bolognani
958f8fe8c4 meson: Fix rst2html5 detection
The first part of the version string contains the name that the
rst2html5 command was invoked as, which can differ based on the
operating system: on FreeBSD, for example, it's rst2html5.py
instead of just rst2html5.

Fix our detection logic so that it works regardless of the
specific name used for the docutils-provided rst2html5 command.

Fixes: cf0c9e1865
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2021-11-03 13:48:54 +01:00
Andrea Bolognani
cf0c9e1865 meson: Detect and reject invalid rst2html5 command
The version coming from the rst2html5 package instead of the
docutils package is unable to successfully generate the libvirt
documentation.

Examples of users encountering build issues because of the wrong
version of rst2html5 being installed on their systems:

  https://gitlab.com/libvirt/libvirt/-/issues/40
  https://gitlab.com/libvirt/libvirt/-/issues/139
  https://gitlab.com/libvirt/libvirt/-/issues/169
  https://gitlab.com/libvirt/libvirt/-/issues/195

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2021-11-03 10:10:54 +01:00
Jiri Denemark
5a76801251 Post-release version bump to 7.10.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-11-01 13:22:53 +01:00
Jiri Denemark
e2999909fc Post-release version bump to 7.9.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-10-01 10:38:45 +02:00
Tim Wiederhake
7c98320278 meson: Increase stack size limit for sanitizer builds
When building with "CC=clang", "-Db_sanitize=address,undefined", and
"-Dbuildtype=debug", the following error occurs:

    ../src/conf/nwfilter_conf.c:2190:1: error: stack frame size of 10616
    bytes in function 'virNWFilterRuleDefFixup' [-Werror,-Wframe-larger-than=]
    virNWFilterRuleDefFixup(virNWFilterRuleDef *rule)
    ^
    1 error generated.

Enforcing stack frame only makes sense on normal builds when stack usage
is deterministic.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-24 16:37:06 +02:00
Michal Privoznik
73a2ff3616 meson: Enable ZFS storage backend more often
Currently, the ZFS storage backend is enabled only if both zfs
and zpool binaries were found during configure phase. This is not
consistent with our attempts to move dependencies on binaries
from compile to runtime. And also it is inconsistent with other
backends, e.g. vstorage.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-09-21 14:10:03 +02:00
Michal Privoznik
4775613527 meson: Don't set $PROG_PATH macros
Now, that there is no user of $PROG_PATH macros the meson script
can be changed so that it doesn't set those macros. It's
redundant as $PROG macro contains the same value.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-09-21 14:09:56 +02:00
Ján Tomko
3376179092 Revert "meson: avoid bogus warnings from clang and g_autoptr"
Commit 345996c620 disabled the
-Wunused-but-set-variable warning on CLang, beacuse it warned
on variables that were unread, but we relied on the side effects
of their destructors.

Reinstate the warning now that all the occurrences have been fixed.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-09-08 16:19:55 +02:00
Daniel P. Berrangé
345996c620 meson: avoid bogus warnings from clang and g_autoptr
Clang has previously had trouble with G_DEFINE_AUTOPTR_CLEANUP_FUNC
generated code, thinking it was unused. We turn off -Wunused-function
to avoid tripping up on that with CLang.

New Clang has started having trouble with g_autoptr now too. In usage
scenarios where the variable is set, but never again read, it thinks
it is unused not realizing the destructor has useful side effects.
For this we have to skip -Wunused-but-set-variable on CLang.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-01 15:29:28 +01:00
Jiri Denemark
7d12421835 Post-release version bump to 7.8.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-09-01 13:46:34 +02:00
Ján Tomko
c6bcc4753d run: set abs_builddir variables
test-lib.sh needs these to be set.

Export them so that the virsh-* tests can be run using:
  builddir$ ./run srcdir/tests/virsh-snapshot

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2021-08-12 10:33:55 +02:00
Andrea Bolognani
556022c4dc meson: Use 'rst2html5' instead of 'rst2html' everywhere
We only use the HTML5 version these days.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2021-08-10 16:33:07 +02:00
Jiri Denemark
919f25d36e Post-release version bump to 7.7.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-08-02 12:27:55 +02:00
Daniel P. Berrangé
429312d686 meson: disable bogus warnings from sanitizers on Fedora
When building with sanitizers on Fedora we get a wierd error
message

In file included from /usr/include/string.h:519,
                 from ../src/internal.h:28,
                 from ../src/util/virsocket.h:21,
                 from ../src/util/virsocketaddr.h:21,
                 from ../src/util/virnetdevip.h:21,
                 from ../src/util/virnetdevip.c:21:
In function ‘memcpy’,
    inlined from ‘virNetDevGetifaddrsAddress’ at ../src/util/virnetdevip.c:702:13,
    inlined from ‘virNetDevIPAddrGet’ at ../src/util/virnetdevip.c:754:16:
/usr/include/bits/string_fortified.h:29:10: error: ‘__builtin_memcpy’ offset [2, 27] from the object at ‘addr’ is out of the bounds of referenced subobject ‘ss_family’ with type ‘short unsigned int’ at offset 0 [-Werror=array-bounds]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/bits/socket.h:175,
                 from /usr/include/sys/socket.h:33,
                 from ../src/util/virsocket.h:66,
                 from ../src/util/virsocketaddr.h:21,
                 from ../src/util/virnetdevip.h:21,
                 from ../src/util/virnetdevip.c:21:
../src/util/virnetdevip.c: In function ‘virNetDevIPAddrGet’:
/usr/include/bits/socket.h:193:5: note: subobject ‘ss_family’ declared here
  193 |     __SOCKADDR_COMMON (ss_);    /* Address family, etc.  */
      |     ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

The code is correct, and this only happens when building at -O2.

The docs for -Warray-bounds say that a value of "2" is known to
be liable to generate false positives. Rather than downgrade the
check everywhere, we do it selectively for sanitizers.

Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-07-20 16:07:09 +01:00
Pavel Hrdina
988beaf1d0 meson: check for XDR and driver_remote early
We have several other options that depend on result of `driver_remote`
option check so we need to do it early to have the result available.

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/185
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-07-07 15:25:11 +02:00
Jiri Denemark
2f8ee6a69d Post-release version bump to 7.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-07-01 15:44:22 +02:00
Daniel P. Berrangé
b9f9df9f2d build: fix logic for enabling libssh/libssh2 checks
When 'driver_remote' is 'auto', the 'enabled()' method does not
evaluate to true, causing the libssh/libssh2 checks to be skipped.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-06-23 18:43:22 +01:00
Daniel P. Berrangé
3e9b561139 remote: add support for probing drivers with modular daemons
With the traditional libvirtd, the virConnectOpen call will probe active
drivers server side to find which one to use when the URI is NULL/empty.

With the modular daemons though, the remote client does not know which
daemon to connect in the first place, so we can't rely on virConnectOpen
probing. Currently the virtproxyd daemon has code to probe for a
possible driver by looking at which sockets are listening or which
binaries are installed. The remote client can thus connect to virtproxyd
which in turn can connect to a real hypervisor driver.

The virtproxyd probing code though isn't something that needs to live in
virtproxyd. By moving it into the remote client we can get probing
client side in all scenarios and avoid the extra trip via virtproxyd in
the common case.

Tested-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-06-18 16:19:53 +01:00
Jim Fehlig
68940b3fb3 Xen: Bump minimum supported Xen version to 4.9
Platforms supported by libvirt have the following Xen versions

openSUSE Leap 15.2: 4.13
openSUSE Leap 15.3: 4.14
         Fedora 33: 4.14
      Ubuntu 18.04: 4.9
      Ubuntu 20.04: 4.11
     Debian Stable: 4.11

Bumping the minimum version doesn't allow us to drop much code, but it
does provide better alignment with libvirt's platform support statement.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2021-06-17 10:11:56 -06:00
Tim Wiederhake
c9ced46673 meson: Allow undefined symbols when sanitizers are enabled
When enabling sanitizers, clang adds some function symbols when
instrumenting the code. The exact names of those functions are an
implementation detail and should therefore not be added to any
syms file. This patch prevents build failures due to those symbols
not present in the syms file when building with sanitizers enabled.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-06-14 12:05:41 +02:00
Tim Wiederhake
c46556c280 meson: Allow larger stack frames when instrumenting
When enabling sanitizers, gcc adds some instrumentation to the code
that may enlarge stack frames. Some function's stack frames are already
close to the limit of 4096 and are enlarged past that threshold,
e.g. virLXCProcessStart which reaches a frame size of 4624 bytes.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-06-14 12:05:10 +02:00
Thomas Huth
55aaa1b037 meson.build: Compile with -Walloca
We are already compiling libvirt with -Wvla - so it does not make
too much sense to still allow people to use alloca() instead. Thus
put it on the list of things we want to warn about. Fortunately,
there is currently no warning with this flag, so the current
sources should be clean.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-06-08 13:59:43 +02:00
Thomas Huth
6a7b8a3c0f meson.build: Remove the -Wvla-larger-then flag
The flag has a typo in it, it's "...-than=..." and not "...-then=...",
so this was in fact never used. Since we're also using -Wvla (without
size), we should already get warnings about any variable length arrays
anyway, so the additional "-Wvla-larger-than" does not make much sense
and thus we can simply drop this.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-06-08 13:59:43 +02:00
William Douglas
56fbabf1a1 Add basic driver for the Cloud-Hypervisor
Cloud-Hypervisor is a KVM virtualization using hypervisor. It
functions similarly to qemu and the libvirt Cloud-Hypervisor driver
uses a very similar structure to the libvirt driver.

The biggest difference from the libvirt perspective is that the
"monitor" socket is seperated into two sockets one that commands are
issued to and one that events are notified from. The current
implementation only uses the command socket (running over a REST API
with json encoded data) with future changes to add support for the
event socket (to better handle shutdowns from inside the VM).

This patch adds support for the following initial VM actions using the
Cloud-Hypervsior API:
 * vm.create
 * vm.delete
 * vm.boot
 * vm.shutdown
 * vm.reboot
 * vm.pause
 * vm.resume

To use the Cloud-Hypervisor driver, the v15.0 release of
Cloud-Hypervisor is required to be installed.

Some additional notes:
 * The curl handle is persistent but not useful to detect ch process
 shutdown/crash (a future patch will address this shortcoming)
 * On a 64-bit host Cloud-Hypervisor needs to support PVH and so can
 emulate 32-bit mode but it isn't fully tested (a 64-bit kernel and
 32-bit userspace is fine, a 32-bit kernel isn't validated)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
2021-06-04 10:56:06 +01:00
Andrea Bolognani
b1774e4e0f meson: Style tweaks
These checks look different than most similar ones for no
particular reason.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2021-06-01 14:32:02 +02:00