]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
21 months agoconf/domain_validate.c: Improve the err for queue validation
Han Han [Fri, 21 Jul 2023 02:36:39 +0000 (10:36 +0800)]
conf/domain_validate.c: Improve the err for queue validation

Queues is supported by virtio bus, including virtio-blk and
vhost-user-blk.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agoTranslated using Weblate (Swedish)
Göran Uddeborg [Thu, 20 Jul 2023 21:21:05 +0000 (23:21 +0200)]
Translated using Weblate (Swedish)

Currently translated at 51.0% (5310 of 10395 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
21 months agoqemu_monitor: Remove helpers for 'query-commands'
Peter Krempa [Fri, 14 Jul 2023 13:25:08 +0000 (15:25 +0200)]
qemu_monitor: Remove helpers for 'query-commands'

Now that we don't use it for probing at all we can remove all the
corresponding monitor code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
21 months agoqemu: capabilities: Don't probe 'query-commands'
Peter Krempa [Fri, 14 Jul 2023 13:19:15 +0000 (15:19 +0200)]
qemu: capabilities: Don't probe 'query-commands'

The capability code now probes the presence of commands from the QMP
schema instead of using 'query-commands'. Don't call the command and
adjust the '.replies' files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
21 months agoqemu: capabilities: Probe presence of commands from QMP schema instead of 'query...
Peter Krempa [Fri, 14 Jul 2023 13:16:32 +0000 (15:16 +0200)]
qemu: capabilities: Probe presence of commands from QMP schema instead of 'query-commands'

Move the probing code to extract the data from the QMP schema rather
than invoking 'query-commands'. This patch doesn't yet remove the actual
invocation of 'query-commands', just moves the actual probing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
21 months agonode_device: Don't leak error message buffer from virMdevctlListDefined|Active
Peter Krempa [Wed, 19 Jul 2023 13:22:22 +0000 (15:22 +0200)]
node_device: Don't leak error message buffer from virMdevctlListDefined|Active

nodeDeviceUpdateMediatedDevices invokes virMdevctlListDefined and
virMdevctlListActive both of which were passed the same 'errmsg' buffer.

Since virCommandSetErrorBuffer() always allocates the error buffer one
of them was leaked.

Fix it by populating the 'errmsg' buffer only on failure of
virMdevctlListActive|Defined which invoke the command.

Add a comment to nodeDeviceGetMdevctlListCommand reminding how
virCommandSetErrorBuffer() works.

Fixes: 44a0f2f0c8f
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
21 months agoqemu: capabilities: Retire QEMU_CAPS_(IDE|SCSI)_DRIVE_WWN
Peter Krempa [Tue, 18 Jul 2023 13:54:38 +0000 (15:54 +0200)]
qemu: capabilities: Retire QEMU_CAPS_(IDE|SCSI)_DRIVE_WWN

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
21 months agoqemu: Always assume support for QEMU_CAPS_IDE_DRIVE_WWN
Peter Krempa [Tue, 18 Jul 2023 13:47:56 +0000 (15:47 +0200)]
qemu: Always assume support for QEMU_CAPS_IDE_DRIVE_WWN

The support for configuring the 'wwn' of a IDE disk was added in qemu
commit 95ebda85e09 (v1.0-1869-g95ebda85e0) and can't be compiled
out.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
21 months agoqemu: Always assume support for QEMU_CAPS_SCSI_DISK_WWN
Peter Krempa [Tue, 18 Jul 2023 13:47:56 +0000 (15:47 +0200)]
qemu: Always assume support for QEMU_CAPS_SCSI_DISK_WWN

The support for configuring the 'wwn' of a SCSI disk was added in qemu
commit 27395add759ff4caeb0 (v1.0-3326-g27395add75) and can't be compiled
out.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
21 months agoqemu: capabilities: Update capabilities test data for qemu-8.1 dev cycle
Peter Krempa [Tue, 27 Jun 2023 11:58:09 +0000 (13:58 +0200)]
qemu: capabilities: Update capabilities test data for qemu-8.1 dev cycle

Update the test data on x86_64 to v8.0.0-2835-g361d539735

Notable changes:

 - added new commands:
    - cxl-inject-dram-event
    - cxl-inject-general-media-event
    - cxl-inject-memory-module-event
    - cxl-inject-poison
    - switchover-ack
 - q35-8.1 machine type now supports 1024 cpus
 - new cpu models:
    - 'SapphireRapids-v2'
    - 'GraniteRapids-v1'
 - removed commands:
    - x-query-profile
 - cpu features which can be emulated now:
    - rdseed, rdpid, 3dnowprefetch, xsaveerptr, wbnoinvd
 - applicable CPU bug mitigation flags are now exposed to TCG guests to
   allow using more named models

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
21 months agostorage: Fix returning of locked objects from 'virStoragePoolObjListSearch'
Peter Krempa [Thu, 13 Jul 2023 14:16:37 +0000 (16:16 +0200)]
storage: Fix returning of locked objects from 'virStoragePoolObjListSearch'

CVE-2023-3750

'virStoragePoolObjListSearch' explicitly documents that it's returning
a pointer to a locked and ref'd pool that maches the lookup function.

This was not the case as in commit 0c4b391e2a9 (released in
libvirt-8.3.0) the code was accidentally converted to use 'VIR_LOCK_GUARD'
which auto-unlocked it when leaving the scope, even when the code was
originally "leaking" the lock.

Revert the corresponding conversion and add a comment that this function
is intentionally leaking a locked object.

Fixes: 0c4b391e2a9
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2221851
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
21 months agoqemuTestDriverInit: Don't autopopulate qemu capabilities when initializing driver
Peter Krempa [Tue, 4 Jul 2023 11:36:21 +0000 (13:36 +0200)]
qemuTestDriverInit: Don't autopopulate qemu capabilities when initializing driver

In an effort to use strictly real capability testing all tests were
converted to do insertion of their own capabilities when required, thus
we don't need to popluate the capabilities. This will also promote using
proper capabilities based on what the test is trying to achieve.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agoqemudomaincheckpointxml2xmltest: Use real 'x86_64' capabilities in all test data
Peter Krempa [Mon, 3 Jul 2023 11:40:38 +0000 (13:40 +0200)]
qemudomaincheckpointxml2xmltest: Use real 'x86_64' capabilities in all test data

Use the platform which is getting most development for the checkpoint XML
examples so that it's tested against latest capabilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agoqemuagenttest: Use real x86_64 capabilities for parsing domain definitions
Peter Krempa [Tue, 4 Jul 2023 11:39:24 +0000 (13:39 +0200)]
qemuagenttest: Use real x86_64 capabilities for parsing domain definitions

Some test cases require a real definition and thus parse a XML with the
definition to obtain it. Convert the code to use real capabilities and
switch to x86_64.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agotests: qemudomainsnapshotxml2xmlout: Use real 'x86_64' capabilities in all test data
Peter Krempa [Mon, 3 Jul 2023 11:40:38 +0000 (13:40 +0200)]
tests: qemudomainsnapshotxml2xmlout: Use real 'x86_64' capabilities in all test data

Use the platform which is getting most development for the snapshot XML
examples so that it's tested against latest capabilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agoqemumemlocktest: Use 'testQemuInsertRealCaps'
Peter Krempa [Mon, 3 Jul 2023 13:39:58 +0000 (15:39 +0200)]
qemumemlocktest: Use 'testQemuInsertRealCaps'

Rewrite the capability fetching to use the new helper, thus simplifying
the code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agotestutilsqemu: Introduce 'testQemuInsertRealCaps' helper
Peter Krempa [Mon, 3 Jul 2023 13:25:30 +0000 (15:25 +0200)]
testutilsqemu: Introduce 'testQemuInsertRealCaps' helper

'testQemuInsertRealCaps' looks up and inserts real capabilities into the
capability 'file cache' for testing purposes. Effectively this helper
replaces following steps:

1) testQemuGetRealCaps
2) virFileCacheClear
3) qemuTestCapsCacheInsert

