Commit Graph

39642 Commits

Author SHA1 Message Date
Michal Privoznik
01559528e5 virnetdev: Introduce virNetDevSetRootQDisc()
This helper changes the root qdisc on given interface.
Ideally, it would be written using netlink but my attempts to
write the code were not successful and thus I've fallen back to
virCommand() + tc.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2020-10-13 16:31:29 +02:00
Daniel Letai
6caaed65f2 rpm: remove rpath from rpms
The rpath improvements in:

  commit 69980ab798
  Author: Andrea Bolognani <abologna@redhat.com>
  Date:   Wed Aug 19 11:15:35 2020 +0200

    meson: Improve RPATH handling

missed that Fedora's %meson macro sets --auto-features=enabled, thus
force enabling rpath in the RPM build. Thus we need to explicitly
disable it

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Daniel Letai <dani@letai.org.il>
2020-10-13 11:27:27 +01:00
Daniel P. Berrangé
6938cd8830 logging: allow max_len=0 to disable log rollover
Currently setting max_len=0 causes virtlogd to spin in a busy loop. It
is natural to allow this to disable log rollover which can be useful for
developers debugging things.

Note disabling rollover exposes the host to denial of service from a
malicious guest, so must be used with care.

Closes https://gitlab.com/libvirt/libvirt/-/issues/85
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-10-13 10:51:43 +01:00
Pavel Hrdina
71a6522e4f conf: virsecretobj: fix g_new0 allocation
Fixes commit <d5b05614dfbc9bd60ea1a31a9cc32aaf3c771ddc> which changed
allocation from VIR_ALLOC_N to g_new0 but missed one +1 on number of
allocated elements.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2020-10-13 09:10:11 +02:00
Pavel Hrdina
8a666dccda conf: fix g_new0 allocation
Fixes commit <a5d88ffe0ad9b5d5314ab0058c5b363f9f79b8ee> which changed
allocation from VIR_ALLOC_N to g_new0 but missed some +1 on number of
allocated elements.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2020-10-13 09:10:11 +02:00
Cole Robinson
accdc0e773 qemu: migration: don't open storage driver too early
If storage migration is requested, and the destination storage does
not exist on the remote host, qemu's migration support will call
into the libvirt storage driver to precreate the destination storage.

The storage driver virConnectPtr is opened too early though, adding
an unnecessary dependency on the storage driver for several cases
that don't require it. This currently requires kubevirt to install
the storage driver even though they aren't actually using it.

Push the virGetConnectStorage calls to right before the cases they are
actually needed.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-10-12 16:18:49 -04:00
Roman Bogorodskiy
6ad23525e4 news: document bhyve virtio-9p support
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-10-12 15:26:18 +04:00
Roman Bogorodskiy
065eb39b41 docs: bhyve: document virtio-9p support
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-10-12 15:26:00 +04:00
Roman Bogorodskiy
476bf54e86 bhyve: fix virtio-9p src/dst order
For the virtio-9p bhyve command line argument, the proper order
is mount_tag=/path/to/host/dir, not the opposite.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-10-12 15:24:21 +04:00
Michal Privoznik
1450672071 virsocketaddr: Zero @netmask in virSocketAddrPrefixToNetmask()
The aim of virSocketAddrPrefixToNetmask() is to initialize passed
virSocketAddr structure based on prefix length and family.
However, it doesn't set all members in the struct which may lead
to reads of uninitialized values:

==15421== Use of uninitialised value of size 8
==15421==    at 0x50F297A: _itoa_word (in /lib64/libc-2.31.so)
==15421==    by 0x510C8FE: __vfprintf_internal (in /lib64/libc-2.31.so)
==15421==    by 0x5120295: __vsnprintf_internal (in /lib64/libc-2.31.so)
==15421==    by 0x50F8969: snprintf (in /lib64/libc-2.31.so)
==15421==    by 0x51BB602: getnameinfo (in /lib64/libc-2.31.so)
==15421==    by 0x496DEE0: virSocketAddrFormatFull (virsocketaddr.c:486)
==15421==    by 0x496DD9F: virSocketAddrFormat (virsocketaddr.c:444)
==15421==    by 0x11871F: networkDnsmasqConfContents (bridge_driver.c:1404)
==15421==    by 0x1118F5: testCompareXMLToConfFiles (networkxml2conftest.c:48)
==15421==    by 0x111BAF: testCompareXMLToConfHelper (networkxml2conftest.c:112)
==15421==    by 0x112679: virTestRun (testutils.c:142)
==15421==    by 0x111D09: mymain (networkxml2conftest.c:144)
==15421==  Uninitialised value was created by a stack allocation
==15421==    at 0x1175D2: networkDnsmasqConfContents (bridge_driver.c:1056)

