]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
23 months agocss: Drop styles for '.mail' class
Peter Krempa [Tue, 16 May 2023 14:32:06 +0000 (16:32 +0200)]
css: Drop styles for '.mail' class

Use was removed in 5042a5def6d2d088ed19b10a08e5f40b11b2c58d

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agocss: Drop style for 'p.image' selector
Peter Krempa [Tue, 16 May 2023 14:30:24 +0000 (16:30 +0200)]
css: Drop style for 'p.image' selector

Last use was removed in b51afd97e56a6d9436f8706f952ebc6af647773c

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agocss: Drop style for '#changelog' id
Peter Krempa [Tue, 16 May 2023 14:25:20 +0000 (16:25 +0200)]
css: Drop style for '#changelog' id

The corresponding element was removed in 5e0211e0d3d7d01d5a49

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agocss: Drop styles for '#projects' id
Peter Krempa [Tue, 16 May 2023 14:14:01 +0000 (16:14 +0200)]
css: Drop styles for '#projects' id

There's nothing with such element id. The last mention was removed in
28183590754

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoconf: numa: Allow formatting 'none' values for 'associativity' and 'policy' of cache
Peter Krempa [Tue, 16 May 2023 08:22:39 +0000 (10:22 +0200)]
conf: numa: Allow formatting 'none' values for 'associativity' and 'policy' of cache

The parser makes the values mandatory and also the qemu code implements
actions for those values. The formatter skips them though. Since
format+parse is used to copy the XML at startup a definition with those
values can't be started.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2203709
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agovirDomainNumaDefNodeCacheParseXML: Refactor parsing of cache XML
Peter Krempa [Tue, 16 May 2023 08:19:42 +0000 (10:19 +0200)]
virDomainNumaDefNodeCacheParseXML: Refactor parsing of cache XML

Use virXMLProp* helpers to simplify the code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agoqemuxml2xmltest: Modernize all 'audio-' cases
Peter Krempa [Tue, 9 May 2023 14:58:10 +0000 (16:58 +0200)]
qemuxml2xmltest: Modernize all 'audio-' cases

Use DO_TEST_CAPS_LATEST to run with the latest capapbilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoqemuxml2argvtest: Use real caps instead of fake caps for 'audio-default-*' cases
Peter Krempa [Tue, 9 May 2023 15:24:51 +0000 (17:24 +0200)]
qemuxml2argvtest: Use real caps instead of fake caps for 'audio-default-*' cases

Convert all of the 'audio-default-*' cases to use capabilities from
qemu-4.2 instead of the fake caps.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoqemuxml2xmlout: Replace symlinks of all 'audio-' tests by real files
Peter Krempa [Tue, 9 May 2023 14:58:10 +0000 (16:58 +0200)]
qemuxml2xmlout: Replace symlinks of all 'audio-' tests by real files

Symlinks are hard to maintain and especially un-cool when attempting to
test against real capapbilities.

Replace symlinks by real files first so that we can switch to real caps
and see the difference.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoqemu: Generate command line for MTE feature
Michal Privoznik [Mon, 15 May 2023 12:10:15 +0000 (14:10 +0200)]
qemu: Generate command line for MTE feature

This is pretty trivial, just append "mte=on/off" to -machine
arguments.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemu: Validate MTE feature
Michal Privoznik [Mon, 15 May 2023 12:06:59 +0000 (14:06 +0200)]
qemu: Validate MTE feature

The MTE feature is not supported by all QEMUs, only those with
QEMU_CAPS_MACHINE_VIRT_MTE capability.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemu:: Introduce QEMU_CAPS_MACHINE_VIRT_MTE capability
Michal Privoznik [Mon, 15 May 2023 12:00:14 +0000 (14:00 +0200)]
qemu:: Introduce QEMU_CAPS_MACHINE_VIRT_MTE capability

The MTE feature (introduced in QEMU commit of v5.1.0-rc1~8^2~11)
is detectable via 'qom-list-properties' for 'virt' machine type.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoconf: Introduce MTE domain feature
Michal Privoznik [Mon, 15 May 2023 11:55:31 +0000 (13:55 +0200)]
conf: Introduce MTE domain feature

The Memory Tagging Extensions are hardware acceleration present
in some ARM processors that allow memory error detection [1].
Introduce a domain XML knob that turns them on or off.

1: https://www.arm.com/blogs/blueprint/memory-safety-arm-memory-tagging-extension
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemu: Drop @forceVFIO argument of qemuDomainGetMemLockLimitBytes()
Michal Privoznik [Tue, 9 May 2023 14:16:09 +0000 (16:16 +0200)]
qemu: Drop @forceVFIO argument of qemuDomainGetMemLockLimitBytes()

After previous cleanup, there's not a single caller that would
call qemuDomainGetMemLockLimitBytes() with @forceVFIO set. All
callers pass false.

Drop the unneeded argument from the function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemu: Drop @forceVFIO argument of qemuDomainAdjustMaxMemLock()
Michal Privoznik [Wed, 10 May 2023 06:55:10 +0000 (08:55 +0200)]
qemu: Drop @forceVFIO argument of qemuDomainAdjustMaxMemLock()

After previous cleanup, there's not a single caller that would
call qemuDomainAdjustMaxMemLock() with @forceVFIO set. All callers
pass false.

Drop the unneeded argument from the function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemu_domin: Account for NVMe disks when calculating memlock limit on hotplug
Michal Privoznik [Tue, 9 May 2023 10:19:12 +0000 (13:19 +0300)]
qemu_domin: Account for NVMe disks when calculating memlock limit on hotplug

