]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
2 years agoconf/domain_conf: Update format strings in translated messages
Jiri Denemark [Thu, 9 Mar 2023 10:18:31 +0000 (11:18 +0100)]
conf/domain_conf: Update format strings in translated messages

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agoch: Update format strings in translated messages
Jiri Denemark [Thu, 9 Mar 2023 10:17:57 +0000 (11:17 +0100)]
ch: Update format strings in translated messages

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agobhyve: Update format strings in translated messages
Jiri Denemark [Thu, 9 Mar 2023 10:16:58 +0000 (11:16 +0100)]
bhyve: Update format strings in translated messages

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agoadmin: Update format strings in translated messages
Jiri Denemark [Thu, 9 Mar 2023 10:16:39 +0000 (11:16 +0100)]
admin: Update format strings in translated messages

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agoaccess: Update format strings in translated messages
Jiri Denemark [Thu, 9 Mar 2023 10:16:12 +0000 (11:16 +0100)]
access: Update format strings in translated messages

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agodocs: Document requirements on format strings in translated messages
Jiri Denemark [Wed, 8 Mar 2023 09:58:11 +0000 (10:58 +0100)]
docs: Document requirements on format strings in translated messages

Preserving the order of format strings (%s, ...) when translating
messages may be very hard or even impossible depending on the target
language. On the other hand, reordering them requires understanding the
C-format strings which is not something we should expect from
translators. And even if someone reorders format strings in the right
way (by addressing arguments directly using N$), someone else may use a
translation tool that requires format strings in msgid and msgstr to
match exactly and forces these correct formats to be reverted.

As a result of this, we had several reported crashes in some locales
because integers were formatted as strings. So to make such crashes less
likely to happen and to make translating our messages easier, we now
require all messages that are marked for translation to use format
strings that always refer to the same argument no matter where they
appear in a message (e.g., %1$s, %5$llu).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agoUpdate translation files
Weblate [Sat, 1 Apr 2023 08:35:15 +0000 (10:35 +0200)]
Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2 years agopo: Refresh potfile
Jiri Denemark [Sat, 1 Apr 2023 08:33:57 +0000 (10:33 +0200)]
po: Refresh potfile

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoTranslated using Weblate (Korean)
김인수 [Sat, 1 Apr 2023 08:03:09 +0000 (10:03 +0200)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10399 of 10399 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2 years agoTranslated using Weblate (Czech)
Pavel Borecki [Sat, 1 Apr 2023 08:03:08 +0000 (10:03 +0200)]
Translated using Weblate (Czech)

Currently translated at 84.1% (8752 of 10399 strings)

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

Co-authored-by: Pavel Borecki <pavel.borecki@gmail.com>
Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
2 years agoDo not use VIR_PCI_DEVICE_ADDRESS_FMT in translations
Jiri Denemark [Wed, 29 Mar 2023 10:07:53 +0000 (12:07 +0200)]
Do not use VIR_PCI_DEVICE_ADDRESS_FMT in translations

xgettext cannot handle strings concatenated with cpp macros.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoDrop excess whitespace from error messages
Jiri Denemark [Wed, 29 Mar 2023 10:01:13 +0000 (12:01 +0200)]
Drop excess whitespace from error messages

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoPost-release version bump to 9.3.0
Jiri Denemark [Sat, 1 Apr 2023 07:52:31 +0000 (09:52 +0200)]
Post-release version bump to 9.3.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoRelease of libvirt-9.2.0
Jiri Denemark [Sat, 1 Apr 2023 07:33:43 +0000 (09:33 +0200)]
Release of libvirt-9.2.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoTranslated using Weblate (Korean)
김인수 [Fri, 31 Mar 2023 08:20:40 +0000 (10:20 +0200)]
Translated using Weblate (Korean)

Currently translated at 99.7% (10377 of 10399 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2 years agoTranslated using Weblate (Czech)
Pavel Borecki [Fri, 31 Mar 2023 08:20:40 +0000 (10:20 +0200)]
Translated using Weblate (Czech)

Currently translated at 84.1% (8748 of 10399 strings)

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

Co-authored-by: Pavel Borecki <pavel.borecki@gmail.com>
Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
2 years agoconf: Clear pointer to freed bitmap holding hostdev's 'origstates'
Peter Krempa [Thu, 30 Mar 2023 09:42:31 +0000 (11:42 +0200)]
conf: Clear pointer to freed bitmap holding hostdev's 'origstates'

'virDomainHostdevDefClear' must clear the pointers too as it can be
invoked multiple times on the same object e.g. inside
qemuDomainRemoveHostDevice once via virDomainHostdevDefFree which skips
freeing the object if it's used via <interface> and thus has a 'net'
definition corresponding to it, and then subsequently via
virDomainNetDefFree.

Fix it by clearing the pointer along with freeing it.

Fixes: d9e4075d4e9
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2182961
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agostorage_file_probe: change maximum len value in vmdk4GetBackingStore
Anastasia Belova [Wed, 29 Mar 2023 10:09:02 +0000 (13:09 +0300)]
storage_file_probe: change maximum len value in vmdk4GetBackingStore

desc length should be always less than VIR_STORAGE_MAX_HEADER.
If len = VIR_STORAGE_MAX_HEADER, desc may be out of bounds.

Fixes: 296032bfb2 ("util: extract storage file probe code into virtstoragefileprobe.c")
Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Tue, 28 Mar 2023 14:20:43 +0000 (16:20 +0200)]
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10399 of 10399 strings)

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

Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2 years agoTranslated using Weblate (Czech)
Ján Tomko [Tue, 28 Mar 2023 14:20:42 +0000 (16:20 +0200)]
Translated using Weblate (Czech)