All callers expect the function to initialize the structure
fully.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2020-10-12 09:24:26 +02:00
Roman Bogorodskiy
7382a7c2be bhyve: implement virtio-9p support
Recently virtio-9p support was added to bhyve.

On the host side it looks this way:

  bhyve .... -s 25:0,virtio-9p,sharename=/path/to/shared/dir

It could also have ",ro" suffix to make share read-only.

In the Linux guest, this share is mounted with:

  mount -t 9p sharename /mnt/sharename

In the guest user will see the same permissions and ownership
information for this directory as on the host. No uid/gid remapping is
supported, so those could resolve to wrong user or group names.

The same applies to the other side: chowning/chmodding in the guest will
set specified ownership and permissions on the host.

In libvirt domain XML it's modeled using the 'filesystem' element:

  <filesystem type='mount'>
    <source dir='/path/to/shared/dir'/>
    <target dir='sharename'/>
  </filesystem>

Optional 'readonly' sub-element enables read-only mode.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-10-09 18:46:04 +04:00
Pavel Hrdina
7c878cf9a7 tools: use g_autoptr for virCgroup
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2020-10-09 16:24:51 +02:00
Pavel Hrdina
a9932fc292 tests: use g_autoptr for virCgroup
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2020-10-09 16:24:49 +02:00
Pavel Hrdina
cfbd7befba util: use g_autoptr for virCgroup
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2020-10-09 16:24:47 +02:00
Pavel Hrdina
e4a8bbfaf2 qemu: use g_autoptr for virCgroup
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2020-10-09 16:24:44 +02:00
Pavel Hrdina
a9bb02cfc9 lxc: use g_autoptr for virCgroup
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2020-10-09 16:24:42 +02:00
Pavel Hrdina
ab8cc94ccc libvirt-lxc: use g_autoptr for virCgroup
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2020-10-09 16:24:40 +02:00
Pavel Hrdina
ca335643d6 util: vircgroup: introduce g_autoptr() for virCgroup
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2020-10-09 16:24:38 +02:00
Pavel Hrdina
5ad8272888 util: vircgroup: change virCgroupFree to take only virCgroupPtr
As preparation for g_autoptr() we need to change the function to take
only virCgroupPtr.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2020-10-09 16:24:35 +02:00
Pavel Hrdina
fed04cd635 util: vircgroup: use GLib alloc functions
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2020-10-09 16:24:33 +02:00
Pavel Hrdina
29c85e1664 qemu_cgroup: introduce qemuRestoreCgroupThread helper
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2020-10-09 16:23:08 +02:00
Tim Wiederhake
b31aa165e8 doc: Fix element name in description of "feature"
Actual change is "s/``elements``/``feature`` elements/", rest is
reflow.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2020-10-09 15:38:05 +02:00
Tim Wiederhake
cc5b1a562d docs: Remove references to "cpu_map.xml" in the documentation
"cpu_map.xml" was moved to a directory "cpu_map" and split up into
several files.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2020-10-09 15:38:05 +02:00
Tim Wiederhake
b763fbbd55 qemu: Remove references to "cpu_map.xml" in the code
"cpu_map.xml" was moved to a directory "cpu_map" and split up into
several files.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2020-10-09 15:38:05 +02:00
Tim Wiederhake
470dd74027 tests: Remove references to "cpu_map.xml" in the code
"cpu_map.xml" was moved to a directory "cpu_map" and split up into
several files.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2020-10-09 15:38:05 +02:00
Andrea Bolognani
974dc0a4c6 spec: Introduce arches_*
With this commit, all architecture lists that we base feature
enablement decisions on are defined within a few lines of each
other, increasing maintainability.

Additionally, generic architecture lists that appear in the
conditions for multiple features are defined, so that repetition
is reduced.

