Commit Graph

45659 Commits

Author SHA1 Message Date
Michal Privoznik
a54391fbc2 remote_daemon: Don't run virStateCleanup() if virStateReload() is still running
When a SIGHUP is received a thread is spawned that runs
virStateReload(). However, if SIGINT is received while the former
thread is still running then we may get into problematic
situation: the cleanup code in main() sees drivers initialized
and thus calls virStateCleanup(). So now we have two threads, one
running virStateReload() the other virStateCleanup(). In this
situation it's very likely that a race condition occurs and
either of threads causes SIGSEGV.

To fix this, unmark drivers as initialized in the
virStateReload() thread for the time the function runs.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2075837
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-23 14:44:50 +02:00
Andrea Bolognani
2b98d5d91d apparmor: Allow locking AAVMF firmware
We already allow this for OVMF.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/312
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-23 14:01:21 +02:00
Andrea Bolognani
8d160b7979 syntax-check: Introduce sc_linguas_sorting
Make sure LINGUAS remains sorted correctly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 13:58:29 +02:00
Andrea Bolognani
6a2fea9283 po: Sort LINGUAS
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 13:58:28 +02:00
Andrea Bolognani
bed3781a30 syntax-check: Don't exclude src/false.c from sc_po_check
This is something that certainly made sense in the context of
gnulib, but we don't have a use for it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 13:58:26 +02:00
Andrea Bolognani
55ae46a6df po: Don't generate POTFILES
Now that we have dropped prefixes from the file, it no longer
needs to go through configure_file() and we can use it directly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 13:58:25 +02:00
Andrea Bolognani
4172d1aedc po: Drop prefixes from POTFILES.in
Commit 8beb7fdd0e changed the handling of POTFILES so that it
could cope with files being located in either the source or build
directory: it did so by adding @SRCDIR@ and @BUILDDIR@
respectively at the beginning of each line, and then converting
them back to the actual values when generating POTFILES from
POTFILES.in.

Later, commit c6a0d3ff8b started passing --directory to
xgettext, which resulted in the tool being able to locate files
regardless of whether they are in the source or build directory.
However, @SRCDIR@ and @BUILDDIR@ were still added to POTFILES.in
only to be stripped when generating POTFILES.

Simplify things by not storing information that we know we're
going to discard later.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 13:58:24 +02:00
Andrea Bolognani
325dd585fb po: Stop using 'glib' preset for i18n.gettext()
Due to a bug in meson versions earlier than 0.60, the
--add-comments that's part of the 'glib' preset and the
--add-comments=TRANSLATORS: that we add ourselves might be
passed to xgettext in the wrong order, resulting in a bunch of
comments that we don't care about being added to the potfile.

Most of the options included in the 'glib' preset are not
applicable to libvirt anyway, so just stop using the preset and
pass a few extra options explicitly instead.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 13:58:22 +02:00
Andrea Bolognani
a4ed1e935f po: Drop unwanted comments from potfile
These managed to sneak in as part of ec02f5719a, when the
potfile was last refreshed, but are not supposed to be there.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 13:58:03 +02:00
Jiri Denemark
c500955e95 qemu: Fix error propagation in qemuMigrationBegin
Commit v8.3.0-152-g49ef0f95c6 removed explicit VIR_FREE from
qemuMigrationBegin, effectively reverting v1.2.14-57-g77ddd0bba2

The xml variable was used to hold the return value and thus had to be
unset when an error happened after xml was already non-NULL. Such code
may be quite confusing though and we usually avoid it by not storing
anything to a return variable until everything succeeded.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-23 13:13:37 +02:00
Max Goodhart
42cb548045
Allow VM to read sysfs PCI config, revision files
This fixes a blank screen when viewing a VM with virtio graphics and
gl-accelerated Spice display on Ubuntu 22.04 / libvirt 8.0.0 / qemu 6.2.

Without these AppArmor permissions, the libvirt error log contains
repetitions of:

qemu_spice_gl_scanout_texture: failed to get fd for texture

This appears to be similar to this GNOME Boxes issue:
https://gitlab.gnome.org/GNOME/gnome-boxes/-/issues/586

Fixes: https://launchpad.net/bugs/1972075

Signed-off-by: Max Goodhart <c@chromakode.com>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2022-05-20 07:37:14 +02:00
Jiri Denemark
1bd24e79be util: Do not report useless error in virPortAllocatorRelease
If the port allocator bitmap does not have enough bits to keep the state
of the port we're going to release, the port is not reserved and thus is
trivially released without doing anything. No need to report an error in
such case.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-19 17:40:31 +02:00
Martin Kletzander
b7b8cd6ad6 apparmor: Add support for dbus chardev
Commit 7648e40da5 added support for dbus chardev but forgot to handle it in
AppArmor code.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-19 14:15:02 +02:00
Marc-André Lureau
89d789670d docs: document <graphics> type dbus
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:42 +02:00
Marc-André Lureau
3fa987cc42 qemu: add usbredir type 'dbus'
The USB device redirection works in a similar way as Spice. The
underlying 'dbus' channel is set to "org.qemu.usbredir" by default for
the client to identify the channel purpose (as specified in -display
dbus documentation).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:40 +02:00
Marc-André Lureau
53905292f9 qemu: add -chardev dbus support
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:37 +02:00
Marc-André Lureau
7648e40da5 conf: add <serial type='dbus'>
Like a Spice port, a dbus serial must specify an associated channel name.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:35 +02:00
Marc-André Lureau
1ce258a570 qemu: add audio type 'dbus'
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:32 +02:00
Marc-André Lureau
a062f5f777 conf: add <audio type='dbus'> support
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:28 +02:00
Marc-André Lureau
bf213aa965 virsh: report the D-Bus bus URI for domdisplay
This implementation reports only Unix bus address using the URI format
proposed in https://gitlab.freedesktop.org/dbus/dbus/-/issues/348.