Currently translated at 83.4% (8679 of 10399 strings)

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

Co-authored-by: Jan Tomko <jtomko@redhat.com>
Signed-off-by: Jan Tomko <jtomko@redhat.com>
2 years agoNEWS: document my user-visible bugfixes
Ján Tomko [Mon, 27 Mar 2023 11:01:40 +0000 (13:01 +0200)]
NEWS: document my user-visible bugfixes

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agoqemu: Default to raw firmware for existing domains
Andrea Bolognani [Mon, 27 Mar 2023 17:30:48 +0000 (19:30 +0200)]
qemu: Default to raw firmware for existing domains

The changes to the output files are the exact opposite of
those from commit 22207713cf8e: this is proof that the fix is
working as intended, and that existing domains will keep using
raw firmware images regardless of whether or not qcow2 images
are available on the system and have higher priority.

New domains will keep picking whatever firmware is considered
the preferred one according to the order of descriptors, as
evidenced by the fact that the recently introduced
firmware-auto-efi-abi-update-aarch64 test case is unaffected.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agotests: Add firmware-auto-efi-abi-update-aarch64 test case
Andrea Bolognani [Mon, 27 Mar 2023 17:56:46 +0000 (19:56 +0200)]
tests: Add firmware-auto-efi-abi-update-aarch64 test case

The input is identical to that of the existing
firmware-auto-efi-aarch64 test, but in this case we want to
cover the scenario in which that input is used to define a new
domain rather than loading the definition of an existing domain
from disk.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agotests: Introduce DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE()
Andrea Bolognani [Mon, 27 Mar 2023 17:47:27 +0000 (19:47 +0200)]
tests: Introduce DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE()

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agotests: Compile virgdbusmock.c with GIO_COMPILATION enabled
Michal Privoznik [Mon, 27 Mar 2023 11:50:40 +0000 (13:50 +0200)]
tests: Compile virgdbusmock.c with GIO_COMPILATION enabled

There are couple of g_dbus_*() functions we provide an
alternative implementation for in our virgdbusmock.c. However,
these functions are declared in gio/gdbusconnection.h as:

  GIO_AVAILABLE_IN_ALL
  GDBusConnection  *g_bus_get_sync (GBusType            bus_type,
                                    GCancellable       *cancellable,
                                    GError            **error);

where GIO_AVAILABLE_IN_ALL is declared as (in
/gio/gio-visibility.h):

  #if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(GIO_STATIC_COMPILATION)
  #  define _GIO_EXPORT __declspec(dllexport)
  #  define _GIO_IMPORT __declspec(dllimport)
  #elif __GNUC__ >= 4
  #  define _GIO_EXPORT __attribute__((visibility("default")))
  #  define _GIO_IMPORT
  #else
  #  define _GIO_EXPORT
  #  define _GIO_IMPORT
  #endif
  #ifdef GIO_COMPILATION
  #  define _GIO_API _GIO_EXPORT
  #else
  #  define _GIO_API _GIO_IMPORT
  #endif

  #define _GIO_EXTERN _GIO_API extern

  #define GIO_AVAILABLE_IN_ALL _GIO_EXTERN

Now, on mingw the functions we mock are declared with dllimport
attribute which makes the compiler unhappy:

  ../tests/virgdbusmock.c:25:24: error: 'g_bus_get_sync'
  redeclared without dllimport attribute: previous dllimport
  ignored [-Werror=attributes]

The solution is to do what glib does when it compiles the gio
module: set GIO_COMPILATION macro which in turn annotates the
function with dllexport attribute.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoUpdate translation files
Weblate [Mon, 27 Mar 2023 09:31:00 +0000 (11:31 +0200)]
Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2 years agopo: Refresh potfile for v9.2.0
Jiri Denemark [Mon, 27 Mar 2023 09:15:48 +0000 (11:15 +0200)]
po: Refresh potfile for v9.2.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoRevert "ci: Disable optimization on macos-12"
Martin Kletzander [Fri, 24 Mar 2023 15:41:05 +0000 (16:41 +0100)]
Revert "ci: Disable optimization on macos-12"

This reverts commit 1f76b5365ec78b1e9a36038db8e13ec0025bbe7a.

There were two issues with this commit.  First is the missing propagation
of CFLAGS into the build environment and second is the fact that this is
not enough to disable the check for -fsemantic-interposition.  The
proper fix would require setting MESON_OPTS or similar and also add the
propagation of such variable into the cirrus builds etc., but at this
point I burned so much time on this trivial piece of rubbish that I
think it's easier to just wait for macos to gain a newer clang =D

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoesx: Change the default username when connecting to VCenter
Michal Privoznik [Fri, 24 Mar 2023 11:03:28 +0000 (12:03 +0100)]
esx: Change the default username when connecting to VCenter

While it's true that the default username is:

  administrator@${SSO-Domain}

in majority of cases the ${SSO-Domain} is "vsphere.local". But
our code (and what virsh displays then) says it's just
"administrator".

This is wrong also from a different POV: the username must
contain the suffix no matter what and our default suggests
otherwise.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2181234
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agovirt-host-validate: Detect SMMU support on ARMs
Michal Privoznik [Wed, 22 Mar 2023 15:33:32 +0000 (16:33 +0100)]
virt-host-validate: Detect SMMU support on ARMs