Note that a few checks (numactl, zfs, ceph) have been changed
from %ifarch to %ifnarch for consistency: while doing so, the
corresponding list of architectures has also been replaced with
the complement of the original one to ensure the overall behavior
would be preserved.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2020-10-09 14:34:28 +02:00
Andrea Bolognani
7f56b31562 spec: Refactor qemu_kvm_arches definition
There's no need to set a default for it if we're going to override
it immediately afterwards anyway, and setting with_qemu_tcg at the
same time only makes things more confusing.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2020-10-09 14:34:26 +02:00
Andrea Bolognani
e3000eb018 spec: Drop s390 architecture from conditionals
Neither Fedora nor RHEL build packages on this architecture.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
2020-10-09 14:34:25 +02:00
Andrea Bolognani
8ee421dd09 spec: Move _vpath_builddir definition
It belongs before package-specific feature flags are defined.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2020-10-09 14:34:24 +02:00
Andrea Bolognani
0fef1fed0b spec: Introduce with_dmidecode
To keep things maintainable, we want to have architecture handling
all in one spot instead of sprinkling %ifarch conditionals all over
the place.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2020-10-09 14:34:23 +02:00
Andrea Bolognani
33632cbeee spec: Move with_numactl definition
Keep it close to similar ones.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2020-10-09 14:34:21 +02:00
Andrea Bolognani
b9714eba27 spec: bash completion actually defaults to on
Remove the red herring.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2020-10-09 14:34:20 +02:00
Andrea Bolognani
c2402b818c spec: firewalld is always enabled
Knowing this, we can remove some code.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2020-10-09 14:34:18 +02:00
Andrea Bolognani
31d687a321 spec: Simplify setting features off by default
The right-hand side of these expressions will always evaluate to
zero. Stop obfuscating this fact.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2020-10-09 14:34:12 +02:00
Pavel Hrdina
67f08376fd meson: add tests build option to enable/disable unit tests
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-10-09 13:44:54 +02:00
Pavel Hrdina
033c5b8b0b meson: add docs option to enable/disable generating documentation
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-10-09 13:44:54 +02:00
Pavel Hrdina
b714efb99f meson: move build feature options to miscellaneous summary
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-10-09 13:44:54 +02:00
Pavel Hrdina
4bd0a5b180 meson: remove required libraries from summary
These are always enabled so it doesn't make any sense to have the result
in summary as meson will fail if they are missing.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-10-09 13:44:54 +02:00
Pavel Hrdina
3ff879d312 meson: add missing libraries to summary
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-10-09 13:44:54 +02:00
Pavel Hrdina
4b98a703ee meson: prefix kvm_dep, m_dep and util_dep with lib
We don't use the lib prefix for all libraries but in these cases it
makes sense to use the prefix.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-10-09 13:44:54 +02:00
Pavel Hrdina
b3e2ef408b meson: add libnl build option
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-10-09 13:44:54 +02:00
Pavel Hrdina
8485287485 meson: build nodedev driver only if libvirtd is compiled
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-10-09 13:44:54 +02:00
Pavel Hrdina
fc125d7e5c meson: properly handle readline if it's explicitly disabled
If readline is detected using pkg-config it would ignore the readline
option.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-10-09 13:44:54 +02:00
Pavel Hrdina
c8be9ccc36 meson: properly handle libpcap if it's explicitly disabled
If libpcap is detected using pkg-config it would ignore the libpcap
option.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-10-09 13:44:54 +02:00
Pavel Hrdina
87e855a4e9 meson: no need to call meson.get_compiler() again
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-10-09 13:44:54 +02:00
Pavel Hrdina
d3f8ddbfdf meson_options: move firewalld options to build feature options
These options don't check for any external libraries, they only enable
libvirt features.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-10-09 13:44:54 +02:00
Pavel Hrdina
f16327b04b meson_options: change VirtualBox default from enabled to auto
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-10-09 13:44:54 +02:00
Pavel Hrdina
58042c3a4a meson_options: change VMware default from enabled to auto
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-10-09 13:44:54 +02:00
Ján Tomko
4040d61731 remote: remove leftover goto
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reported-by: John Ferlan <jferlan@redhat.com>
Fixes: 8487595bee
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2020-10-09 13:03:59 +02:00
Fangge Jin
4e66123f89 qemu.conf: Re-word the description for *_tls_x509_verify
The original descirption for *_tls_x509_verify is a little misleading
by saying that "Enabling this option will reject any client who does
not have a ca-cert.pem certificate".

Signed-off-by: Fangge Jin <fjin@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-10-09 10:18:45 +02:00