]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
3 years agonodedev: add optional device address of channel device to css device
Boris Fiuczynski [Fri, 13 May 2022 10:31:15 +0000 (12:31 +0200)] 
nodedev: add optional device address of channel device to css device

Add the new introduced sysfs attribute dev_busid which provides the address
of the device in the subchannel independent from the bound device driver.
It is added if available in the sysfs as optional channel_dev_addr element into
the css device capabilty providing the ccw deivce address attributes cssid,
ssid and devno.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoschemas: refactor out nodedev ccw address schema
Boris Fiuczynski [Fri, 13 May 2022 10:31:14 +0000 (12:31 +0200)] 
schemas: refactor out nodedev ccw address schema

Refactor out nodedev ccw address schema for easy reuse later.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonodedev: refactor css XML parsing from ccw XML parsing
Boris Fiuczynski [Fri, 13 May 2022 10:31:13 +0000 (12:31 +0200)] 
nodedev: refactor css XML parsing from ccw XML parsing

In preparation for easier extension later.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonodedev: refactor ccw device address parsing from XML
Boris Fiuczynski [Fri, 13 May 2022 10:31:12 +0000 (12:31 +0200)] 
nodedev: refactor ccw device address parsing from XML

Move ccw device address XML parsing into new method for later reuse.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonodedev: refactor css format from ccw format method
Boris Fiuczynski [Fri, 13 May 2022 10:31:11 +0000 (12:31 +0200)] 
nodedev: refactor css format from ccw format method

In preparation for easier extension later.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: add virCCWDeviceAddressFromString to virccw
Boris Fiuczynski [Fri, 13 May 2022 10:31:10 +0000 (12:31 +0200)] 
util: add virCCWDeviceAddressFromString to virccw

Add a method to parse a ccw device address from a string.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: add ccw device address parsing into virccw
Boris Fiuczynski [Fri, 13 May 2022 10:31:09 +0000 (12:31 +0200)] 
util: add ccw device address parsing into virccw

Add virCCWDeviceAddressParseFromString and use it in nodedev udev.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: adjust method name virDomainDeviceCCWAddressParseXML
Boris Fiuczynski [Fri, 13 May 2022 10:31:08 +0000 (12:31 +0200)] 
conf: adjust method name virDomainDeviceCCWAddressParseXML

Adjust method name virDomainDeviceCCWAddressParseXML to
virCCWDeviceAddressParseXML.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: refactor virDomainDeviceCCWAddressEqual into virccw
Boris Fiuczynski [Fri, 13 May 2022 10:31:07 +0000 (12:31 +0200)] 
util: refactor virDomainDeviceCCWAddressEqual into virccw

Refactor virDomainDeviceCCWAddressEqual into virccw and rename method as
virCCWDeviceAddressEqual.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: refactor virDomainDeviceCCWAddressIsValid into virccw
Boris Fiuczynski [Fri, 13 May 2022 10:31:06 +0000 (12:31 +0200)] 
util: refactor virDomainDeviceCCWAddressIsValid into virccw

Refactor virDomainDeviceCCWAddressIsValid into virccw and rename method
as virCCWDeviceAddressIsValid.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: refactor virDomainCCWAddressIncrement into virccw
Boris Fiuczynski [Fri, 13 May 2022 10:31:05 +0000 (12:31 +0200)] 
util: refactor virDomainCCWAddressIncrement into virccw

Refactor virDomainCCWAddressIncrement into virccw and rename method as
virCCWDeviceAddressIncrement.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: refactor ccw address constants into virccw
Boris Fiuczynski [Fri, 13 May 2022 10:31:04 +0000 (12:31 +0200)] 
util: refactor ccw address constants into virccw

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: make reuse of ccw device address format constant
Boris Fiuczynski [Fri, 13 May 2022 10:31:03 +0000 (12:31 +0200)] 
util: make reuse of ccw device address format constant

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: refactor virDomainCCWAddressAsString into virccw
Boris Fiuczynski [Fri, 13 May 2022 10:31:02 +0000 (12:31 +0200)] 
util: refactor virDomainCCWAddressAsString into virccw

Move virDomainCCWAddressAsString into virccw and rename method as
virCCWDeviceAddressAsString.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: refactor virDomainDeviceCCWAddress into virccw.h
Boris Fiuczynski [Fri, 13 May 2022 10:31:01 +0000 (12:31 +0200)] 
util: refactor virDomainDeviceCCWAddress into virccw.h