In vir-host-validate we do two checks related to IOMMU:

  1) hardware support, and
  2) kernel support.

While users are usually interested in the latter, the former also
makes sense. And for the former (hardware support) we have this
huge if-else block for nearly every architecture, except ARM.

Now, IOMMU is called SMMU in ARM world, and while there's
certainly a definitive way of detecting SMMU support (e.g. via
dumping some registers in asm), we can work around this - just
like we do for Intel and AMD - and check for an ACPI table
presence.

In ARM world, there's I/O Remapping Table (IORT) which describes
SMMU capabilities on given host and is exposed in sysfs
(regardless of arm_smmu module).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2178885
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoci: Disable optimization on macos-12
Martin Kletzander [Fri, 24 Mar 2023 12:15:30 +0000 (13:15 +0100)]
ci: Disable optimization on macos-12

This enables our CI to run tests on on macos-12 after commit
7944700b4037.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoci: Refresh CI files with current lcitool
Martin Kletzander [Fri, 24 Mar 2023 08:37:48 +0000 (09:37 +0100)]
ci: Refresh CI files with current lcitool

This updates to FreeBSD 12.4 which has clang that supports
-fsemantic-interposition, plus of course updates the system.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agomeson: Don't build tests when CLang lacks -fsemantic-interposition
Michal Privoznik [Tue, 21 Mar 2023 16:01:34 +0000 (17:01 +0100)]
meson: Don't build tests when CLang lacks -fsemantic-interposition

There are some CLang versions that do not support
-fsemantic-interposition. If that's the case, the code is
optimized so much that our mocking no longer works.

Therefore, disable tests and produce a warning.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoci: Drop EOL OpenSUSE 15.3
Peter Krempa [Thu, 23 Mar 2023 08:54:03 +0000 (09:54 +0100)]
ci: Drop EOL OpenSUSE 15.3

The '15.3' version is EOL now:

  https://get.opensuse.org/leap/15.3/

Also switch the 'codestyle' job to the appropriate container image.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoci: Add OpenSUSE leap 15.4 job
Peter Krempa [Thu, 23 Mar 2023 14:21:37 +0000 (15:21 +0100)]
ci: Add OpenSUSE leap 15.4 job

As a precursor to dropping the EOL OpenSUSE 15.3 job add first the
definitions for the replacement version.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoTranslated using Weblate (Japanese)
Jiri Denemark [Wed, 22 Mar 2023 15:20:49 +0000 (16:20 +0100)]
Translated using Weblate (Japanese)

Currently translated at 99.5% (10368 of 10416 strings)

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

Co-authored-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoTranslated using Weblate (French)
grimst [Wed, 22 Mar 2023 15:20:48 +0000 (16:20 +0100)]
Translated using Weblate (French)

Currently translated at 99.9% (10410 of 10416 strings)

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

Co-authored-by: grimst <grimaitres@gmail.com>
Signed-off-by: grimst <grimaitres@gmail.com>
2 years agoTranslated using Weblate (Finnish)
Jan Kuparinen [Wed, 22 Mar 2023 15:20:48 +0000 (16:20 +0100)]
Translated using Weblate (Finnish)