During hotplug of a NVMe disk we need to adjust the memlock
limit. The computation of the limit is handled by
qemuDomainGetMemLockLimitBytes() which looks at given domain
definition and accounts for various device types (as different
types require different amounts). But during disk hotplug the
disk is not added to domain definition until the very last
moment. Therefore, qemuDomainGetMemLockLimitBytes() has this
@forceVFIO argument which tells it to assume VFIO even if there
are no signs of VFIO in domain definition. And this kind of
works, until the amount needed for NVMe disks changed (in
v9.3.0-rc1~52). What's missing in the commit is making @forceVFIO
behave the same as if there was an NVMe disk present in the
domain definition.

But, we can do even better - just mimic whatever we're doing for
hostdevs. IOW - introduce qemuDomainAdjustMaxMemLockNVMe() that
behaves the same as qemuDomainAdjustMaxMemLockHostdev().

There are subtle differences though:

1) qemuDomainAdjustMaxMemLockHostdev() can afford placing hostdev
   right at the end of vm->def->hostdevs, because the array was
   already reallocated (at the beginning of
   qemuDomainAttachHostPCIDevice()). But
   qemuDomainAdjustMaxMemLockNVMe() doesn't have that luxury.

2) qemuDomainAdjustMaxMemLockHostdev() places a
   virDomainHostdevDef pointer into domain definition, while
   qemuDomainStorageSourceAccessModifyNVMe() (which calls
   qemuDomainAdjustMaxMemLock()) sees a virStorageSource pointer
   but domain definition contains virDomainDiskDef. But that's
   okay, we can create a dummy disk definition and append it into
   the domain definition.

After this, qemuDomainAdjustMaxMemLock() can be called with
@forceVFIO = false, as the disk is now part of domain definition
(when computing the new limit).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2014030#c28
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoschemas: backup: Allow missing 'type' attribute for backup disk
Peter Krempa [Mon, 15 May 2023 12:28:06 +0000 (14:28 +0200)]
schemas: backup: Allow missing 'type' attribute for backup disk

One of our examples in the 'formatbackup.rst' page shows following
config:

  <disk name='vda' backup='yes'/>

The schema didn't allow it though. Fix the schema as the internals were
supposed to support it (except for the bug fixed in previous patches).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoconf: backup: Fix logic for generating default backup filenames
Peter Krempa [Mon, 15 May 2023 12:20:16 +0000 (14:20 +0200)]
conf: backup: Fix logic for generating default backup filenames

If the 'disk->store' property is already allocated which happens e.g.
when the disk is described by the backup XML but the optional filename
is not filled in 'virDomainBackupDefAssignStore' would not fill in the
default location.

Fix the logic to do it also if a 'virStorageSource' categorizes as
empty.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agovirDomainBackupDefAssignStore: Restructure control flow
Peter Krempa [Mon, 15 May 2023 10:17:06 +0000 (12:17 +0200)]
virDomainBackupDefAssignStore: Restructure control flow

Return early for errors instead of using 'else' branches.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agovirmockstathelpers: Adapt to musl-1.2.4
Michal Privoznik [Mon, 15 May 2023 09:56:51 +0000 (11:56 +0200)]
virmockstathelpers: Adapt to musl-1.2.4

With musl-1.2.3: I get the following macros defined (from
$builddir/meson-config.h):

  #define WITH_LSTAT 1
  #define WITH_LSTAT64 1
  #define WITH_LSTAT_DECL 1
  #define WITH_STAT 1
  #define WITH_STAT64 1
  #define WITH_STAT_DECL 1
  #define WITH___LXSTAT 1
  #define WITH___LXSTAT64 1
  #define WITH___XSTAT 1
  #define WITH___XSTAT64 1

which in turn means the virmockstathelpers.c ends up defining:

  MOCK_STAT64
  MOCK_LSTAT64

But with  musl-1.2.4 everything changes and the set of defined
macros gets simplified to:

  #define WITH_LSTAT 1
  #define WITH_LSTAT_DECL 1
  #define WITH_STAT 1
  #define WITH_STAT_DECL 1
  #define WITH___LXSTAT 1
  #define WITH___XSTAT 1

which results in no MOCK_* macros defined in
virmockstathelpers.c, i.e. no stat() mocking, nada. The reason
for this simplification are these musl commits [1][2] which
removed all 64 bit aliases. And that's not what our logic for
deciding what flavor of stat() to mock counted with.

Nevertheless, we do build with Alpine Linux in our CI, so how
come we don't see this problem there? Well, simply because Alpine
Linux maintainers decided to revert the commits [3][4]. But on
distributions that use vanilla musl, this problem can be seen
easily.

1: https://git.musl-libc.org/cgit/musl/commit/?id=246f1c811448f37a44b41cd8df8d0ef9736d95f4
2: https://git.musl-libc.org/cgit/musl/commit/?id=25e6fee27f4a293728dd15b659170e7b9c7db9bc
3: https://git.alpinelinux.org/aports/commit/main/musl?id=6a5563fbb45b3d9d60678d7bbf60dbb312a2d481
4: https://git.alpinelinux.org/aports/commit/main/musl?id=a089bd852f8983623fa85e0f5755a3e25bf53c72

Resolves: https://bugs.gentoo.org/906167
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoTranslated using Weblate (Hungarian)
Dankaházi (ifj.) István [Fri, 12 May 2023 18:21:07 +0000 (20:21 +0200)]
Translated using Weblate (Hungarian)

Currently translated at 2.7% (284 of 10399 strings)

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