Refactor ccw data structure virDomainDeviceCCWAddress into util virccw.h
and rename it as virCCWDeviceAddress.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonodedev: fix reported error msg in css cap XML parsing
Boris Fiuczynski [Fri, 13 May 2022 10:31:00 +0000 (12:31 +0200)] 
nodedev: fix reported error msg in css cap XML parsing

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoremote_daemon: Don't run virStateCleanup() if virStateReload() is still running
Michal Privoznik [Mon, 25 Apr 2022 08:31:56 +0000 (10:31 +0200)] 
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>
3 years agoapparmor: Allow locking AAVMF firmware
Andrea Bolognani [Mon, 23 May 2022 08:31:02 +0000 (10:31 +0200)] 
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>
3 years agosyntax-check: Introduce sc_linguas_sorting
Andrea Bolognani [Mon, 16 May 2022 18:35:21 +0000 (20:35 +0200)] 
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>
3 years agopo: Sort LINGUAS
Andrea Bolognani [Mon, 16 May 2022 18:25:28 +0000 (20:25 +0200)] 
po: Sort LINGUAS

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosyntax-check: Don't exclude src/false.c from sc_po_check
Andrea Bolognani [Mon, 16 May 2022 15:00:13 +0000 (17:00 +0200)] 
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>
3 years agopo: Don't generate POTFILES
Andrea Bolognani [Mon, 16 May 2022 14:57:08 +0000 (16:57 +0200)] 
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>
3 years agopo: Drop prefixes from POTFILES.in
Andrea Bolognani [Mon, 16 May 2022 14:46:16 +0000 (16:46 +0200)] 
po: Drop prefixes from POTFILES.in

Commit 8beb7fdd0e23 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 c6a0d3ff8b4e 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>
3 years agopo: Stop using 'glib' preset for i18n.gettext()
Andrea Bolognani [Wed, 18 May 2022 09:34:40 +0000 (11:34 +0200)] 
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>
3 years agopo: Drop unwanted comments from potfile
Andrea Bolognani [Mon, 16 May 2022 15:16:02 +0000 (17:16 +0200)] 
po: Drop unwanted comments from potfile

These managed to sneak in as part of ec02f5719a87, 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>
3 years agoqemu: Fix error propagation in qemuMigrationBegin
Jiri Denemark [Mon, 23 May 2022 10:27:51 +0000 (12:27 +0200)] 
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>
3 years agoAllow VM to read sysfs PCI config, revision files
Max Goodhart [Wed, 11 May 2022 22:08:39 +0000 (15:08 -0700)] 
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>
3 years agoutil: Do not report useless error in virPortAllocatorRelease
Jiri Denemark [Wed, 18 May 2022 07:14:15 +0000 (09:14 +0200)] 
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>
3 years agoapparmor: Add support for dbus chardev
Martin Kletzander [Thu, 19 May 2022 12:15:02 +0000 (14:15 +0200)] 
apparmor: Add support for dbus chardev