This helper doesn't copy the capabilities that are borrowed from it's
internal cache thus they must not be modified afterwards in contrast to
the above steps.

The use of this helper is in simple tests which require some form of
capabilities to parse a definition but don't care about doctoring them
in any way.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agotestQemuGetRealCaps: Extract caching of the caps into a new helper
Peter Krempa [Mon, 3 Jul 2023 12:50:42 +0000 (14:50 +0200)]
testQemuGetRealCaps: Extract caching of the caps into a new helper

Introduce testQemuGetRealCapsInternal that loads and caches the
capabilities. testQemuGetRealCaps just copies the cache entry and
returns it to the user.

The new helper will be used in a helper that doesn't modify the
capabilities and thus we don't need to copy it before use.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agotestQemuGetRealCaps: Strip the default machine alias before insertion into cache
Peter Krempa [Mon, 3 Jul 2023 12:41:38 +0000 (14:41 +0200)]
testQemuGetRealCaps: Strip the default machine alias before insertion into cache

Expand the default machine type alias of the 'latest' capabilities for
an architecture before caching it rather than after copying it, so that
we don't duplicate the work all the time.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agodomaincapstest: Use obviously fake firmware name in capabilities
Peter Krempa [Mon, 3 Apr 2023 11:20:47 +0000 (13:20 +0200)]
domaincapstest: Use obviously fake firmware name in capabilities

The domain capabilities data feature a firmware section which is filled
by few entries. The entries used until now looked real and it was
suspicious that a x86_64 host was listing aarch64 firmware images which
should not happen.

Fill it by an obviously fake path as it's not actually interpreted in a
meaningful way.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agotestutils: Print number of failed tests
Peter Krempa [Mon, 3 Apr 2023 11:33:52 +0000 (13:33 +0200)]
testutils: Print number of failed tests

We can easily report how many tests failed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agoProperly mark auto-added 'terminator' virStorageSource
Peter Krempa [Tue, 16 May 2023 08:18:55 +0000 (10:18 +0200)]
Properly mark auto-added 'terminator' virStorageSource

All backing chain members which were auto-added by image detection,
including the terminating element, should have the 'detected' property
set to true. This is needed to properly strip the detected elements in
some cases, e.g. for the status XML where we could treat some images as
manually terminated even when it was auto-detected.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
21 months agoqemu: driver: Reformat helpers for saving VM state
Peter Krempa [Tue, 16 May 2023 08:18:18 +0000 (10:18 +0200)]
qemu: driver: Reformat helpers for saving VM state

Rewrap argument definition of qemuDomainSaveInternal and align argument
in the invocation of the aforementioned function in
qemuDomainManagedSaveHelper.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
21 months agoutil: add logging about node suspend availability
Daniel P. Berrangé [Wed, 21 Jun 2023 13:31:05 +0000 (14:31 +0100)]
util: add logging about node suspend availability

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agosrc: remove dep on systemd-logind.service from unit files
Daniel P. Berrangé [Wed, 21 Jun 2023 13:06:23 +0000 (14:06 +0100)]
src: remove dep on systemd-logind.service from unit files