Co-authored-by: Dankaházi (ifj.) István <dankahazi.istvan@gmail.com>
Signed-off-by: Dankaházi (ifj.) István <dankahazi.istvan@gmail.com>
23 months agoqemu: Update documentation for dbus_daemon qemu.conf key
Andrea Bolognani [Wed, 10 May 2023 17:59:45 +0000 (19:59 +0200)]
qemu: Update documentation for dbus_daemon qemu.conf key

Reflect the new default value, and explain that a runtime
lookup will be performed if the value is not an absolute path.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agomeson: Stop looking for dbus-daemon
Andrea Bolognani [Wed, 10 May 2023 17:58:23 +0000 (19:58 +0200)]
meson: Stop looking for dbus-daemon

Now that we're performing the lookup at runtime, doing it at
build time is no longer necessary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agoqemu: Find dbus-daemon at runtime
Andrea Bolognani [Wed, 10 May 2023 17:56:59 +0000 (19:56 +0200)]
qemu: Find dbus-daemon at runtime

Don't bother looking at /usr/libexec, since every distro
ships dbus-daemon in $PATH.

Note that it's still possible for the administrator to prevent
this lookup and use an arbitrary binary by setting the
appropriate key in qemu.conf.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu: Update documentation for qemu.conf keys
Andrea Bolognani [Fri, 5 May 2023 16:55:46 +0000 (18:55 +0200)]
qemu: Update documentation for qemu.conf keys

Reflect the new default value, and explain that a runtime
lookup will be performed if the value is not an absolute path.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agomeson: Stop looking for QEMU helpers
Andrea Bolognani [Tue, 25 Apr 2023 14:30:44 +0000 (16:30 +0200)]
meson: Stop looking for QEMU helpers

Now that we're performing the lookup at runtime, doing it at
build time is no longer necessary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemu: Find helpers at runtime
Andrea Bolognani [Tue, 25 Apr 2023 14:38:53 +0000 (16:38 +0200)]
qemu: Find helpers at runtime

Use the recently introduced virFindFileInPathFull() function to
discover the path for qemu-bridge-helper and qemu-pr-helper at
runtime.

Note that it's still possible for the administrator to prevent
this lookup and use arbitrary binaries by setting the
appropriate keys in qemu.conf: this simply removes the need to
perform the lookup at build time, and thus to have the helpers
installed in the build environment.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoutil: Introduce virFileFindInPathFull()
Andrea Bolognani [Tue, 25 Apr 2023 14:18:35 +0000 (16:18 +0200)]
util: Introduce virFileFindInPathFull()

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoutil: Small refactor
Andrea Bolognani [Tue, 25 Apr 2023 14:11:07 +0000 (16:11 +0200)]
util: Small refactor

Prepare for further changes.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoci: integration: Flip QEMU upstream integration tests to Fedora 38
Erik Skultety [Wed, 3 May 2023 06:13:30 +0000 (08:13 +0200)]
ci: integration: Flip QEMU upstream integration tests to Fedora 38

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agoci: Flip mingw jobs from Fedora 37 to Fedora 38
Erik Skultety [Tue, 2 May 2023 15:10:34 +0000 (17:10 +0200)]
ci: Flip mingw jobs from Fedora 37 to Fedora 38

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agoci: Drop Fedora 36 target
Erik Skultety [Tue, 2 May 2023 15:08:58 +0000 (17:08 +0200)]
ci: Drop Fedora 36 target

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agoci: Add Fedora 38 target
Erik Skultety [Tue, 2 May 2023 15:08:21 +0000 (17:08 +0200)]
ci: Add Fedora 38 target

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agoTranslated using Weblate (Hungarian)
Dankaházi (ifj.) István [Wed, 10 May 2023 12:20:57 +0000 (14:20 +0200)]
Translated using Weblate (Hungarian)

Currently translated at 2.3% (243 of 10399 strings)

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

Co-authored-by: Dankaházi (ifj.) István <dankahazi.istvan@gmail.com>
Signed-off-by: Dankaházi (ifj.) István <dankahazi.istvan@gmail.com>
2 years agovirfirewallmock: Replace virFindFileInPath() with virFirewallDIsRegistered()
Michal Privoznik [Wed, 3 May 2023 08:44:10 +0000 (10:44 +0200)]
virfirewallmock: Replace virFindFileInPath() with virFirewallDIsRegistered()

Neither of tests that use virfirewallmock.c
(networkxml2firewalltest, nwfilterebiptablestest,
nwfilterxml2firewalltest, virfirewalltest) really call
virFindFileInPath(). But at least networkxml2firewalltest calls
virFirewallDIsRegistered(), under the hood. Now, the actual
implementation connects to dbus and something, which is
definitely not what we want in our test suite.

Therefore, drop virFindFileInPath() implementation and provide
implementation for virFirewallDIsRegistered() which just returns
-2 to signal that firewalld is not registered.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
2 years agoutil: include virfirewall.h in virfirewalld.h
Michal Privoznik [Wed, 3 May 2023 08:42:12 +0000 (10:42 +0200)]
util: include virfirewall.h in virfirewalld.h

The virfirewalld.h file provides a declaration for
virFirewallDApplyRule() which accepts an argument of type
virFirewallLayer. But the typedef lives in virfirewall.h and thus
including just virfirewalld.h is not sufficient.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
2 years agoconf: qemu: Add support for multi-channel mode for 'usb' sound cards
Peter Krempa [Tue, 9 May 2023 11:10:30 +0000 (13:10 +0200)]
conf: qemu: Add support for multi-channel mode for 'usb' sound cards