Commit 7648e40da50e added support for dbus chardev but forgot to handle it in
AppArmor code.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
3 years agodocs: document <graphics> type dbus
Marc-André Lureau [Fri, 13 May 2022 18:38:20 +0000 (20:38 +0200)] 
docs: document <graphics> type dbus

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: add usbredir type 'dbus'
Marc-André Lureau [Fri, 13 May 2022 18:38:19 +0000 (20:38 +0200)] 
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>
3 years agoqemu: add -chardev dbus support
Marc-André Lureau [Fri, 13 May 2022 18:38:18 +0000 (20:38 +0200)] 
qemu: add -chardev dbus support

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: add <serial type='dbus'>
Marc-André Lureau [Fri, 13 May 2022 18:38:17 +0000 (20:38 +0200)] 
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>
3 years agoqemu: add audio type 'dbus'
Marc-André Lureau [Fri, 13 May 2022 18:38:16 +0000 (20:38 +0200)] 
qemu: add audio type 'dbus'

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: add <audio type='dbus'> support
Marc-André Lureau [Fri, 13 May 2022 18:38:15 +0000 (20:38 +0200)] 
conf: add <audio type='dbus'> support

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: report the D-Bus bus URI for domdisplay
Marc-André Lureau [Fri, 13 May 2022 18:38:14 +0000 (20:38 +0200)] 
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>
3 years agoqemu: add -display dbus support
Marc-André Lureau [Fri, 13 May 2022 18:38:13 +0000 (20:38 +0200)] 
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>
3 years agoqemu: start the D-Bus daemon for the display
Marc-André Lureau [Fri, 13 May 2022 18:38:12 +0000 (20:38 +0200)] 
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>
3 years agoconf: add <graphics type='dbus'>
Marc-André Lureau [Fri, 13 May 2022 18:38:11 +0000 (20:38 +0200)] 
conf: add <graphics type='dbus'>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: add -display dbus capability check
Marc-André Lureau [Fri, 13 May 2022 18:38:10 +0000 (20:38 +0200)] 
qemu: add -display dbus capability check

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoremoteOpenConn: Pass correct variable to virConnectSetIdentity()
Michal Privoznik [Thu, 19 May 2022 07:54:16 +0000 (09:54 +0200)] 
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: f7c422993e4c7ca3e58b1d0d69f4772851af399f
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agodocs: drvqemu: Fix the syntax typo of Hypervisor.framework link
Han Han [Sat, 7 May 2022 01:17:40 +0000 (09:17 +0800)] 
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>
3 years agodocs: drivers: Mention KVM/HVF in the link of qemu driver
Han Han [Sat, 7 May 2022 01:17:39 +0000 (09:17 +0800)] 
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>
3 years agonews: Add news for rss and rss_hash_report attributes
Han Han [Sat, 7 May 2022 01:17:38 +0000 (09:17 +0800)] 
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>
3 years agodocs: formatdomain: Add the introduced versions of net rss attrs
Han Han [Sat, 7 May 2022 01:17:37 +0000 (09:17 +0800)] 
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>
3 years agodocs: apps: Add desktop app gnome-boxes
Han Han [Sat, 7 May 2022 01:17:36 +0000 (09:17 +0800)] 
docs: apps: Add desktop app gnome-boxes

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonews: Validation flags for creating net, nwfilter-binding, net port
Han Han [Wed, 11 May 2022 02:17:14 +0000 (10:17 +0800)] 
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>
3 years agonews: Add queue_size option to virtio disk
Han Han [Wed, 11 May 2022 02:17:13 +0000 (10:17 +0800)] 
news: Add queue_size option to virtio disk

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonews: Support vhostuser in virsh attach-interface
Han Han [Wed, 11 May 2022 02:17:12 +0000 (10:17 +0800)] 
news: Support vhostuser in virsh attach-interface

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonews: qemu: Add support for NFS disk protocol
Han Han [Wed, 11 May 2022 02:17:11 +0000 (10:17 +0800)] 
news: qemu: Add support for NFS disk protocol

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonews: cpu_map: Add Snowridge cpu model
Han Han [Wed, 11 May 2022 02:17:10 +0000 (10:17 +0800)] 
news: cpu_map: Add Snowridge cpu model

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonews: qemu: support kvm-poll-control performance hint
Han Han [Wed, 11 May 2022 02:17:09 +0000 (10:17 +0800)] 
news: qemu: support kvm-poll-control performance hint

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonews: Introduce "migrate_tls_force" to qemu.conf
Han Han [Wed, 11 May 2022 02:17:08 +0000 (10:17 +0800)] 
news: Introduce "migrate_tls_force" to qemu.conf

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonews: qemu: Add 'fmode' and 'dmode' options for 9pfs
Han Han [Wed, 11 May 2022 02:17:07 +0000 (10:17 +0800)] 
news: qemu: Add 'fmode' and 'dmode' options for 9pfs

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonews: qemu: virtiofs can be used without NUMA nodes
Han Han [Wed, 11 May 2022 02:17:06 +0000 (10:17 +0800)] 
news: qemu: virtiofs can be used without NUMA nodes

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonews: qemu: Introduce virtio free page reporting feature
Han Han [Wed, 11 May 2022 02:17:05 +0000 (10:17 +0800)] 
news: qemu: Introduce virtio free page reporting feature

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonews: qemu: Set noqueue qdisc for TAP devices
Han Han [Wed, 11 May 2022 02:17:04 +0000 (10:17 +0800)] 
news: qemu: Set noqueue qdisc for TAP devices

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonews: logging: allow max_len=0 to disable log rollover
Han Han [Wed, 11 May 2022 02:17:03 +0000 (10:17 +0800)] 
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>
3 years agonews: cpu: Support for XML validation in cpu comparison
Han Han [Wed, 11 May 2022 02:17:02 +0000 (10:17 +0800)] 
news: cpu: Support for XML validation in cpu comparison

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonews: cpu_map: Add EPYC-Rome cpu model
Han Han [Wed, 11 May 2022 02:17:01 +0000 (10:17 +0800)] 
news: cpu_map: Add EPYC-Rome cpu model

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agonews: support device stats collection for SR-IOV VF hostdev
Han Han [Wed, 11 May 2022 02:17:00 +0000 (10:17 +0800)] 
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>
3 years agonews: make SEV attrs 'cbitpos' & 'reducedPhysBits' optional
Han Han [Wed, 11 May 2022 02:16:59 +0000 (10:16 +0800)] 
news: make SEV attrs 'cbitpos' & 'reducedPhysBits' optional

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agodoRemoteOpen: Refactor control flow
Peter Krempa [Wed, 18 May 2022 09:18:54 +0000 (11:18 +0200)] 
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>
3 years agovirIdentityGetParameters: Return 'virTypedParamList'
Peter Krempa [Wed, 18 May 2022 09:12:30 +0000 (11:12 +0200)] 
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>
3 years agovirGetConnectGeneric: Fix memleak of 'identparams' when connecting between split...
Peter Krempa [Wed, 18 May 2022 08:49:34 +0000 (10:49 +0200)] 
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>
3 years agoutil: typedparam: Introduce virTypedParamListFromParams
Peter Krempa [Wed, 18 May 2022 08:46:52 +0000 (10:46 +0200)] 
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>
3 years agoTranslated using Weblate (Finnish)
Jan Kuparinen [Tue, 17 May 2022 19:18:47 +0000 (21:18 +0200)] 
Translated using Weblate (Finnish)