Currently translated at 22.5% (2349 of 10416 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>
2 years agoqemu_shim: Require absolute path for root directory
Michal Privoznik [Wed, 22 Mar 2023 11:39:21 +0000 (12:39 +0100)]
qemu_shim: Require absolute path for root directory

The virConnectOpen(), well virConnectOpenInternal() reports an
error if embed root is not an absolute path. This is a fair
requirement, but our qemu_shim doesn't check this requirement and
passes the path to mkdir(), only to fail later on, leaving the
empty directory behind:

  $ ls -d asd
  ls: cannot access 'asd': No such file or directory

  $ virt-qemu-run -r asd whatever.xml
  virt-qemu-run: cannot open qemu:///embed?root=asd: unsupported configuration: root path must be absolute

  $ ls -d asd
  asd

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
2 years agoqemu_domain: Drop ATTRIBUTE_NONNULL() for non-existent arguments
Michal Privoznik [Wed, 22 Mar 2023 10:07:50 +0000 (11:07 +0100)]
qemu_domain: Drop ATTRIBUTE_NONNULL() for non-existent arguments

After cleanup done in v8.2.0-rc1~47 the
qemuDomainObjExitMonitor() and after v8.7.0-rc1~176 the
qemuDomainObjEnterMonitor() lost the @driver argument. But
corresponding ATTRIBUTE_NONNULL() annotation was not removed and
both functions are still annotated as ATTRIBUTE_NONNULL(2) even
though they accept just one argument (@obj).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
2 years agoqemu_shim: set system identity
Ján Tomko [Wed, 15 Mar 2023 15:21:49 +0000 (16:21 +0100)]
qemu_shim: set system identity

Otherwise looking up a secret fails when we try to elevate the identity
in qemuDomainSecretInfoSetupFromSecret.

https://bugzilla.redhat.com/show_bug.cgi?id=2000410

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu: Move validation check out of postparse
Andrea Bolognani [Fri, 17 Mar 2023 10:19:04 +0000 (11:19 +0100)]
qemu: Move validation check out of postparse

Suggested-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Move validation check out of postparse
Andrea Bolognani [Fri, 17 Mar 2023 11:00:39 +0000 (12:00 +0100)]
conf: Move validation check out of postparse

The reason why it was in postparse in the first place was so
that we could could automatically enable the secure-boot feature
in some cases, but that no longer happens so we can finally move
it to the proper location.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Don't explicitly set the secure-boot feature
Andrea Bolognani [Wed, 15 Mar 2023 19:23:58 +0000 (20:23 +0100)]
conf: Don't explicitly set the secure-boot feature

Now that we're adding information obtained from the firmware
descriptor to the domain XML, this will happen automatically
whenever a firmware that has the enrolled-keys feature ends up
being selected.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu: Automatically add firmware type/features information
Andrea Bolognani [Wed, 15 Mar 2023 16:53:02 +0000 (17:53 +0100)]
qemu: Automatically add firmware type/features information

Even when the user is not taking advantage of firmware
autoselection and instead manually providing all the necessary
information, in most cases they're still going to use firmware
builds that are provided by the OS vendor, are installed in
standard paths and come with a corresponding firmware
descriptor.

Similarly, even when the user is not guiding the autoselection
process by specifying the desired status of certain features
and instead is relying on the system-level descriptor priority
being set up correctly, libvirt will still ultimately decide to
use a specific descriptor, which includes information about the
firmware's features.

In both these cases, take the additional information that were
obtained from the firmware descriptor and reflect them back into
the domain XML, where they can be conveniently inspected by the
user and management applications alike.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu: Don't drop firmware type/features information
Andrea Bolognani [Tue, 14 Mar 2023 22:08:29 +0000 (23:08 +0100)]
qemu: Don't drop firmware type/features information

Now that we no longer reject configurations that include both
this information and explicit firmware details, as long of
course as everything is internally consistent, and that we've
ensured that we produce maximally compatible XML on migration,
we can stop stripping this information at the end of the
firmware selection process.

There are several advantages to keeping this information around:

  * if the user wants to change the firmware configuration for
    an existing VM, they can simply drop the <loader> and
    <nvram> elements, tweak the firmware autoselection parameters
    and let libvirt pick a firmware that matches on the new
    requirements;

  * management applications can inspect the XML and easily
    figure out firmware-related information without having to
    reverse-engineer them based on some opaque paths.

Overall, this change makes things more transparent and easier to
understand. The improvement is so significant that, in a
follow-up commit, we're going to ensure that this information is
available in even more cases.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Don't format firmware type/features when migrating
Andrea Bolognani [Fri, 17 Mar 2023 10:12:31 +0000 (11:12 +0100)]
conf: Don't format firmware type/features when migrating

The combination of explicit firmware paths, which we now
produce in all cases, and firmware autoselection knobs is
explicitly rejected by libvirt 8.6.0 and newer.

Right now we produce inherently migratable XML in all cases,
since we always strip those bits, but that's going to change
soon. To prepare for that, make sure that we always skip the
problematic elements and attributes when preparing a
migratable XML.

The destination will simply receive a fully specified firmware
configuration, which is indistinguishable from one that was
manually provided by the user and is thus accepted by any old
version of libvirt, regardless of whether or not firmware
autoselection was used on the source host.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Remove some firmware validation checks
Andrea Bolognani [Tue, 14 Mar 2023 22:02:46 +0000 (23:02 +0100)]
conf: Remove some firmware validation checks

libvirt 8.6.0 introduced these checks and very clearly delineated
two possible firmware selection scenarios: manual firmware
selection, where the user is responsible for providing all
information, and firmware autoselection, where a list of desired
features is provided and everything else is handled by libvirt.

In the interest of maintaining the clear separation between these
two scenarios, setting most attributes when firmware autoselection
is active will result in the configuration being rejected.

This works fine, but is unnecessarily restrictive: in most cases,
the additional information that the user has provided matches
the information that libvirt would have discovered on its own by
looking at firmware descriptors, and asking the user to scrub it
from the XML only result in pointless friction.

Remove these checks entirely.

Unsurprisingly, this results in a few test cases that were
rejected until now to suddenly start working and producing
sensible results.

The firmware-auto-efi-loader-path-nonstandard test case is
notable: while we can now enable the xml2xml part of the test,
the xml2argv part is still failing, although in a slightly
different way. This is expected: since the firmware binary is a
non-standard one, libvirt is unable to figure out the missing
information from a firmware descriptor, and the configuration
is still ultimately an invalid one. However, if we were to find
such a configuration on disk at daemon startup, we would not
ignore it completely and instead would offer the user a chance
to fix it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu: Always go through firmware autoselection
Andrea Bolognani [Wed, 15 Mar 2023 16:32:43 +0000 (17:32 +0100)]
qemu: Always go through firmware autoselection

Right now there are a few scenarios in which we skip ahead, and
removing these exceptions will make for more consistent and
predictable behavior.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu: Discard requires-smm firmware when loader.secure=no
Andrea Bolognani [Thu, 16 Mar 2023 18:42:56 +0000 (19:42 +0100)]
qemu: Discard requires-smm firmware when loader.secure=no

The requires-smm feature being present in a firmware descriptor
causes loader.secure=yes to be automatically chosen for the
domain, so we have to avoid this situation or the user's choice
will be silently subverted.

Note that we can't actually encounter loader.secure=no in this
function at the moment because of earlier checks, but that's
going to change soon.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu: Introduce qemuFirmwareMatchesPaths()
Andrea Bolognani [Wed, 15 Mar 2023 17:12:58 +0000 (18:12 +0100)]
qemu: Introduce qemuFirmwareMatchesPaths()

Right now we have checks in place that ensure that explicit
paths are not provided when firmware autoselection has been
enabled, but that's going to change soon.

To prepare for that, take into account user-provided paths
during firmware autoselection if present, and discard all
firmware descriptors that don't contain matching information.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agotests: Fix firmware descriptor masking test
Andrea Bolognani [Wed, 15 Mar 2023 19:51:51 +0000 (20:51 +0100)]
tests: Fix firmware descriptor masking test

Right now we're checking that firmware descriptor masking works
as intended by creating an empty file matching 60-ovmf-sb.json
in name.

However, that firmware descriptors contains the details for a
perfectly valid and quite common situation: Secure Boot being
supported by the firmware build, but being effectively disabled
by the lack of certificates in the NVRAM template.

Unmask that firmware descriptor, and instead create a dummy one
that has higher priority than all other OVMF builds and points
to paths that are obviously incorrect, which should make it
easy to notice it getting accidentally unmasked in the future.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agotests: Add more tests for manual Secure Boot configuration
Andrea Bolognani [Wed, 15 Mar 2023 18:39:06 +0000 (19:39 +0100)]
tests: Add more tests for manual Secure Boot configuration

These cover the same scenarios as the matching test cases for
autoselection.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agotests: Add firmware-auto-efi-loader-path
Andrea Bolognani [Thu, 16 Mar 2023 18:10:29 +0000 (19:10 +0100)]
tests: Add firmware-auto-efi-loader-path

This is identical to the existing
firmware-auto-efi-loader-path-nonstandard test case, but uses
a standard firmware path.

Right now the two test cases behave identically, but that's
going to change in the future.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agotests: Fix firmware-auto-efi-loader-path-nonstandard
Andrea Bolognani [Thu, 16 Mar 2023 17:59:52 +0000 (18:59 +0100)]
tests: Fix firmware-auto-efi-loader-path-nonstandard

This test is intended to simulate the use of an OVMF firmware
image installed under a non-standard path. In order to make
such a configuration work, the user would have to provide
additional information.

Right now it doesn't matter, because the configuration is
rejected anyway, but the behavior is going to change slightly
in the future. Prepare by making the configuration more
complete and realistic.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agotests: Rename a few firmware tests
Andrea Bolognani [Thu, 16 Mar 2023 16:36:45 +0000 (17:36 +0100)]
tests: Rename a few firmware tests

This unifies the naming between the manual and automatic
selection cases, clarifies the contents of the tests and makes
room for more tests being added in the future.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu: Fix memory leaks in firmware selection code
Andrea Bolognani [Tue, 21 Mar 2023 23:22:43 +0000 (00:22 +0100)]
qemu: Fix memory leaks in firmware selection code

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2 years agomeson: Stop detecting -Wl,--version-script=
Michal Privoznik [Mon, 20 Mar 2023 12:38:27 +0000 (13:38 +0100)]
meson: Stop detecting -Wl,--version-script=

With its version 16.0, the LLVM's linker turned on
--no-undefined-version by default [1]. This breaks how we detect
--version-script= detection, because at the compile time there's
no library built yet that we can use to make --version-script=
happy. Unfortunately, meson does not provide a way to detect this
either [2].

But there's not much sense in detecting the argument either. We
already special case some systems (windows, darwin) and do the
check for others, which are expected to support versioned
symbols, because of ELF. Worst case scenario - the error is
reported during compile time rather than configure time.

1: https://reviews.llvm.org/D135402
2: https://github.com/mesonbuild/meson/issues/3047

Resolves: https://bugs.gentoo.org/902211
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agovbox: unify "unable to get hard disk id" message
Ján Tomko [Sat, 18 Mar 2023 13:23:13 +0000 (14:23 +0100)]
vbox: unify "unable to get hard disk id" message

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2 years agoUnify error message when namespaces are unsupported
Ján Tomko [Sat, 18 Mar 2023 12:17:22 +0000 (13:17 +0100)]
Unify error message when namespaces are unsupported

Some helpers used a period at the end, others did not.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2 years agoutil: xml: remove function names from error messages
Ján Tomko [Sat, 18 Mar 2023 11:47:18 +0000 (12:47 +0100)]
util: xml: remove function names from error messages

The function name is already logged, and these can happen only as a
result of a programmer error.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2 years agovbox: remove unreachable error in virVBoxSnapshotConfSaveVboxFile
Ján Tomko [Sat, 18 Mar 2023 11:34:47 +0000 (12:34 +0100)]
vbox: remove unreachable error in virVBoxSnapshotConfSaveVboxFile

Both callers in the VirtualBox driver handle the error and only
call this function with a non-NULL argument.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2 years agovbox: remove unreachable error in virVBoxSnapshotConfLoadVboxFile
Ján Tomko [Sat, 18 Mar 2023 11:33:17 +0000 (12:33 +0100)]
vbox: remove unreachable error in virVBoxSnapshotConfLoadVboxFile

Both callers in the VirtualBox driver error out if the path
can't be fetched via VirtualBox APIs and abort on conversion error
from UTF-16 to UTF-8.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2 years agobhyve: unify error message for UUID generation
Ján Tomko [Fri, 17 Mar 2023 21:57:42 +0000 (22:57 +0100)]
bhyve: unify error message for UUID generation

All the other places spell UUID in all caps.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2 years agosrc: unify symlink creation error message
Ján Tomko [Fri, 17 Mar 2023 21:56:19 +0000 (22:56 +0100)]
src: unify symlink creation error message

In some places, one quote got dropped by accident.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2 years agobhyve: fix typo in error message
Ján Tomko [Fri, 17 Mar 2023 21:43:51 +0000 (22:43 +0100)]
bhyve: fix typo in error message

Use the same string as in qemu_process.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2 years agocapabilities: reduce scope in virCapabilitiesInitCaches()
Shaleen Bathla [Mon, 20 Mar 2023 10:39:56 +0000 (16:09 +0530)]
capabilities: reduce scope in virCapabilitiesInitCaches()

over-writing a variable in inner while-loop without freeing previous memory
leaks it over time.
To fix this, we can just change scope of bank variable to the inner loop.

Signed-off-by: Shaleen Bathla <shaleen.bathla@oracle.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Fixes: 5c84485439ee63f40002c04914e111395c598db0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2 years agomanpages: fix secret injection example for SEV
Daniel P. Berrangé [Thu, 16 Mar 2023 08:57:34 +0000 (08:57 +0000)]
manpages: fix secret injection example for SEV

The --disk-password argument was present in early impls of the patch but
replaced by the more generic --inject-secret argument.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agorpc: fix typo in admin code generation
Ján Tomko [Thu, 16 Mar 2023 12:13:25 +0000 (13:13 +0100)]
rpc: fix typo in admin code generation

An extra '&' introduced a crash.

https://bugzilla.redhat.com/show_bug.cgi?id=2178866

Fixes: 778c3004609ede0a9df4cf3e01c031047530efb7
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoTranslated using Weblate (French)
Ludek Janda [Thu, 16 Mar 2023 14:26:18 +0000 (15:26 +0100)]
Translated using Weblate (French)

Currently translated at 100.0% (10416 of 10416 strings)

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

Co-authored-by: Ludek Janda <ljanda@redhat.com>
Signed-off-by: Ludek Janda <ljanda@redhat.com>
2 years agoTranslated using Weblate (Czech)
Ján Tomko [Thu, 16 Mar 2023 14:26:18 +0000 (15:26 +0100)]
Translated using Weblate (Czech)

Currently translated at 83.5% (8706 of 10416 strings)

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

Co-authored-by: Jan Tomko <jtomko@redhat.com>
Co-authored-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Jan Tomko <jtomko@redhat.com>
2 years agoTranslated using Weblate (Chinese (Simplified) (zh_CN))
Jiri Denemark [Thu, 16 Mar 2023 14:26:17 +0000 (15:26 +0100)]
Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 99.5% (10373 of 10416 strings)

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

Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 99.5% (10373 of 10416 strings)

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

Translated using Weblate (Japanese)

Currently translated at 99.5% (10368 of 10416 strings)

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

Translated using Weblate (Japanese)

Currently translated at 99.5% (10369 of 10416 strings)

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

Co-authored-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoTranslated using Weblate (Czech)
Daniel P. Berrangé [Thu, 16 Mar 2023 14:26:16 +0000 (15:26 +0100)]
Translated using Weblate (Czech)

Currently translated at 83.5% (8706 of 10416 strings)

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

Co-authored-by: Daniel P. Berrange <berrange@redhat.com>
Co-authored-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2 years agomeson: stop CLang doing inter-procedural analysis
Daniel P. Berrangé [Thu, 16 Mar 2023 12:50:56 +0000 (12:50 +0000)]
meson: stop CLang doing inter-procedural analysis

The virNumaNodeIsAvailable function is stubbed out when building
without libnuma, such that it just returns a constant value. When
CLang is optimizing, it does inter-procedural analysis across
function calls. When it sees that the call to virNumaNodeIsAvailable
returns a fixed constant, it elides the conditional check for errors
in the callers such as virNumaNodesetIsAvailable.

This is a valid optimization as the C standard declares that there
must only be one implementation of each function in a binary. This
is normally the case, but ELF allows for function overrides when
linking or at runtime with LD_PRELOAD, which is technically outside
the mandated C language behaviour.

So while CLang's optimization works fine at runtime, it breaks in our
test suite which aims to mock the virNumaNodeIsAvailable function so
that it has specific semantics regardless of whether libnuma is built
or not. The return value check optimization though means our mock
override won't have the right effect. The mock will be invoked, but
its return value is not used.

Potentially the same problem could be exhibited with GCC if certain
combinations of optimizations are enabled, though thus far we've
not seen it.

To be robust on both CLang and GCC we need to make it more explicit
that we want to be able to replace functions and thus optimization
of calls must be limited. Currently we rely on 'noinline' which
does successfully prevent inlining of the function, but it cannot
stop the eliding of checks based on the constant return value.
Thus we need a bigger hammer.

There are a couple of options to disable this optimization:

 * Annotate a symbol as 'weak'. This is tells the compiler
   that the symbol is intended to be overridable at linktime
   or runtime, and thus it will avoid doing inter-procedural
   analysis for optimizations. This was tried previously but
   have to be reverted as it had unintended consequences
   when linking .a files into our final .so, resulting in all
   the weak symbol impls being lost. See commit
   407a281a8e2b6c5078ba1148535663ea64fd9314

 * Annotate a symbol with 'noipa'. This tells the compiler
   to avoid inter-procedural analysis for calls to just this
   function. This would be ideal match for our scenario, but
   unfortunately it is only implemented for GCC currently:

     https://reviews.llvm.org/D101011

 * The '-fsemantic-interposition' argument tells the optimizer
   that any functions may be replaced with alternative
   implementations that have different semantics. It thus
   blocks any optimizations across function calls. This is
   quite a harsh block on the optimizer, but it appears to be
   the only one that is viable with CLang.

Out of those choices option (3) is the only viable option for
CLang. We don't want todo it for GCC though as it is such a
big hammer. Probably we should apply (2) for GCC, should we
experiance a problem in future.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agoqemu: use correct formatting string for size_t
Ján Tomko [Fri, 17 Mar 2023 13:58:23 +0000 (14:58 +0100)]
qemu: use correct formatting string for size_t

Otherwise the build on armv7l breaks:
error: format ‘%lu’ expects argument of type
‘long unsigned int’, but argument 4 has type
‘size_t’ {aka ‘unsigned int’} [-Werror=format=]

Fixes: 1992ae40fac90c315d0d8d1a9c6f880bd0a39b57
Fixes: e239f7d0a86ebddf9aab3f8c8e6b6e66351485b2
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: qemublocktest: fix memory leak
Ján Tomko [Fri, 17 Mar 2023 14:34:02 +0000 (15:34 +0100)]
tests: qemublocktest: fix memory leak

Set enccount to 1, so the cleanup function knows
there is something to be cleaned up.

Fixes: 1992ae40fac90c315d0d8d1a9c6f880bd0a39b57
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: add luks-any encryption support for RBD images
Or Ozeri [Mon, 13 Mar 2023 09:50:23 +0000 (04:50 -0500)]
qemu: add luks-any encryption support for RBD images

The newly added luks-any rbd encryption format in qemu
allows for opening both LUKS and LUKS2 encryption formats.
This commit enables libvirt uses to use this wildcard format.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: capabilities: Introduce QEMU_CAPS_RBD_ENCRYPTION_LUKS_ANY capability
Or Ozeri [Mon, 13 Mar 2023 09:50:22 +0000 (04:50 -0500)]
qemu: capabilities: Introduce QEMU_CAPS_RBD_ENCRYPTION_LUKS_ANY capability

This capability represents that qemu supports the "luks-any" encryption
format for RBD images.
Both LUKS and LUKS2 formats can be parsed using this wildcard format.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: add support for librbd layered encryption
Or Ozeri [Mon, 13 Mar 2023 09:50:21 +0000 (04:50 -0500)]
qemu: add support for librbd layered encryption

This commit enables libvirt users to use layered encryption
of RBD images, using the librbd encryption engine.
This allows opening of an encrypted cloned image
whose parent is encrypted with a possibly different encryption key.
To open such images, multiple encryption secrets are expected
to be defined under the encryption XML tag.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: add multi-secret support in _qemuDomainStorageSourcePrivate
Or Ozeri [Mon, 13 Mar 2023 09:50:20 +0000 (04:50 -0500)]
qemu: add multi-secret support in _qemuDomainStorageSourcePrivate

This commit changes the _qemuDomainStorageSourcePrivate struct
to support multiple secrets (instead of a single one before this commit).
This will useful for storage encryption requiring more than a single secret.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: add multi-secret support in qemuBlockStorageSourceAttachData
Or Ozeri [Mon, 13 Mar 2023 09:50:19 +0000 (04:50 -0500)]
qemu: add multi-secret support in qemuBlockStorageSourceAttachData

This commit changes the qemuBlockStorageSourceAttachData struct
to support multiple secrets (instead of a single one before this commit).
This will useful for storage encryption requiring more than a single secret.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: add support for multiple secret aliases
Or Ozeri [Mon, 13 Mar 2023 09:50:18 +0000 (04:50 -0500)]
qemu: add support for multiple secret aliases

Change secret aliases from %s-%s-secret0 to %s-%s-secret%lu,
which will later be used for storage encryption requiring more
than a single secret.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: capabilities: Introduce QEMU_CAPS_RBD_ENCRYPTION_LAYERING capability
Or Ozeri [Mon, 13 Mar 2023 09:50:17 +0000 (04:50 -0500)]
qemu: capabilities: Introduce QEMU_CAPS_RBD_ENCRYPTION_LAYERING capability

This capability represents that qemu supports the layered encryption
of RBD images, where a cloned image is encrypted with a possible
different encryption than its parent image.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agodocs: clarify --timeout description for virtsecretd
Ján Tomko [Wed, 15 Mar 2023 10:15:01 +0000 (11:15 +0100)]
docs: clarify --timeout description for virtsecretd

As of commit 9e3cc0ff5 the virtsecretd daemon does not timeout
while it keeps any ephemeral secrets.

https://bugzilla.redhat.com/show_bug.cgi?id=2035985

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agodocs: clarify --timeout description for split daemons
Ján Tomko [Wed, 15 Mar 2023 10:08:29 +0000 (11:08 +0100)]
docs: clarify --timeout description for split daemons

Remove the reference to "running domains" for daemons that happily
exit while domains are running.

https://bugzilla.redhat.com/show_bug.cgi?id=2035985

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agoutil: virXMLValidatorInit: improve translatable errors
Ján Tomko [Wed, 8 Mar 2023 13:00:18 +0000 (14:00 +0100)]
util: virXMLValidatorInit: improve translatable errors

In some translations, the RNG initials were mistranslated
as a random number generator.

Spell it out as RelaxNG to make it clearer.
Include the word 'schema' and quotes around the filename.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agocpu_map: Add missing feature "fsrc"
Tim Wiederhake [Thu, 9 Mar 2023 13:18:18 +0000 (14:18 +0100)]
cpu_map: Add missing feature "fsrc"

Introduced in qemu 58794f644e.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agocpu_map: Add missing feature "fsrs"
Tim Wiederhake [Thu, 9 Mar 2023 13:18:18 +0000 (14:18 +0100)]
cpu_map: Add missing feature "fsrs"

Introduced in qemu 58794f644e.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agocpu_map: Add missing feature "fzrm"
Tim Wiederhake [Thu, 9 Mar 2023 13:18:18 +0000 (14:18 +0100)]
cpu_map: Add missing feature "fzrm"

Introduced in qemu 58794f644e.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agocpu_map: Add missing feature "sgx-aex-notify"
Tim Wiederhake [Thu, 9 Mar 2023 13:18:18 +0000 (14:18 +0100)]
cpu_map: Add missing feature "sgx-aex-notify"

Introduced in qemu d45f24fe75.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agocpu_map: Add missing feature "sgx-edeccssa"
Tim Wiederhake [Thu, 9 Mar 2023 13:18:18 +0000 (14:18 +0100)]
cpu_map: Add missing feature "sgx-edeccssa"

Introduced in qemu d45f24fe75.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agosync_qemu_features_i386: Ignore xen-vapic
Tim Wiederhake [Thu, 9 Mar 2023 13:18:18 +0000 (14:18 +0100)]
sync_qemu_features_i386: Ignore xen-vapic

Not a cpu-feature.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agosync_qemu_models_i386.py: Add missing features
Tim Wiederhake [Thu, 9 Mar 2023 13:18:18 +0000 (14:18 +0100)]
sync_qemu_models_i386.py: Add missing features

This brings the tool's list of features in sync with qemu
commit 9832009d9dd2386664c15cc70f6e6bfe062be8bd.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agosync_qemu_models_i386.py: Sort features
Tim Wiederhake [Thu, 9 Mar 2023 13:18:17 +0000 (14:18 +0100)]
sync_qemu_models_i386.py: Sort features

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoNEWS: Document recent thread-context bug fix
Michal Privoznik [Wed, 8 Mar 2023 10:59:39 +0000 (11:59 +0100)]
NEWS: Document recent thread-context bug fix

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agodocs: Document memory allocation and emulator pinning limitation
Michal Privoznik [Wed, 8 Mar 2023 10:53:37 +0000 (11:53 +0100)]
docs: Document memory allocation and emulator pinning limitation

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agoqemuBuildThreadContextProps: Prune .node-affinity wrt <emulatorpin/>
Michal Privoznik [Tue, 7 Mar 2023 13:05:54 +0000 (14:05 +0100)]
qemuBuildThreadContextProps: Prune .node-affinity wrt <emulatorpin/>

When a thread-context object is specified on the cmd line, then
QEMU spawns a thread and sets its affinity to the list of NUMA
nodes specified in .node-affinity attribute. And this works just
fine, until the main QEMU thread itself is not restricted.

Because of v5.3.0-rc1~18 we restrict the main emulator thread
even before QEMU is executed and thus then it tries to set
affinity of a thread-context thread, it inevitably fails with:

  Setting CPU affinity failed: Invalid argument

Now, we could lift the pinning temporarily, let QEMU spawn all
thread-context threads, and enforce pinning again, but that would
require some form of communication with QEMU (maybe -preconfig?).
But that would still be wrong, because it would circumvent
<emulatorpin/>.

Technically speaking, thread-context is an internal
implementation detail of QEMU, and if it weren't for it, the main
emulator thread would be doing the allocation. Therefore, we
should honor the pinning and prune the list of node so that
inaccessible ones are dropped.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2154750
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agoqemu: Add @nodemask argument to qemuBuildThreadContextProps()
Michal Privoznik [Tue, 7 Mar 2023 11:39:47 +0000 (12:39 +0100)]
qemu: Add @nodemask argument to qemuBuildThreadContextProps()

When building a thread-context object (inside of
qemuBuildThreadContextProps()) we look at given memory-backend-*
object and look for .host-nodes attribute. This works, as long as
we need to just copy the attribute value into another
thread-context attribute. But soon we will need to adjust it.
That's the point where having the value in virBitmap comes handy.
Utilize the previous commit, which made
qemuBuildMemoryBackendProps() set the argument and pass it into
qemuBuildThreadContextProps().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agoqemu: Add @nodemaskRet argument to qemuBuildMemoryBackendProps()
Michal Privoznik [Tue, 7 Mar 2023 11:02:11 +0000 (12:02 +0100)]
qemu: Add @nodemaskRet argument to qemuBuildMemoryBackendProps()

While it's true that anybody who's interested in getting
.host-nodes attribute value can just use
virJSONValueObjectGetArray() (and that's exactly what
qemuBuildThreadContextProps() is doing, btw), if somebody is
interested in getting the actual virBitmap, they would have to
parse the JSON array.

Instead, introduce an argument to qemuBuildMemoryBackendProps()
which is set to corresponding value used when formatting the
attribute.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agoqemuBuildMemoryBackendProps: Join two conditions
Michal Privoznik [Tue, 14 Mar 2023 16:19:27 +0000 (17:19 +0100)]
qemuBuildMemoryBackendProps: Join two conditions

There are two compound conditions in
qemuBuildMemoryBackendProps() and each one checks for nodemask
for NULL first. Join them into one bigger block.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>