Allow users controlling the multi-channel mode by adding a
'multichannel' property parsed for USB audio devices and wire up the
support in the qemu driver.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/472
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: Register autoptr cleanup for 'virDomainSoundDef' and refactor virDomainSoundDef...
Peter Krempa [Tue, 9 May 2023 11:35:10 +0000 (13:35 +0200)]
conf: Register autoptr cleanup for 'virDomainSoundDef' and refactor virDomainSoundDefParseXML

Use our modern cleanup path pattern.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2(argv|xml)test: Modernize 'sound-device' case
Peter Krempa [Tue, 9 May 2023 11:13:19 +0000 (13:13 +0200)]
qemuxml2(argv|xml)test: Modernize 'sound-device' case

Drop the unnecessary disk definition and use x86_64 emulator.

For 'qemuxml2argvtest' replace the fake-caps invocation by a 4.2.0
version-locked invocation and  add a '_CAPS_LATEST' invocation.

For 'qemuxml2xmltest' convert to use '_CAPS_LATEST' only.

There are no sound-device relevant changes in the output files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2(argv|xml)test: Remove 'sound' case
Peter Krempa [Tue, 9 May 2023 11:18:18 +0000 (13:18 +0200)]
qemuxml2(argv|xml)test: Remove 'sound' case

The test case is a subset of what the 'sound-device' case tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agodocs: formatdomain: Use code blocks to emphasize various sound device options
Peter Krempa [Tue, 9 May 2023 11:00:13 +0000 (13:00 +0200)]
docs: formatdomain: Use code blocks to emphasize various sound device options

Emphasize the various sound card models and other config options by
using ``...``.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: Report domain name in unexpectedly closed monitor message
Michal Privoznik [Tue, 9 May 2023 07:51:40 +0000 (10:51 +0300)]
qemu: Report domain name in unexpectedly closed monitor message

When QEMU closes the monitor suddenly, the following error
message is reported:

  internal error: qemu unexpectedly closed the monitor: ...

And this works. But other error messages produced in the same
function include domain name too. Do that for the unexpectedly
closed monitor message too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agologging: Provide empty VIRTLOGD_ARGS in the unit file
Michal Privoznik [Tue, 9 May 2023 08:58:34 +0000 (11:58 +0300)]
logging: Provide empty VIRTLOGD_ARGS in the unit file

For all our daemons, we provide VIRXXXD_ARGS env var in the unit
file. The variable can then be overridden in corresponding file:

  EnvironmentFile=-@initconfdir@/virtxxxd

The daemon is then executed as:

  ExecStart=@sbindir@/virtxxxd $VIRTXXXD_ARGS

But virtlogd is exception, for no good reason. And while there
are probably no arguments we want to pass to virtlogd by default,
just mimic what we do for say virtlockd, where we also don't pass
any default argument.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years ago.gitlab-ci.yml: Fix Leap 15.4 codestyle job
Erik Skultety [Wed, 3 May 2023 09:09:15 +0000 (11:09 +0200)]
.gitlab-ci.yml: Fix Leap 15.4 codestyle job

Commit a3cc0e9ceb3e forgot to tweak the codestyle job so that we refer
to Leap 15.4 as Leap 15 (with the recent change in lcitool). However,
it was easy to miss as that job is not managed by the manifest.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agoqemu: hotplug: Reorder setup of disk backend metadata
Peter Krempa [Fri, 5 May 2023 12:43:17 +0000 (14:43 +0200)]
qemu: hotplug: Reorder setup of disk backend metadata

The regular VM startup code first calls the setup of the disk backing
chain as defined in the XML and then calls the function to load the
rest of the backing chain from the image metadata. The hotplug code
did it the other way around, thus causing a failure when attempting
to attach a QCOW2 image via FD passing.

Reorder the hotplug code to have the same order.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2193315
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agomeson: Improve initconfdir defaults
Andrea Bolognani [Sun, 30 Apr 2023 10:02:38 +0000 (12:02 +0200)]
meson: Improve initconfdir defaults

Keep /etc/sysconfig as the fallback, but pick more suitable
values for various Linux distros.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agomeson: Move definition of os_release
Andrea Bolognani [Sun, 30 Apr 2023 09:52:27 +0000 (11:52 +0200)]
meson: Move definition of os_release

We're about to introduce another user of the value in a
different scope.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agorpm: Set initconfdir explicitly
Andrea Bolognani [Sat, 29 Apr 2023 16:52:24 +0000 (18:52 +0200)]
rpm: Set initconfdir explicitly

The default would already work fine for Fedora and RHEL, but
it's better to be explicit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agomeson: Use initconfdir
Andrea Bolognani [Sat, 29 Apr 2023 16:23:12 +0000 (18:23 +0200)]
meson: Use initconfdir

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agomeson: Introduce initconfdir option
Andrea Bolognani [Sat, 29 Apr 2023 16:13:56 +0000 (18:13 +0200)]
meson: Introduce initconfdir option

Right now we expect the configuration files for init scripts
to live in /etc/sysconfig, but that location is only used by
RHEL- and SUSE-derived distros.

This means that packagers for other distros have to patch
things as part of the build process, while people building
from source will get wonky integration.

This new option will provide a convenient way to override
the default location at build time that is usable by distro
packagers and people building from source alike.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoutil: Improve comment for workaround
Andrea Bolognani [Tue, 25 Apr 2023 13:33:02 +0000 (15:33 +0200)]
util: Improve comment for workaround