Currently translated at 22.9% (2386 of 10419 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/fi/

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
3 years agovirclosecallbacks: Don't pass opqaue pointer to callback invocation
Peter Krempa [Mon, 2 May 2022 13:24:51 +0000 (15:24 +0200)] 
virclosecallbacks: Don't pass opqaue pointer to callback invocation

Remove the argument from the function prototypes and the callback
handler.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agobhyveProcessAutoDestroy: Use 'driver' from VM private data
Peter Krempa [Mon, 2 May 2022 13:18:40 +0000 (15:18 +0200)] 
bhyveProcessAutoDestroy: Use 'driver' from VM private data

Access the 'driver' struct from the private data rather than the passed
opaque pointer in preparation to remove the opaque pointer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxcProcessAutoDestroy: Use 'driver' from VM private data
Peter Krempa [Mon, 2 May 2022 13:18:40 +0000 (15:18 +0200)] 
lxcProcessAutoDestroy: Use 'driver' from VM private data

Access the 'driver' struct from the private data rather than the passed
opaque pointer in preparation to remove the opaque pointer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuProcessAutoDestroy: Use 'driver' from VM private data
Peter Krempa [Mon, 2 May 2022 13:18:40 +0000 (15:18 +0200)] 
qemuProcessAutoDestroy: Use 'driver' from VM private data

Access the 'driver' struct from the private data rather than the passed
opaque pointer in preparation to remove the opaque pointer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuMigrationSrcCleanup: Use 'driver' from VM private data
Peter Krempa [Mon, 2 May 2022 13:18:40 +0000 (15:18 +0200)] 
qemuMigrationSrcCleanup: Use 'driver' from VM private data

Access the 'driver' struct from the private data rather than the passed
opaque pointer in preparation to remove the opaque pointer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxc: Store 'driver' in VM private data
Peter Krempa [Mon, 2 May 2022 13:17:31 +0000 (15:17 +0200)] 
lxc: Store 'driver' in VM private data

Similarly to the qemu driver if we store the immutable driver pointer in
the VM private data struct we don't have to questionably pass it through
opaque pointers to callbacks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agobhyve: Store 'driver' in VM private data
Peter Krempa [Mon, 2 May 2022 13:17:31 +0000 (15:17 +0200)] 
bhyve: Store 'driver' in VM private data

Similarly to the qemu driver if we store the immutable driver pointer in
the VM private data struct we don't have to questionably pass it through
opaque pointers to callbacks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuMigrationSrcBegin: Automatically free 'xml' variable on error
Peter Krempa [Fri, 29 Apr 2022 12:31:43 +0000 (14:31 +0200)] 
qemuMigrationSrcBegin: Automatically free 'xml' variable on error

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirObjectLockGuard: Require that returned value is used
Peter Krempa [Thu, 28 Apr 2022 11:16:34 +0000 (13:16 +0200)] 
virObjectLockGuard: Require that returned value is used

The returned value is used to unlock the object, so all callers must
necessarily make use of the returned value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirclosecallbacks.h: Reformat header to contemporary style
Peter Krempa [Thu, 28 Apr 2022 08:52:05 +0000 (10:52 +0200)] 
virclosecallbacks.h: Reformat header to contemporary style

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: fd: Fix documentation for FD set related functions
Peter Krempa [Tue, 17 May 2022 09:04:40 +0000 (11:04 +0200)] 
qemu: fd: Fix documentation for FD set related functions

When dealing with fdsets only we don't need to pass the FD first as we
now generate fdset name directly. Also there are no more caveats in
passing multiple FDs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuFDPassTransferCommand: Remove return value
Peter Krempa [Mon, 16 May 2022 15:17:20 +0000 (17:17 +0200)] 
qemuFDPassTransferCommand: Remove return value

Now that the 'direct' mode was separated and thus we don't have any
possible error case we can stop returning any values and simplify
callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: fd: Remove support for 'direct' fd passing from 'qemuFDPass'
Peter Krempa [Mon, 16 May 2022 14:25:31 +0000 (16:25 +0200)] 
qemu: fd: Remove support for 'direct' fd passing from 'qemuFDPass'

This finishes the separation of the fdset and direct helpers. Remove
'qemuFDPassNewDirect' and all internals which were applicable only in
direct mode.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuFDPassValidate: Don't validate file descriptors
Peter Krempa [Tue, 17 May 2022 08:32:47 +0000 (10:32 +0200)] 
qemuFDPassValidate: Don't validate file descriptors

The callers adding the FDs are validating them regardless so this check
was redundant.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Use 'qemuFDPassDirect' for 'unix' chardevs
Peter Krempa [Mon, 16 May 2022 14:08:18 +0000 (16:08 +0200)] 
qemu: Use 'qemuFDPassDirect' for 'unix' chardevs

Unix socket chardevs with FD passing need to use the direct mode so we
need to convert it to use qemuFDPassDirect.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Convert passing of 'slirpfd' to 'qemuFDPassDirect'
Peter Krempa [Mon, 16 May 2022 13:08:05 +0000 (15:08 +0200)] 
qemu: Convert passing of 'slirpfd' to 'qemuFDPassDirect'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Convert passing of 'tapfds' to 'qemuFDPassDirect'
Peter Krempa [Mon, 16 May 2022 13:08:05 +0000 (15:08 +0200)] 
qemu: Convert passing of 'tapfds' to 'qemuFDPassDirect'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Convert passing of 'vhostfd' to 'qemuFDPassDirect'
Peter Krempa [Mon, 16 May 2022 13:08:05 +0000 (15:08 +0200)] 
qemu: Convert passing of 'vhostfd' to 'qemuFDPassDirect'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: fd: Add a distinct set of APIs for 'direct' fd passing mode
Peter Krempa [Mon, 16 May 2022 12:57:57 +0000 (14:57 +0200)] 
qemu: fd: Add a distinct set of APIs for 'direct' fd passing mode

Originally I envisioned a common set of APIs for both FD passing
approaches but it turns out they are not really compatible enough for it
to make sense to use one set of APIs.

As of such introduce a distinct set of APIs for the 'direct' mode, which
will later be used to convert all places that currently use
'qemuFDPassNewDirect' and later clean up the existing APIs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: EVENTHANDLERS.txt: Move to kbase and rSTisze
Peter Krempa [Fri, 13 May 2022 11:13:02 +0000 (13:13 +0200)] 
qemu: EVENTHANDLERS.txt: Move to kbase and rSTisze

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: MIGRATION.txt: Move to kbase and rSTisze
Peter Krempa [Fri, 13 May 2022 11:13:02 +0000 (13:13 +0200)] 
qemu: MIGRATION.txt: Move to kbase and rSTisze

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: THREADS.txt: rSTize and move to knowledge-base
Peter Krempa [Fri, 13 May 2022 11:02:21 +0000 (13:02 +0200)] 
qemu: THREADS.txt: rSTize and move to knowledge-base

Move the internal documentation about qemu threading to the knowledge
base.

The conversion included rstizing of the text document, mainly just
fixing of the headline and enclosing function names and code examples
into code block sections.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuBuildCommandLine: Remove 'flags' argument
Peter Krempa [Mon, 16 May 2022 11:55:25 +0000 (13:55 +0200)] 
qemuBuildCommandLine: Remove 'flags' argument

The flags are not used for anything.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemuBuildCommandLine: Don't avoid '-S' flag for 'domxml-to-native' conversion
Peter Krempa [Mon, 16 May 2022 11:51:13 +0000 (13:51 +0200)] 
qemuBuildCommandLine: Don't avoid '-S' flag for 'domxml-to-native' conversion

The commandline generated from our XML->native convertor is the majority
of cases not usable without libvirt anyways and the situation will not
improve any more.

As of such there's no much utility of avoiding the use of stopped CPUs
flag in such case.

Remove the QEMU_BUILD_COMMAND_LINE_CPUS_RUNNING flag and the associated
logic.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemuBuildCommandLine: Inline qemuCheckFips
Peter Krempa [Mon, 16 May 2022 11:47:28 +0000 (13:47 +0200)] 
qemuBuildCommandLine: Inline qemuCheckFips

Now that we store the state of the host FIPS mode setting in the qemu
driver object, we don't need to outsource the logic into
'qemuCheckFips'.

Additionally since we no longer support very old qemu's which would not
yet have --enable-fips we can drop the part of the comment about very
old qemus.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemuBuildCommandLine: Remove 'driver' argument
Peter Krempa [Mon, 16 May 2022 11:32:59 +0000 (13:32 +0200)] 
qemuBuildCommandLine: Remove 'driver' argument

We pass 'vm' which already contains it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemuConnectDomainXMLToNative: Refactor cleanup
Peter Krempa [Mon, 16 May 2022 11:27:41 +0000 (13:27 +0200)] 
qemuConnectDomainXMLToNative: Refactor cleanup

Automatically free the 'vm' temporary domain object and remove the
'cleanup' label and 'ret' helper variable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemuBuildCommandLine: Sanitize debug logging
Peter Krempa [Mon, 16 May 2022 11:20:42 +0000 (13:20 +0200)] 
qemuBuildCommandLine: Sanitize debug logging

Improve the debug log inside 'qemuBuildCommandLine' to include the name
from the definition and remove useless data such as the pointer to the
qemuDriver object or qemuCaps.

Additionally remove the non-specific debug statements:

  VIR_DEBUG("Building emulator command line");

from the two callers of qemuBuildCommandLine.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemu: Store state of FIPS in virQEMUDriver
Peter Krempa [Mon, 16 May 2022 10:47:19 +0000 (12:47 +0200)] 
qemu: Store state of FIPS in virQEMUDriver

Rather than re-query all the time we can cache the state of FIPS of the
host as it will not change during the runtime of the guest.

Introduce a 'hostFips' flag to 'virQEMUDriver' and move the code
checking the state from 'qemuCheckFips' to 'qemuStateInitialize' and
also populate 'hostFips' in qemuxml2argvtest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemuBuildCommandLine: Convert 'standalone' flag to use 'flags'
Peter Krempa [Mon, 16 May 2022 11:15:22 +0000 (13:15 +0200)] 
qemuBuildCommandLine: Convert 'standalone' flag to use 'flags'

Introduce 'qemuBuildCommandLineFlags' and use it instead of specific
flag booleans.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemu: command: Don't hide 'vhost' fds from 'standalone' command line
Peter Krempa [Fri, 13 May 2022 11:49:08 +0000 (13:49 +0200)] 
qemu: command: Don't hide 'vhost' fds from 'standalone' command line

We already format a commandline using FD passing for the tap devices so
formatting the 'vhost' file descriptors won't make it any less usable
directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agodocs: drvqemu: Decrease expectations about command line from 'virsh domxml-to-native'
Peter Krempa [Mon, 16 May 2022 11:03:24 +0000 (13:03 +0200)] 
docs: drvqemu: Decrease expectations about command line from 'virsh domxml-to-native'

In the qemu driver certain configs such as disk throttling or CPU
hotplug is configured by interacting with the monitor at the startup
phase of the hypervisor and thus is not part of the "native config".

Add a paragraph into the documentation outlining that the native
configuration might not be completely usable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agovirConnectDomainXMLToNative: Add note about dynamically configured features
Peter Krempa [Mon, 16 May 2022 10:56:22 +0000 (12:56 +0200)] 
virConnectDomainXMLToNative: Add note about dynamically configured features

In the qemu driver certain configs such as disk throttling or CPU
hotplug is configured by interacting with the monitor at the startup
phase of the hypervisor and thus is not part of the "native config" as
returned by 'virConnectDomainXMLToNative'.

Similarly at least the commandline for qemu contains resources passed
via file descriptors which are obviously not part of the returned
"native config".

Add a paragraph into the documentation outlining that the native
configuration might not be completely usable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>