After the previous commit we no longer require that logind is actually
running, it merely has to be activatable.

https://gitlab.com/libvirt/libvirt/-/issues/489
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agoutil: relax requirement for logind to be running
Daniel P. Berrangé [Wed, 21 Jun 2023 13:03:25 +0000 (14:03 +0100)]
util: relax requirement for logind to be running

Historically we wanted to check if logind was actually running, not
merely activatable, because on systems where systemd is installed,
but the OS is booted into non-systemd init, we want to fallback to
pm-utils.

Requiring logind to be running, however, forces us to serialize libvirtd
startup on startup of logind which is undesirable. We can relax this
dependancy if we check whether systemd itself is running, which implies
that logind will activated when we need it.

https://gitlab.com/libvirt/libvirt/-/issues/489
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agosrc: set max open file limit to match systemd >= 240 defaults
Daniel P. Berrangé [Wed, 21 Jun 2023 12:22:40 +0000 (13:22 +0100)]
src: set max open file limit to match systemd >= 240 defaults

Since systemd 240, all services get an open file hard limit of
500k, and a soft limit of 1024. This limit means apps are safe
to use select() by default which is limited to 1024 FDs. Apps
which don't use select() are expected to simply set their soft
limit to match the hard limit during startup.

With our current unit file settings we've been effectively
reducing the max open files we have on most modern systems.

https://gitlab.com/libvirt/libvirt/-/issues/489
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agorpc: automatically raise max file limit in all daemons
Daniel P. Berrangé [Wed, 21 Jun 2023 12:46:47 +0000 (13:46 +0100)]
rpc: automatically raise max file limit in all daemons

None of our daemons use select(), so it is safe to raise the max file
limit to its maximum on startup.

https://gitlab.com/libvirt/libvirt/-/issues/489
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agoutil: add helper for raising the max files limit
Daniel P. Berrangé [Wed, 21 Jun 2023 12:44:39 +0000 (13:44 +0100)]
util: add helper for raising the max files limit

Historically the max files limit for processes has always been 1024,
because going beyond this is incompatible with the select() function.
None the less most apps these days will use poll() so should not be
limited in this way.

Since systemd >= 240, the hard limit will be 500k, while the soft
limit remains at 1k. Applications which don't use select() should
raise their soft limit to match the hard limit during their startup.

This function provides a convenient helper to do this limit raising.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agoutil: remove pointless wrappers for setrlimit/getrlimit
Daniel P. Berrangé [Wed, 21 Jun 2023 12:43:35 +0000 (13:43 +0100)]
util: remove pointless wrappers for setrlimit/getrlimit

These wrappers added no semantic difference over calling the system
function directly.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agosrc: remove deps on ip[6]tables/firewalld.service from systemd units
Daniel P. Berrangé [Wed, 21 Jun 2023 12:07:46 +0000 (13:07 +0100)]
src: remove deps on ip[6]tables/firewalld.service from systemd units

The unit files both have After=network.target, and this in turn implies
After=network-pre.target. Both iptables.service & ip6tables.service have
Before=network-pre.target since Fedora >= 35 and RHEL >= 8.4.

When we first added the deps on ip[6]tables.service in

  commit 0756415f147dda15a417bd79eef9a62027d176e6
  Author: Laine Stump <laine@redhat.com>
  Date:   Fri May 1 00:05:50 2020 -0400

    systemd: start libvirtd after firewalld/iptables services

the Before=network-pre.target didn't exist, but we can rely on it now
given our supported platforms matrix.

The firewalld.service has similarly has a Before=network-pre.target,
even when we took that commit above, so this dep was in face never
actually needed. This answers the question posed in that above commit
message about firewalld ordering.

https://gitlab.com/libvirt/libvirt/-/issues/489
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agosrc: remove After=local-fs.target from systemd units
Daniel P. Berrangé [Wed, 21 Jun 2023 12:05:40 +0000 (13:05 +0100)]
src: remove After=local-fs.target from systemd units

All services are ordered after local-fs.target unless they have set
DefaultDependencies=no, which we do not do.

https://gitlab.com/libvirt/libvirt/-/issues/489
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agotests: Refresh valgrind suppressions
Michal Privoznik [Sun, 26 Feb 2023 11:04:21 +0000 (12:04 +0100)]
tests: Refresh valgrind suppressions

Since nobody is expected to run valgrind over scripts now, we can
drop plenty of suppressions. Also, there are some old ones that
no longer exist and new ones, that are not covered.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
21 months agomeson: Annotate each test() with 'suite'
Michal Privoznik [Sat, 15 Jul 2023 05:52:43 +0000 (07:52 +0200)]
meson: Annotate each test() with 'suite'

A test case can be part of a test suite (just like we already
have 'syntax-check'). This then allows developers to run only a
subset of tests. For instance - when using valgrind test setup
(`meson test -C _build/ --setup valgrind`) it makes zero sense to
run syntax-check tests or other script based tests (e.g.
check-augeas-*, check-remote_protocol, etc.). What does makes
sense is to run compiled binaries.

Strictly speaking, reaching that goal is as trivial as annotating
only those compiled tests (declared in tests/meson.build) and
running them selectively:

  meson test -C _build/ --setup valgrind --suite $TAG

But it may be also desirable to run test scripts separately.

Therefore, introduce two new tags: 'bin' for compiled tests, and
'script' for script based tests and annotate each test()
accordingly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
21 months agostorage: zfs: Use 'zfs list' to check pool status
Matt Low [Mon, 3 Jul 2023 22:53:28 +0000 (16:53 -0600)]
storage: zfs: Use 'zfs list' to check pool status