Now that a version of GLib that contains the fix has been
released, it's more useful to record that information. Adding
a TODO annotation makes the whole thing easily greppable.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: Fix error message
Andrea Bolognani [Tue, 25 Apr 2023 14:27:13 +0000 (16:27 +0200)]
qemu: Fix error message

The spelling is slightly different from another otherwise
identical error message in the same file.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2 years agocpu_riscv64.c: add update() implementation
Daniel Henrique Barboza [Fri, 28 Apr 2023 19:57:28 +0000 (16:57 -0300)]
cpu_riscv64.c: add update() implementation

At this moment it is not possible to launch a 'riscv64' domain if a CPU
definition is presented in the domain. For example, adding this CPU
definition:

  <cpu mode='custom' match='exact' check='none'>
    <model fallback='forbid'>rv64</model>
  </cpu>

Will trigger the following error:

$ sudo ./run tools/virsh start riscv-virt1
error: Failed to start domain 'riscv-virt1'
error: this function is not supported by the connection driver:
       cannot update guest CPU for riscv64 architecture

The error comes from virCPUUpdate(), via qemuProcessUpdateGuestCPU(),
and it's caused by the absence of the 'update' API in the existing
RISC-V driver.

Add an 'update' API impl to the RISC-V driver to allow for CPU
definitions to be declared in RISC-V domains. This API was copied from
the ARM driver (virCPUarmUpdate()) since it's a good enough
implementation to get us going.

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agomeson: Fix qemu_{user,group} defaults for Arch
Andrea Bolognani [Sun, 30 Apr 2023 09:07:49 +0000 (11:07 +0200)]
meson: Fix qemu_{user,group} defaults for Arch

The current values might have been accurate at the time
when the logic was introduced, but these days Arch is
using the same ones as Debian.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat>
2 years agotools: virsh-domain: display progress with enhanced granularity
Shaleen Bathla [Wed, 26 Apr 2023 11:28:33 +0000 (16:58 +0530)]
tools: virsh-domain: display progress with enhanced granularity

Switch from int to double for displaying job progress upto 2 decimal
places.

Signed-off-by: Shaleen Bathla <shaleen.bathla@oracle.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agotools: virsh-domain: refactor variable initialization
Shaleen Bathla [Wed, 26 Apr 2023 11:28:32 +0000 (16:58 +0530)]
tools: virsh-domain: refactor variable initialization

Signed-off-by: Shaleen Bathla <shaleen.bathla@oracle.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemu: Use configured iothread poll parameters on startup
Peter Krempa [Thu, 23 Feb 2023 13:27:17 +0000 (14:27 +0100)]
qemu: Use configured iothread poll parameters on startup

Implement the support for the persisted poll parameters and remove
restrictions on saving config when modifying them during runtime.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: Store the iothread 'poll' settings in the XML
Peter Krempa [Thu, 23 Feb 2023 12:48:35 +0000 (13:48 +0100)]
conf: Store the iothread 'poll' settings in the XML

Currently we allow configuring the 'poll-max-ns', 'poll-grow', and
'poll-shrink' parameters of qemu iothreads only during runtime and they
are not persisted. Add XML machinery to persist them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirsh: cmdIOThreadSet: Use bigger types for --poll-grow and --poll-shrink
Peter Krempa [Wed, 19 Apr 2023 10:39:00 +0000 (12:39 +0200)]
virsh: cmdIOThreadSet: Use bigger types for --poll-grow and --poll-shrink

The qemu driver now accepts also _ULLONG as type for bigger numbers. Use
the 'virTypedParamListAddUnsigned' helper to use the bigger typed
parameter type if necessary to allow full range of the values while
preserving compatibility.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: Store all iothread's 'poll*' attributes as unsigned long long
Peter Krempa [Wed, 19 Apr 2023 10:38:45 +0000 (12:38 +0200)]
qemu: Store all iothread's 'poll*' attributes as unsigned long long

Convert the internal types to unsigned long long. Luckily we can also
covert the external types too:

 - 'qemuDomainSetIOThreadParams' can accept both _UINT and _ULLONG by
   converting to 'virTypedParamsGetUnsigned'

 - querying is handled via the bulk stats API which is flexible:
    - we use virTypedParamListAddUnsigned to use the bigger type only if
      necessary
    - most users don't even notice because the bindings abstract the
      data types

Apart from the code modifications we also improve the documentation
which was missing for the setters.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: Remove iothread 'poll-' value validation
Peter Krempa [Wed, 19 Apr 2023 10:37:01 +0000 (12:37 +0200)]
qemu: Remove iothread 'poll-' value validation

QEMU accepts even values bigger than INT_MAX. The reasoning for these
checks was that the QAPI definition declares them as 'int', but in QAPI
terms that's any number as it's JSON.

Remove the validation as well as the comment misinterpreting the QAPI
definiton.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirsh: cmdIOThreadSet: Refactor to use virTypedParamList
Peter Krempa [Tue, 18 Apr 2023 20:51:24 +0000 (22:51 +0200)]
virsh: cmdIOThreadSet: Refactor to use virTypedParamList

Refactor to use the new data type so that we can use the APIs of it in
upcoming patches.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirTypedParamsValidate: Allow typed params to be both _UINT and _ULLONG
Peter Krempa [Wed, 19 Apr 2023 08:29:14 +0000 (10:29 +0200)]
virTypedParamsValidate: Allow typed params to be both _UINT and _ULLONG

For certain typed parameters we want to extend the supproted range by
switching to VIR_TYPED_PARAM_ULLONG. To preserve compatibility we've
added APIs such as 'virTypedParamsGetUnsigned' and
'virTypedParamListAddUnsigned' which automatically select the bigger
type if necessary.