We prefer a URI form over the D-Bus address form, since all other
display protocols use a URI, allowing to distinguish between protocols
and making client implementation simpler.

Other transports (for example TCP) are not yet handled.

The client is assumed to know what to lookup on the bus (the bus name,
path & interface of the VM, eventually matching its UUID)

P2P mode doesn't report any available URI.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:24 +02:00
Marc-André Lureau
bde66322e8 qemu: add -display dbus support
By default, libvirt will start a private bus and tell QEMU to connect to
it. Instead, a D-Bus "address" to connect to can be specified, or the
p2p mode enabled.

D-Bus display works best with GL & a rendernode, which can be specified
with <gl> child element.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:20 +02:00
Marc-André Lureau
5c1e203a80 qemu: start the D-Bus daemon for the display
Start the daemon if necessary (it is already stopped in qemuProcessStop)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:17 +02:00
Marc-André Lureau
88ba34f5a0 conf: add <graphics type='dbus'>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:09 +02:00
Marc-André Lureau
14f45e5d8d qemu: add -display dbus capability check
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:35:26 +02:00
Michal Privoznik
b3e2fea3e8 remoteOpenConn: Pass correct variable to virConnectSetIdentity()
The remoteOpenConn() function was refactored recently. As a part
of that new variable @newconn was introduced which holds
virConnect object as it's being gradually constructed throughout
the function. At the very end, when everything succeeded the
variable is stolen into passed @conn. However, there was one
line missed in the refactor which still access the @conn instead
of @newconn leading to a NULL dereference.

Fixes: f7c422993e
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-05-19 10:15:48 +02:00
Han Han
577c336151 docs: drvqemu: Fix the syntax typo of Hypervisor.framework link
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-19 10:10:33 +02:00
Han Han
5ce918f3a5 docs: drivers: Mention KVM/HVF in the link of qemu driver
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-19 10:10:31 +02:00
Han Han
f073783979 news: Add news for rss and rss_hash_report attributes
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-19 10:10:30 +02:00
Han Han
facaa9ae98 docs: formatdomain: Add the introduced versions of net rss attrs
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-19 10:10:29 +02:00
Han Han
49b5200e16 docs: apps: Add desktop app gnome-boxes
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-19 10:10:23 +02:00
Han Han
1bd51b6afe news: Validation flags for creating net, nwfilter-binding, net port
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:57:36 +02:00
Han Han
5c1a99ff83 news: Add queue_size option to virtio disk
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:56:20 +02:00
Han Han
6921c2cf73 news: Support vhostuser in virsh attach-interface
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:56:15 +02:00
Han Han
07d950adda news: qemu: Add support for NFS disk protocol
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:59 +02:00
Han Han
4b4a7153d0 news: cpu_map: Add Snowridge cpu model
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:58 +02:00
Han Han
6e5852cb4b news: qemu: support kvm-poll-control performance hint
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:56 +02:00
Han Han
c9a37b64df news: Introduce "migrate_tls_force" to qemu.conf
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:55 +02:00
Han Han
c04bb76af7 news: qemu: Add 'fmode' and 'dmode' options for 9pfs
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:54 +02:00
Han Han
17fe7ae0cb news: qemu: virtiofs can be used without NUMA nodes
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:53 +02:00
Han Han
95f9d4290c news: qemu: Introduce virtio free page reporting feature
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:51 +02:00
Han Han
49211723b6 news: qemu: Set noqueue qdisc for TAP devices
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:50 +02:00
Han Han
28deb22485 news: logging: allow max_len=0 to disable log rollover
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:49 +02:00
Han Han
07666093f7 news: cpu: Support for XML validation in cpu comparison
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:48 +02:00
Han Han
0529cf77f2 news: cpu_map: Add EPYC-Rome cpu model
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:46 +02:00
Han Han
02c898d801 news: support device stats collection for SR-IOV VF hostdev
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:42 +02:00
Han Han
cb12f8b8c8 news: make SEV attrs 'cbitpos' & 'reducedPhysBits' optional
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:34 +02:00
Peter Krempa
f7c422993e doRemoteOpen: Refactor control flow
Use a temporary variable 'newconn' to hold the newly opened connection
until we are ready to pass it back instead of the original connection.

This way we can avoid complicated 'error'/'cleanup' sections.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-18 13:46:30 +02:00
Peter Krempa
7f50557c08 virIdentityGetParameters: Return 'virTypedParamList'
Refactor the code to use virTypedParamList which simplifies cleanup.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-18 13:46:30 +02:00
Peter Krempa
decc03857f virGetConnectGeneric: Fix memleak of 'identparams' when connecting between split daemons
The 'identparams' typed parameter list obtained from
virIdentityGetParameters is leaked when called from
'virGetConnectGeneric'.

Use 'virTypedParamListFromParams' to absorb it into a virTypedParamList
which can be autofreed.

Note that the memleak is observable only when running in split-daemon
mode.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/314
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-18 13:46:30 +02:00
Peter Krempa
45064119c1 util: typedparam: Introduce virTypedParamListFromParams
The helper constructs a virTypedParamList from loose params.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-18 13:46:30 +02:00