The current virtStorageBackendZFSCheckPool checks for the existence of a
path under /dev/zvol/ to determine if the pool is active. ZFS does not
create a path under /dev/zvol/ if no ZFS volumes have been created under
a particular dataset, thus, empty ZFS storage pools are deactivated
whenever checkPool is called on them (as noted in referenced issue).

This commit changes virStorageBackendZFSCheckPool so that the 'zfs list'
command is used to explicitly check for the existence a dataset
specified by the pool's def->source.name.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/221

Signed-off-by: Matt Low <matt@mlow.ca>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
21 months agonodedev: report mdev persistence properly
Jonathon Jongsma [Tue, 18 Jul 2023 19:47:49 +0000 (14:47 -0500)]
nodedev: report mdev persistence properly

Since commit 44a0f2f0, we now query mdevctl for transient (active) mdevs
in order to gather attributes for the mdev. Unfortunately, this commit
introduced a regression because nodeDeviceUpdateMediatedDevice() assumed
that all mdevs returned from mdevctl were actually persistent mdevs but
we were using it to update transient mdevs. Refactor the function so
that we can use it to update both persistent and transient mdevs.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
21 months agoqemu: require memfd memory for virtio 'blob' support
Jonathon Jongsma [Tue, 18 Jul 2023 13:55:13 +0000 (08:55 -0500)]
qemu: require memfd memory for virtio 'blob' support

The virtio-gpu 'blob' support was insufficiently validated. Qemu
requires a memfd memory backing in order to use udmabuf and enable blob
support. Example error:

    $ virsh start rhel9
    error: Failed to start domain 'rhel9'
    error: internal error: qemu unexpectedly closed the monitor: 2023-07-18T02:33:57.083178Z qemu-kvm: -device {"driver":"virtio-vga","id":"video0","max_outputs":1,"blob":true,"bus":"pcie.0","addr":"0x1"}: cannot enable blob resources without udmabuf

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agoqemu: Adapt to new way of specifying PC speaker
Michal Privoznik [Fri, 16 Jun 2023 11:05:48 +0000 (13:05 +0200)]
qemu: Adapt to new way of specifying PC speaker

Historically, the way to set PC speaker for a guest was to pass:

  -soundhw pcspk

but as of QEMU commit v5.1.0-rc0~28^2~3 this is deprecated and we
should use:

  -machine pcspk-audiodev=$id

instead. The old way was then removed in commit v7.1.0-rc0~99^2~3.

Now, ideally we would have a capability selecting whether we talk
to a QEMU that understands the new way or not. But it's not that
simple - the machine attribute is just an alias to the .audiodev=
attribute of 'isa-pcspk' object and both are created in
pc_machine_initfn() function, i.e. not then the PC_MACHINE() class
is initialized, but when it's instantiated. IOW, it's not possible
for us to query whether we're dealing with older or newer QEMU.