This patch adds a new internal macro VIR_TYPED_PARAM_UNSIGNED which
is used with virTypedParamsValidate to allow both types and adjusts the
code to handle it properly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirTypedParamsValidate: Refactor variable declaration and cleanup
Peter Krempa [Wed, 19 Apr 2023 08:37:09 +0000 (10:37 +0200)]
virTypedParamsValidate: Refactor variable declaration and cleanup

Use automatic memory cleanup for the 'keys' and 'sorted' helpers and
remove the 'cleanup' label. Since this patch is modifying variable
declarations ensure that all declarations conform with our coding style.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: virtypedparam: Introduce virTypedParamsGetUnsigned
Peter Krempa [Tue, 18 Apr 2023 11:43:56 +0000 (13:43 +0200)]
util: virtypedparam: Introduce virTypedParamsGetUnsigned

Add an internal helper for fetching a typed parameter which can be
either of the '_UINT' or '_ULONG' type and store it in a unsigned long
long variable.

Since this is an internal helper it offers less protections against
invalid use compared to those we expose as public API.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: typedparam: Introduce virTypedParamListAddUnsigned
Peter Krempa [Tue, 18 Apr 2023 11:30:02 +0000 (13:30 +0200)]
util: typedparam: Introduce virTypedParamListAddUnsigned

The new helper adds a unsigned value, stored as _UINT if it fits into
the type and stored as _ULLONG otherwise.

This is useful for the statistics code which is quite tolerant to
changes in type in cases when we'll need more range for the value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: virtypedparam: Remove return values from virTypedParamListAdd* APIs
Peter Krempa [Tue, 18 Apr 2023 14:52:30 +0000 (16:52 +0200)]
util: virtypedparam: Remove return values from virTypedParamListAdd* APIs

The function now return always 0. Refactor the code and remove return
values.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: virtypedparam: Store errors inside virTypedParamList
Peter Krempa [Tue, 18 Apr 2023 14:49:17 +0000 (16:49 +0200)]
util: virtypedparam: Store errors inside virTypedParamList

The only non-abort()-ing error which can happen is if the field name is
too long. Store the overly long name in the virTypedParamList container
so that in upcoming patches the helpers adding to the list can be
refactored to not have a return value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: virtypedparam: Refactor return value of virTypedParamListStealParams
Peter Krempa [Tue, 18 Apr 2023 14:19:58 +0000 (16:19 +0200)]
util: virtypedparam: Refactor return value of virTypedParamListStealParams

Return the number of parameters via pointer passed as argument to free
up possibility to report errors. Strangely all callers actually use
'int' as type for storing the count of elements, thus this function will
use the same.

The function is also renamed to virTypedParamListSteal.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: virtypedparam: Privatize definition of struct _virTypedParamList
Peter Krempa [Tue, 18 Apr 2023 13:08:45 +0000 (15:08 +0200)]
util: virtypedparam: Privatize definition of struct _virTypedParamList

Ensure that all callers access it via the APIs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoUse 'virTypedParamListFetch' for extracting identity parameters list
Peter Krempa [Tue, 18 Apr 2023 13:47:42 +0000 (15:47 +0200)]
Use 'virTypedParamListFetch' for extracting identity parameters list

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: virtypedparam: Introduce 'virTypedParamListFetch'
Peter Krempa [Tue, 18 Apr 2023 13:45:31 +0000 (15:45 +0200)]
util: virtypedparam: Introduce 'virTypedParamListFetch'

Introduce a helper that fetches the typed parameters from the list while
still preserving ownership of the pointer by the list.

In the future this will be also able to report errors stored in the
list.

Signed-off-by: Peter Krempa <pkrempa@redhat.com
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuDomainGetStatsBlock: Don't directly access virTypedParamList
Peter Krempa [Tue, 18 Apr 2023 13:33:24 +0000 (15:33 +0200)]
qemuDomainGetStatsBlock: Don't directly access virTypedParamList

The struct will be made private in upcoming patches. Construct the list
of block entries into a separate list and append them rather than
remember the index of the count element.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoutil: typedparam: Introduce 'virTypedParamListConcat'
Peter Krempa [Tue, 18 Apr 2023 13:30:16 +0000 (15:30 +0200)]
util: typedparam: Introduce 'virTypedParamListConcat'

Introduce a helper function to concatenate two virTypedParamLists. This
will allow us to refactor qemuDomainGetStatsBlock to not access the list
directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoutil: virtypedparam: Introduce virTypedParamListNew()
Peter Krempa [Tue, 18 Apr 2023 13:20:09 +0000 (15:20 +0200)]
util: virtypedparam: Introduce virTypedParamListNew()

Add an allocator function and refactor all allocations to use it. In
upcoming patches 'struct _virTypedParamList' will be made private.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agovirtypedparam.h: Consistently use contemporary header style
Peter Krempa [Wed, 19 Apr 2023 10:52:20 +0000 (12:52 +0200)]
virtypedparam.h: Consistently use contemporary header style

The header uses both styles randomly, switch it to the contemporary
style.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoutil: virtypedparam: Simplify error handling in virTypedParamListAdd*
Peter Krempa [Tue, 18 Apr 2023 13:06:32 +0000 (15:06 +0200)]
util: virtypedparam: Simplify error handling in virTypedParamListAdd*

Don't check the return value of 'virTypedParamListExtend' which will
always be a valid pointer and 'virTypedParameterAssignValue' always
returns 0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agovirTypedParameterAssignValueVArgs: Ensure proper typed param type in caller
Peter Krempa [Tue, 18 Apr 2023 12:51:31 +0000 (14:51 +0200)]
virTypedParameterAssignValueVArgs: Ensure proper typed param type in caller