But given that the newer version is supported since v5.1.0 and the
minimal version we require is v4.2.0 (i.e. there are two releases
which don't understand the newer cmd line) and how frequently this
feature is (un-)used (the issue was reported after ~1 year since it
stopped working), I believe we can live without any capability and
just use the newer cmd line unconditionally.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/490
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
21 months agoqemu_capabilities: Retire QEMU_CAPS_USB_STORAGE_REMOVABLE
Michal Privoznik [Wed, 19 Jul 2023 11:28:07 +0000 (13:28 +0200)]
qemu_capabilities: Retire QEMU_CAPS_USB_STORAGE_REMOVABLE

Now that the QEMU_CAPS_USB_STORAGE_REMOVABLE capability is no
longer used we can stop querying it and retire it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
21 months agoqemu: Always assume QEMU_CAPS_USB_STORAGE_REMOVABLE
Michal Privoznik [Wed, 19 Jul 2023 11:26:31 +0000 (13:26 +0200)]
qemu: Always assume QEMU_CAPS_USB_STORAGE_REMOVABLE

Introduced in QEMU commit of v0.14.0-rc0~83^2~1 and not being
able to compile the .removable attribute of the "usb-storage"
object out, renders our corresponding capability
QEMU_CAPS_USB_STORAGE_REMOVABLE always set. Stop using it in
command generation / domain validation.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
21 months agovirrandommock: Drop virRandomGenerateWWN
Michal Privoznik [Mon, 17 Jul 2023 14:17:27 +0000 (16:17 +0200)]
virrandommock: Drop virRandomGenerateWWN

After previous commit, there's no functional difference between
real virRandomGenerateWWN() and the mocked version. Drop the mock
then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
21 months agotest_driver: Pass virt_type to virNodeDeviceDefParse() in testNodeDeviceCreateXML()
Michal Privoznik [Mon, 17 Jul 2023 14:17:19 +0000 (16:17 +0200)]
test_driver: Pass virt_type to virNodeDeviceDefParse() in testNodeDeviceCreateXML()

This brings the code closer to real implementation:
nodeDeviceCreateXML(). For the unique OUI, let's take the value
from tests/virrandommock.c: 100000.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
21 months agovirrandom: Fix printf format string in virRandomGenerateWWN()
Michal Privoznik [Mon, 17 Jul 2023 13:24:43 +0000 (15:24 +0200)]
virrandom: Fix printf format string in virRandomGenerateWWN()

Firstly, drop needless concatenation of two static strings.
Secondly, use proper (portable) formatter for uint64_t so that
typecast to ULL can be dropped.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
21 months agovirsh: Make cmdVersion() work with split daemon
Michal Privoznik [Mon, 17 Jul 2023 13:05:19 +0000 (15:05 +0200)]
virsh: Make cmdVersion() work with split daemon

When virsh connects to a non-hypervisor daemon directly (e.g.
"nodedev:///system") and user executes 'version' they are met
with an error message. This is because cmdVersion() calls
virConnectGetVersion() which fails, hence the error.

The reason for virConnectGetVersion() fail is simple - it's
documented as:

  Get the version level of the Hypervisor running.

Well, there's no hypervisor in non-hypervisor daemons and thus it
doesn't make sense to provide an implementation in each driver's
virConnectDriver.hypervisorDriver table (just like we do for
other APIs, e.g. nodeConnectIsSecure()).

Given all of this, just make cmdVersion() deal with the error in
a non-fatal fashion.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
21 months agoNEWS: cpu_map: Add SapphireRapids cpu model
Han Han [Mon, 17 Jul 2023 10:56:11 +0000 (18:56 +0800)]
NEWS: cpu_map: Add SapphireRapids cpu model

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agoNEWS: qemu: Support removable attribute for scsi disk
Han Han [Mon, 17 Jul 2023 10:56:10 +0000 (18:56 +0800)]
NEWS: qemu: Support removable attribute for scsi disk

Signed-off-by: Han Han <hhan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agoqemu: S390 does not provide physical address size
Boris Fiuczynski [Fri, 14 Jul 2023 14:38:14 +0000 (16:38 +0200)]
qemu: S390 does not provide physical address size

Commit be1b7d5b18 introduced parsing /proc/cpuinfo for "address size"
which is not including on S390 and therefore reports an internal error.
Lets remove the parsing on S390.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agoconf: domcaps: Add 'async-teardown' domain capability
Boris Fiuczynski [Mon, 17 Jul 2023 15:12:08 +0000 (17:12 +0200)]
conf: domcaps: Add 'async-teardown' domain capability

Add async-teardown to the features list in domain capabilities allowing
high level management to introspect the availability of the asynchronous
teardown feature.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agoqemu: Add NUMA node automatically for memory hotplug
Michal Privoznik [Thu, 13 Jul 2023 08:10:38 +0000 (10:10 +0200)]
qemu: Add NUMA node automatically for memory hotplug

Up until v2.11.0-rc2~19^2~3 QEMU used to require at least one
NUMA node to be configured when memory hotplug was enabled. After
that commit, QEMU automatically adds a NUMA node if none was
specified on the cmd line. Reflect this in domain XML, i.e.
explicitly add a NUMA node into our domain definition if needed.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2216236
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
21 months agodocs: expand clangd instructions
Jonathon Jongsma [Fri, 14 Jul 2023 15:42:15 +0000 (10:42 -0500)]
docs: expand clangd instructions

Add some additional information about running clangd for LSP when clang
is not your normal compiler.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-By: Tim Small <tim@seoss.co.uk>
21 months agoTranslated using Weblate (Georgian)
Temuri Doghonadze [Tue, 11 Jul 2023 17:34:18 +0000 (17:34 +0000)]
Translated using Weblate (Georgian)

Currently translated at 3.9% (408 of 10395 strings)

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

Signed-off-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
21 months agoTranslated using Weblate (Georgian)
Mariam Low-Ghelaghutashvili [Tue, 11 Jul 2023 17:33:16 +0000 (17:33 +0000)]
Translated using Weblate (Georgian)

Currently translated at 3.8% (405 of 10395 strings)

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

Signed-off-by: Mariam Low-Ghelaghutashvili <mariamlow@zusmail.xyz>
21 months agoTranslated using Weblate (Georgian)
Temuri Doghonadze [Tue, 11 Jul 2023 17:32:37 +0000 (17:32 +0000)]
Translated using Weblate (Georgian)

Currently translated at 3.8% (405 of 10395 strings)

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

Signed-off-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
21 months agoTranslated using Weblate (Georgian)
Mariam Low-Ghelaghutashvili [Tue, 11 Jul 2023 17:32:36 +0000 (19:32 +0200)]
Translated using Weblate (Georgian)

Currently translated at 3.8% (403 of 10395 strings)

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

Co-authored-by: Mariam Low-Ghelaghutashvili <mariamlow@zusmail.xyz>
Signed-off-by: Mariam Low-Ghelaghutashvili <mariamlow@zusmail.xyz>
21 months agodocs: Reword ninja invocation note to clarify build directory
Tim Small [Thu, 13 Jul 2023 11:00:04 +0000 (12:00 +0100)]
docs: Reword ninja invocation note to clarify build directory

Minor rewording to clarify purpose of the -C flag in the ninja
invocation, whilst retaining previous meaning.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agodocs: Fix deprecated use of implicit meson "setup" command
Tim Small [Thu, 13 Jul 2023 11:00:03 +0000 (12:00 +0100)]
docs: Fix deprecated use of implicit meson "setup" command

Use the explicit meson "setup" command instead of the deprecated
implicit invocation. The implied setup usage generates a warning with
meson version 1.0.1:

WARNING: Running the setup command as `meson [options]` instead of
`meson setup [options]` is ambiguous and deprecated.

Additionally the implicit command is likely to be confusing to those
unfamiliar with Meson - the `build` argument in `meson build` resembles
an action rather than an arbitrary path.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agodocs: Point to mailing list archives from submitting-patches
Tim Small [Thu, 13 Jul 2023 11:00:02 +0000 (12:00 +0100)]
docs: Point to mailing list archives from submitting-patches

Suggest that new contributors should review past patch submissions for
typical style, feedback etc. prior to submitting. Link to archives.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agodocs: Advise running CI tests prior to submission
Tim Small [Thu, 13 Jul 2023 11:00:01 +0000 (12:00 +0100)]
docs: Advise running CI tests prior to submission

In the preparing patches section, note that it is possible to run CI
tests via gitlab prior to submitting patches.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agodocs: Reword "Preparing Patches" to clarify
Tim Small [Thu, 13 Jul 2023 11:00:00 +0000 (12:00 +0100)]
docs: Reword "Preparing Patches" to clarify

Clarify that patches should apply cleanly to the master branch. Give
guidance for typical bug fix process for existing releases.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agodocs: Add config instructions for clangd with libvirt
Tim Small [Thu, 13 Jul 2023 10:59:59 +0000 (11:59 +0100)]
docs: Add config instructions for clangd with libvirt

In build environments which use gcc as the default compiler, use of the
clangd LSP server (for enhanced code editing and navigation etc.) with
libvirt requires some additional configuration.  Detail this and link
from `hacking.rst`.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agodocs: Point to compiling guide from code contribution guide
Tim Small [Thu, 13 Jul 2023 10:59:58 +0000 (11:59 +0100)]
docs: Point to compiling guide from code contribution guide

The "hacking" doc details where to find the code, but not how to compile
it - link to the instructions contained in `compiling.rst`.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agodocs: Link main "contributing" from programming-specific guide
Tim Small [Thu, 13 Jul 2023 10:59:57 +0000 (11:59 +0100)]
docs: Link main "contributing" from programming-specific guide

There are two guides to contributing: `hacking.rst` is focused on code
contributions, and `contributing.rst` is more general. Clarify scope of
`hacking.rst` and link to the general guide in its references.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agodocs: Missing "full-stop"/"period" on some bullet items
Tim Small [Thu, 13 Jul 2023 10:59:56 +0000 (11:59 +0100)]
docs: Missing "full-stop"/"period" on some bullet items

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agodocs: Link to main docs directory from Quick Links
Tim Small [Thu, 13 Jul 2023 10:59:55 +0000 (11:59 +0100)]
docs: Link to main docs directory from Quick Links

Whilst the "docs" documentation map is linked in the navigation bar,
users may scroll down and lose sight of this, so also place at the
bottom of the "Quick Links" section.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
21 months agonodedev: update mdevs from the mdevctl thread
Jonathon Jongsma [Thu, 6 Jul 2023 14:16:35 +0000 (09:16 -0500)]
nodedev: update mdevs from the mdevctl thread

Rather than directly executing mdevctl from the udev event thread when
we determine that we need to re-query, schedule the mdevctl thread to
run. This also helps to coalesce multiple back-to-back updates into a
single one when there are multiple updates in a row or at startup when a
host has a very large number of mdevs.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
21 months agonodedev: refactor mdevctl thread functions
Jonathon Jongsma [Wed, 5 Jul 2023 20:35:59 +0000 (15:35 -0500)]
nodedev: refactor mdevctl thread functions

Factor out a new scheduleMdevctlUpdate() function so that we can re-use
it from other places. Now that other events can make it necessary to
re-query mdevctl for mdev updates, this function will be useful for
coalescing multiple updates in quick succession into a single mdevctl
query.

Also rename a couple functions. The names weren't very descriptive of
their behavior. For example, the old scheduleMdevctlHandler() function
didn't actually schedule anything, it just started a thread. So rename
it to free up the 'schedule' name for the above refactored function.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
21 months agonodedev: transient mdev update on nodeDeviceCreateXML
Boris Fiuczynski [Fri, 30 Jun 2023 11:34:00 +0000 (13:34 +0200)]
nodedev: transient mdev update on nodeDeviceCreateXML

Update the optional mdev attributes by running an mdevctl update on a
new created nodedev object representing an mdev.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2143158
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
21 months agoqemu_domain: Deduplicate targetNode check in qemuDomainDefValidateMemoryHotplugDevice()
Michal Privoznik [Thu, 13 Jul 2023 08:29:11 +0000 (10:29 +0200)]
qemu_domain: Deduplicate targetNode check in qemuDomainDefValidateMemoryHotplugDevice()

If a domain has NUMA configured, then all <memory/> devices
(except for 'virtio-pmem') need to have targetNode set. There are
two checks inside of qemuDomainDefValidateMemoryHotplugDevice()
for this: one inside of big switch() statement, which only checks
'dimm' and 'nvdimm' cases, and the other at the end of the
function that checks all models (except for 'virtio-pmem'). Let's
keep the latter and remove the former as the latter covers the
former too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
21 months agolibxl: Advertise support for VIR_MIGRATE_CHANGE_PROTECTION
Jim Fehlig [Wed, 12 Jul 2023 21:15:08 +0000 (15:15 -0600)]
libxl: Advertise support for VIR_MIGRATE_CHANGE_PROTECTION

The libxl driver has basic support for VIR_MIGRATE_CHANGE_PROTECTION
by starting and stopping modify jobs in the begin/confirm and prepare/finish
phases of migration, but it doesn't advertise that support. This can result
in unterminated jobs because the migration logic skips phases of migration
when the VIR_MIGRATE_CHANGE_PROTECTION feature is absent. Ensure jobs are
terminated properly by advertising support for VIR_MIGRATE_CHANGE_PROTECTION.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agolibxl: Don't attempt to resume domain on canceled migration
Jim Fehlig [Tue, 11 Jul 2023 16:35:32 +0000 (10:35 -0600)]
libxl: Don't attempt to resume domain on canceled migration

For unknown reasons, the libxl driver attempts to resume a domain in the
confirm phase when a migration operation has been canceled. This has shown
to be problematic when simulating scenarios that result in a canceled
migration. In all scenarios, the domain was in a running state when entering
libxlDomainMigrationSrcConfirm, causing the call to libxl_domain_resume to
fail. Making matters worse, the domain state is changed to paused when in
fact it's running. And finally, libxlDomainMigrationSrcConfirm incorrectly
returns an error.

Remove this incorrect logic from libxlDomainMigrationSrcConfirm. On a
canceled migration it's sufficient to resume the lock process that was
paused in the perform phase.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
22 months agonode_device: Enclose Linux specific code in ifdef __linux__
Michal Privoznik [Tue, 11 Jul 2023 14:13:15 +0000 (16:13 +0200)]
node_device: Enclose Linux specific code in ifdef __linux__

Our CI started to enable udev backend on FreeBSD. And while there
is udev on FreeBSD some parts of our code are highly Linux
specific, e.g. translating SCSI device type to string (from an
integer obtained from the sysfs). Obviously, this doesn't work
anywhere else. This is the reason why we need to include
scsi/scsi.h header file (which actually comes from the Linux
kernel source tree but for some reason glibc started to
distribute it, followed by musl).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
22 months agoqemu: allow use of async teardown in domain
Boris Fiuczynski [Wed, 5 Jul 2023 06:20:26 +0000 (08:20 +0200)]
qemu: allow use of async teardown in domain

Asynchronous teardown can be specified if the QEMU binary supports it by
adding in the domain XML

  <features>
    ...
    <async-teardown enabled='yes|no'/>
    ...
  </features>

By default this new feature is disabled.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
22 months agoqemu: add run-with async-teardown capability
Boris Fiuczynski [Wed, 5 Jul 2023 06:20:25 +0000 (08:20 +0200)]
qemu: add run-with async-teardown capability

QEMU capability is looking in query-command-line-options response for
...
    {
      "parameters": [
        {
          "name": "async-teardown",
          "type": "boolean"
        }
      ],
      "option": "run-with"
    }
...
allow to use the QEMU option -run-with async-teardown=on|off

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
22 months agotests: add capabilities for QEMU 8.1.0 on s390x
Shalini Chellathurai Saroja [Wed, 5 Jul 2023 06:20:24 +0000 (08:20 +0200)]
tests: add capabilities for QEMU 8.1.0 on s390x

Let us introduce the xml and reply files for QEMU 8.1.0 on s390x.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
22 months agotests: remove acpi support from s390x ccw hotplug tests
Boris Fiuczynski [Wed, 5 Jul 2023 06:20:23 +0000 (08:20 +0200)]
tests: remove acpi support from s390x ccw hotplug tests

In newer QEMU libvirt combinations acpi support is no longer tolerated
and ignored. Therfore before upgrading the test capabilities to QEMU
8.1.0 replies removing the acpi feature from the domain XMLs.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
22 months agoqemu: Support removable for scsi disk
Han Han [Mon, 5 Jun 2023 05:07:29 +0000 (13:07 +0800)]
qemu: Support removable for scsi disk

Allow //disk/target@removable for scsi disk devices, since QEMU has support
the removable attribute for scsi-hd device from v0.14.0[1].

[1]: 419e691f8e: scsi-disk: Allow overriding SCSI INQUIRY removable bit

Signed-off-by: Han Han <hhan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
22 months agoRevert "meson: attr_dep switch to dependency()"
Jim Fehlig [Thu, 6 Jul 2023 17:35:36 +0000 (11:35 -0600)]
Revert "meson: attr_dep switch to dependency()"

openSUSE Leap 15.{4,5} are supported under libvirt's distro support
statement, but they only contain attr version 2.4.47.

Reverts: dffeef89efc2ed1668cb485d6c3e67ef27b824e8
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
22 months agoTranslated using Weblate (Georgian)
Temuri Doghonadze [Wed, 5 Jul 2023 14:21:03 +0000 (16:21 +0200)]
Translated using Weblate (Georgian)

Currently translated at 3.8% (403 of 10395 strings)

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

Co-authored-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
Signed-off-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
22 months agoNEWS: Mention overrides for AppArmor profiles and abstractions
Andrea Bolognani [Thu, 29 Jun 2023 12:10:31 +0000 (14:10 +0200)]
NEWS: Mention overrides for AppArmor profiles and abstractions

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
22 months agoapparmor: Make all profiles extensible
Andrea Bolognani [Thu, 29 Jun 2023 10:04:02 +0000 (12:04 +0200)]
apparmor: Make all profiles extensible

Do for all other profiles what we already do for the
virt-aa-helper one. In this case we limit the feature to AppArmor
3.x, as it was never implemented for 2.x.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
22 months agoapparmor: Improve virt-aa-helper include
Andrea Bolognani [Thu, 29 Jun 2023 09:40:16 +0000 (11:40 +0200)]
apparmor: Improve virt-aa-helper include

For AppArmor 3.x we can use 'include if exists', which frees us
from having to create a dummy override. For AppArmor 2.x we keep
things as they are to avoid introducing regressions.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
22 months agoapparmor: Make abstractions extensible
Andrea Bolognani [Thu, 29 Jun 2023 09:49:35 +0000 (11:49 +0200)]
apparmor: Make abstractions extensible

Implement the standard AppArmor 3.x abstraction extension
approach.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
22 months agoapparmor: Only support passt on 3.x
Andrea Bolognani [Thu, 29 Jun 2023 09:47:13 +0000 (11:47 +0200)]
apparmor: Only support passt on 3.x

The subprofile can only work by including the abstraction shipped
in the passt package, which we can't assume is present, and
'include if exists' doesn't work well on 2.x.

No distro that's stuck on AppArmor 2.x is likely to be shipping
passt anyway.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
22 months agoapparmor: Allow version-specific bits in abstractions too
Andrea Bolognani [Thu, 29 Jun 2023 09:45:35 +0000 (11:45 +0200)]
apparmor: Allow version-specific bits in abstractions too

Compared to profiles, we only need a single preprocessing step
here, as there is no variable substitution happening.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
22 months agoapparmor: Allow version-specific bits in profiles
Andrea Bolognani [Thu, 29 Jun 2023 09:35:52 +0000 (11:35 +0200)]
apparmor: Allow version-specific bits in profiles

Perform an additional preprocessing step before the existing
variable substitution. This is the same approach that we already
use to customize systemd unit files based on whether the service
supports TCP connections.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
22 months agomeson: Detect AppArmor 3.x
Andrea Bolognani [Thu, 29 Jun 2023 09:25:12 +0000 (11:25 +0200)]
meson: Detect AppArmor 3.x

We will soon need to base some decisions on whether AppArmor 3.x
or 2.x is present on the system.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
22 months agoNEWS: Fix vertical spacing
Andrea Bolognani [Mon, 3 Jul 2023 12:53:43 +0000 (14:53 +0200)]
NEWS: Fix vertical spacing

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
22 months agoPost-release version bump to 9.6.0
Jiri Denemark [Mon, 3 Jul 2023 10:17:17 +0000 (12:17 +0200)]
Post-release version bump to 9.6.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
22 months agoRelease of libvirt-9.5.0
Jiri Denemark [Mon, 3 Jul 2023 10:08:36 +0000 (12:08 +0200)]
Release of libvirt-9.5.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
22 months agoNEWS: Document changes for the release
Peter Krempa [Fri, 30 Jun 2023 12:06:31 +0000 (14:06 +0200)]
NEWS: Document changes for the release

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
22 months agoNEWS: Move section about 'discard_no_unref' to features
Peter Krempa [Fri, 30 Jun 2023 11:09:04 +0000 (13:09 +0200)]
NEWS: Move section about 'discard_no_unref' to features

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
22 months agoRevert "lxc_fuse: Tell FUSE that /proc/meminfo is nonseekable"
Michal Privoznik [Thu, 29 Jun 2023 06:46:04 +0000 (08:46 +0200)]
Revert "lxc_fuse: Tell FUSE that /proc/meminfo is nonseekable"

After v8.1.0-61-g030faee28d it is no longer necessary to make the
/proc/meminfo file nonseekable as our code that fills the file
with spoofed values can handle seeking just fine.

Previously, `free(1)` was okay with failed lseek(), but this was
ages ago and meanwhile the procps project moved to creating a
library and moved the file parsing code under an exported
function. In attempt to make the function callable multiple
times, it can lseek() multiple times and failure to do so is
fatal.

This reverts commit 766495508650bebd5f4ac23224ecd0a2ee2ca9eb

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/492
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
22 months agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Thu, 29 Jun 2023 04:21:01 +0000 (06:21 +0200)]
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10395 of 10395 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>
22 months agoTranslated using Weblate (Korean)
김인수 [Thu, 29 Jun 2023 04:21:00 +0000 (06:21 +0200)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10395 of 10395 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>
22 months agoscripts: Fix the flake8 syntax-check failures
Han Han [Mon, 5 Jun 2023 07:40:13 +0000 (15:40 +0800)]
scripts: Fix the flake8 syntax-check failures

Fix the syntax-check failures (which can be seen after
python3-flake8-import-order package is installed) with the help
of isort[1]:

289/316 libvirt:syntax-check / flake8   FAIL   5.24s   exit status 2

[1]: https://pycqa.github.io/isort/

Signed-off-by: Han Han <hhan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
22 months agoRevert "apparmor: Add support for local profile customizations"
Jim Fehlig [Tue, 27 Jun 2023 23:09:15 +0000 (17:09 -0600)]
Revert "apparmor: Add support for local profile customizations"

As it turns out, apparmor 2.x and 3.x behave differently or have differing
levels of support for local customizations of profiles and profile
abstractions. Additionally the apparmor 2.x tools do not cope well with
'include if exists'. Revert this commit until a more complete solution is
developed that works with old and new apparmor.

Reverts: 9b743ee19053db2fc3da8fba1e9cf81915c1e2f4
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
22 months agoUpdate translation files
Weblate [Tue, 27 Jun 2023 11:46:47 +0000 (13:46 +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>
22 months agopo: Refresh potfile for v9.5.0
Jiri Denemark [Tue, 27 Jun 2023 11:39:56 +0000 (13:39 +0200)]
po: Refresh potfile for v9.5.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
22 months agoTranslated using Weblate (Korean)
김인수 [Tue, 27 Jun 2023 09:20:59 +0000 (11:20 +0200)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10397 of 10397 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>
22 months agoqemu: prevent SIGSEGV in qemuProcessHandleDumpCompleted
Nikolai Barybin [Tue, 27 Jun 2023 08:43:58 +0000 (11:43 +0300)]
qemu: prevent SIGSEGV in qemuProcessHandleDumpCompleted

If VIR_ASYNC_JOB_NONE flag is present, job.current is equal
to NULL, which leads to SIGSEGV. Thus, this check should be
moved up.

Fixes: v8.0.0-427-gf304de0df6
Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>