There are two callers of virTypedParameterAssignValueVArgs.

- 'virTypedParameterAssignValue' always uses the correct type, thus
  doesn't need to be modified. Just use the proper type in the function
  declaration

- 'virTypedParameterAssign' can get improper type, but we can move the
  validation into it decreasing the scope in which failures need to be
  propagated.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agovirTypedParamsDeserialize: Remove unnecessary line breaks
Peter Krempa [Tue, 18 Apr 2023 12:45:32 +0000 (14:45 +0200)]
virTypedParamsDeserialize: Remove unnecessary line breaks

All changed lines even fit into 80 columns.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoutil: virtypedparam: Use proper enum type for all switch() statements
Peter Krempa [Tue, 18 Apr 2023 12:43:34 +0000 (14:43 +0200)]
util: virtypedparam: Use proper enum type for all switch() statements

Ensure that all switch statements in this module use the proper type in
switch() statements to ensure complier protections.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agovirTypedParameterAssignValue: Drop 'copystr' parameter
Peter Krempa [Tue, 18 Apr 2023 12:34:39 +0000 (14:34 +0200)]
virTypedParameterAssignValue: Drop 'copystr' parameter

All callers pass 'true'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoPost-release version bump to 9.4.0
Jiri Denemark [Tue, 2 May 2023 12:18:37 +0000 (14:18 +0200)]
Post-release version bump to 9.4.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoRelease of libvirt-9.3.0
Jiri Denemark [Tue, 2 May 2023 12:15:48 +0000 (14:15 +0200)]
Release of libvirt-9.3.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoNEWS: Update news for the 9.3.0 release
Peter Krempa [Tue, 2 May 2023 11:23:15 +0000 (13:23 +0200)]
NEWS: Update news for the 9.3.0 release

Update the news file mentioning important changes such as the change of
translatable strings or the fix of inactive snapshots of VMs using uefi.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirpci: Resolve leak in virPCIVirtualFunctionList cleanup
Tim Shearer [Mon, 1 May 2023 13:15:48 +0000 (13:15 +0000)]
virpci: Resolve leak in virPCIVirtualFunctionList cleanup

Repeatedly querying an SR-IOV PCI device's capabilities exposes a
memory leak caused by a failure to free the virPCIVirtualFunction
array within the parent struct's g_autoptr cleanup.

Valgrind output after getting a single interface's XML description
1000 times:

==325982== 256,000 bytes in 1,000 blocks are definitely lost in loss record 2,634 of 2,635
==325982==    at 0x4C3C096: realloc (vg_replace_malloc.c:1437)
==325982==    by 0x59D952D: g_realloc (in /usr/lib64/libglib-2.0.so.0.5600.4)
==325982==    by 0x4EE1F52: virReallocN (viralloc.c:52)
==325982==    by 0x4EE1FB7: virExpandN (viralloc.c:78)
==325982==    by 0x4EE219A: virInsertElementInternal (viralloc.c:183)
==325982==    by 0x4EE23B2: virAppendElement (viralloc.c:288)
==325982==    by 0x4F65D85: virPCIGetVirtualFunctionsFull (virpci.c:2389)
==325982==    by 0x4F65753: virPCIGetVirtualFunctions (virpci.c:2256)
==325982==    by 0x505CB75: virNodeDeviceGetPCISRIOVCaps (node_device_conf.c:2969)
==325982==    by 0x505D181: virNodeDeviceGetPCIDynamicCaps (node_device_conf.c:3099)
==325982==    by 0x505BC4E: virNodeDeviceUpdateCaps (node_device_conf.c:2677)
==325982==    by 0x260FCBB2: nodeDeviceGetXMLDesc (node_device_driver.c:355)

Signed-off-by: Tim Shearer <tshearer@adva.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Fri, 28 Apr 2023 04:21:01 +0000 (06:21 +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 (Korean)
김인수 [Fri, 28 Apr 2023 04:21:01 +0000 (06:21 +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 agomeson: Check header usability
Andrea Bolognani [Thu, 27 Apr 2023 09:30:59 +0000 (11:30 +0200)]
meson: Check header usability

This fixes cross-building in some scenarios.

Specifically, when building for armv7l on x86_64, has_header()
will see the x86_64 version of the linux/kmv.h header and
consider it to be usable. Later, when an attempt is made to
actually include it, the compiler will quickly realize that
things can't quite work.

The reason why we haven't hit this in our CI is that we only ever
install the foreign version of header files. When building the
Debian package, however, some of the Debian-specific tooling will
bring in the native version of the Linux headers in addition to
the foreign one, causing meson to misreport the header's
availability status.

Checking for actual usability, as opposed to mere presence, of
headers is enough to make things work correctly in all cases.

The meson documentation recommends using has_header() instead of
check_header() whenever possible for performance reasons, but
while testing this change on fairly old and underpowered hardware
I haven't been able to measure any meaningful slowdown.

https://bugs.debian.org/1024504

Suggested-by: Helmut Grohne <helmut@subdivi.de>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoci: Regenerate files
Michal Privoznik [Thu, 27 Apr 2023 06:48:21 +0000 (08:48 +0200)]
ci: Regenerate files

This removes minor version number from OpenSUSE LEAP target names
and on CentOS Stream 9 installs flake8 from repositories, instead
of pip.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2 years agodocs: Drop java.rst
Andrea Bolognani [Thu, 27 Apr 2023 07:42:47 +0000 (09:42 +0200)]
docs: Drop java.rst

We no longer link to it from anywhere, and a server-side
redirect has been created to keep existing external links
working.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agodocs: Link to java.libvirt.org
Andrea Bolognani [Thu, 27 Apr 2023 07:42:03 +0000 (09:42 +0200)]
docs: Link to java.libvirt.org

All the information from java.rst have been transferred
to the subproject's own website.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoUpdate translation files
Weblate [Tue, 25 Apr 2023 11:18:56 +0000 (13:18 +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.3.0
Jiri Denemark [Tue, 25 Apr 2023 11:15:35 +0000 (13:15 +0200)]
po: Refresh potfile for v9.3.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoqemu: Stop virQEMUCaps propagation into qemuHostdevPreparePCIDevices()
Michal Privoznik [Mon, 24 Apr 2023 08:20:52 +0000 (10:20 +0200)]
qemu: Stop virQEMUCaps propagation into qemuHostdevPreparePCIDevices()

After previous cleanups, qemuHostdevPreparePCIDevices() no longer
needs virQEMUCaps. Drop its passing from callers.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemu: Remove empty functions
Michal Privoznik [Fri, 14 Apr 2023 11:12:45 +0000 (13:12 +0200)]
qemu: Remove empty functions

After previous cleanup, there are some functions that do nothing:

  qemuConnectDomainXMLToNativePrepareHostHostdev()
  qemuConnectDomainXMLToNativePrepareHost()
  qemuProcessPrepareHostHostdev()
  qemuProcessPrepareHostHostdevs()

Remove them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemu: Move <hostdev> SCSI path generation into qemuDomainPrepareHostdev()
Michal Privoznik [Fri, 14 Apr 2023 11:09:53 +0000 (13:09 +0200)]
qemu: Move <hostdev> SCSI path generation into qemuDomainPrepareHostdev()

When preparing a SCSI <hostdev/> with passthrough of a host SCSI
adapter (i.e. no protocol), a virStorageSource structure is
initialized and stored inside virDomainHostdevDef. But the source
structure is filled in many places, with almost the same code.

Firstly, qemuProcessPrepareHostHostdev() and
qemuConnectDomainXMLToNativePrepareHostHostdev() are the same.

Secondly, qemuDomainPrepareHostdev() allocates the src structure,
only to let qemuProcessPrepareHostHostdev() fill src->path later.

Well, src->path can be filled at the same place where the src
structure is allocated (qemuDomainPrepareHostdev()) which renders
the other two functions needless.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemu_hotplug: Drop PCI backend check in qemuDomainAttachHostPCIDevice()
Michal Privoznik [Mon, 24 Apr 2023 07:53:33 +0000 (09:53 +0200)]
qemu_hotplug: Drop PCI backend check in qemuDomainAttachHostPCIDevice()

There is no way the qemuDomainAttachHostPCIDevice() function can
be called over a hostdev with PCI backend other than VFIO. And
even if it were, then the check is written so poorly that it lets
some types through (e.g. KVM) only to let
qemuBuildPCIHostdevDevProps() called afterwards fail properly.

Drop this check and rely on qemuDomainPrepareHostdevPCI() (and
worst case scenario even qemuBuildPCIHostdevDevProps()) to report
the proper error.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemu: Deny all but VFIO PCI backends in hostdev prepare phase
Michal Privoznik [Mon, 24 Apr 2023 10:12:57 +0000 (12:12 +0200)]
qemu: Deny all but VFIO PCI backends in hostdev prepare phase

We used to support KVM and VFIO style of PCI assignment. The
former was dropped in v5.7.0-rc1~103 and thus we only support
VFIO. All other backends lead to an error (see
qemuBuildPCIHostdevDevProps(), or qemuBuildPCIHostdevDevStr() as
it used to be called in the era of aforementioned commit).

Might as well report the error in prepare phase and save hassle
of proceeding with device preparation (e.g. in case of hotplug
overriding the device's driver, setting seclabels, etc.).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemuxml2argvtest: Drop needless PCI backend setting
Michal Privoznik [Mon, 24 Apr 2023 07:51:46 +0000 (09:51 +0200)]
qemuxml2argvtest: Drop needless PCI backend setting

The qemuxml2argvtest does a bit of 'fixups' to parsed
virDomainDef just before generating the cmd line. For instance,
it sets PCI backend for hostdevs (to VFIO). The reason for this
is that we want to make the test host independent and thus
letting the code chose backend at runtime might render different
results on different machines. But this is not necessary, as
virpcimock (that the test uses) already creates a fake, but
stable environment (where /dev/vfio/vfio and IOMMU groups exist),
thus qemuHostdevHostSupportsPassthroughVFIO() returns true,
regardless of the actual host support.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemu: Move <hostdev/> PCI backend setting into qemuDomainPrepareHostdev()
Michal Privoznik [Fri, 21 Apr 2023 14:56:10 +0000 (16:56 +0200)]
qemu: Move <hostdev/> PCI backend setting into qemuDomainPrepareHostdev()

virsh command domxml-to-native failed with below error but start
command succeed for same domain xml.

  "internal error: invalid PCI passthrough type 'default'"

If a <hostdev> PCI backend is not set in the XML, the supported
one is then chosen in qemuHostdevPreparePCIDevicesCheckSupport().
But this function is not called anywhere from
qemuConnectDomainXMLToNative(). But qemuDomainPrepareHostdev()
is. And it is also called from domain startup/hotplug code.
Therefore, move the backend setting to the common path and drop
qemuHostdevPreparePCIDevicesCheckSupport().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>