]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
23 months agodocs: go: Add 'go-import' metadata via rST
Peter Krempa [Tue, 23 May 2023 14:52:24 +0000 (16:52 +0200)]
docs: go: Add 'go-import' metadata via rST

The '.. meta::' rST directive allows adding header metadata. Move the
specific metadata from page.xsl into the individual files and pass them
through into the header from page.xsl.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agodocs: page.xsl: Drop passhrough of <script> elements into header
Peter Krempa [Thu, 25 May 2023 12:09:22 +0000 (14:09 +0200)]
docs: page.xsl: Drop passhrough of <script> elements into header

No generated headers have inline javascript.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agodocs: newapi: Remove unused 'docomponents' template
Peter Krempa [Thu, 25 May 2023 11:44:13 +0000 (13:44 +0200)]
docs: newapi: Remove unused 'docomponents' template

Never used since introduction in b38893c3eaa56617a3ef313c45e505da6e50

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemu_passt: Format portForward device even without address
Michal Privoznik [Thu, 1 Jun 2023 08:37:04 +0000 (10:37 +0200)]
qemu_passt: Format portForward device even without address

It's almost like we've anticipated this. Our XML parser and
formatter handles @address and @dev attributes of <portForward/>
element completely independent of each other. And as of commit
2023_03_29.b10b983~3 passt allows handling these two separately
too. All that's left is generate the cmd line according to this
new fact.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2210287
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoconf: Reject invalid device's <seclabel relabel='yes'/> with no <label/>
Michal Privoznik [Thu, 25 May 2023 13:43:56 +0000 (15:43 +0200)]
conf: Reject invalid device's <seclabel relabel='yes'/> with no <label/>

We allow (some) domain devices to have a different <seclabel/>
than the top level domain one (this is mostly to allow access to
a resource for multiple domains). Now, we do couple of sanity
checks for such <seclabel/>, e.g. when the <label/> is specified,
but '@relabel' is set to no. But what we are missing is the
opposite: when '@relabel' is set, but no <label/> was provided.

Our schema already denies such combination. Make our parser
behave the same.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2160356
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoPost-release version bump to 9.5.0
Jiri Denemark [Thu, 1 Jun 2023 09:50:19 +0000 (11:50 +0200)]
Post-release version bump to 9.5.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
23 months agoRelease of libvirt-9.4.0
Jiri Denemark [Thu, 1 Jun 2023 09:40:25 +0000 (11:40 +0200)]
Release of libvirt-9.4.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
23 months agoTranslated using Weblate (Georgian)
Temuri Doghonadze [Thu, 1 Jun 2023 04:20:44 +0000 (06:20 +0200)]
Translated using Weblate (Georgian)

Currently translated at 3.8% (402 of 10397 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>
23 months agoconf: node_device: use separate variables for parsing integers
Ján Tomko [Tue, 30 May 2023 14:59:56 +0000 (16:59 +0200)]
conf: node_device: use separate variables for parsing integers

In virNodeDeviceGetSCSIHostCaps, there is a pattern of reusing
a tmp value and stealing the pointer.

But in two case it is not stolen. Use separate variables for them
to avoid mixing autofree with manual free() calls.

Fixes: 8a0cb5f73ade3900546718eabe70cb064c6bd22c
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agoinclude: Fix 'Since' for new VIR_MIGRATE_PARAM_COMPRESSION_* macros
Michal Privoznik [Wed, 31 May 2023 09:02:21 +0000 (11:02 +0200)]
include: Fix 'Since' for new VIR_MIGRATE_PARAM_COMPRESSION_* macros

In v9.3.0-98-g150ae3e62b two new macros were introduced:
VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL and
VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL. But both list 9.1.0 as
the version they were introduced in (this is because the patch
was sent in that release time frame). Change the version to the
current release.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
23 months agoNEWS: Document my contributions for upcoming release
Michal Privoznik [Tue, 30 May 2023 07:43:43 +0000 (09:43 +0200)]
NEWS: Document my contributions for upcoming release

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
23 months agoTranslated using Weblate (Korean)
김인수 [Tue, 30 May 2023 05:20:45 +0000 (07: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>
23 months agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Sat, 27 May 2023 15:20:43 +0000 (17:20 +0200)]
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10397 of 10397 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>
23 months agoqemu_command: Generate .memaddr for virtio-mem and virtio-pmem
Michal Privoznik [Tue, 28 Mar 2023 08:44:15 +0000 (10:44 +0200)]
qemu_command: Generate .memaddr for virtio-mem and virtio-pmem

This is fairly trivial. Just set .memaddr attribute if a value
was set in the XML.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2180679
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemu: Fill virtio-mem/virtio-pmem .memaddr at runtime
Michal Privoznik [Tue, 28 Mar 2023 08:41:39 +0000 (10:41 +0200)]
qemu: Fill virtio-mem/virtio-pmem .memaddr at runtime

After a QEMU domain is started, among other thing we query memory
device information. And while memory address is returned by QEMU
for all models, we store it only for DIMMs and NVDIMMs. Do store
it for VIRTIO_MEM and VIRTIO_PMEM too.

This effectively reports the address the virtio-mem/virtio-pmem
is mapped to in live XML.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoconf: Introduce <address/> for virtio-mem and virtio-pmem
Michal Privoznik [Tue, 28 Mar 2023 08:39:55 +0000 (10:39 +0200)]
conf: Introduce <address/> for virtio-mem and virtio-pmem

Both virtio-mem and virtio-pmem devices have '.memaddr' attribute
which controls the address where they are mapped in the guest
memory. Ideally, users do not need to specify this as QEMU does
the right thing and computes addresses automatically on startup.

But soon, we will need to record this address as it is part of
guest ABI. And also, there might be some users that want to
control this value. Now, we are in a bit of a pickle, because
both these device types already have a PCI address, therefore we
can't just use <address/> blindly. But what we can do, is
introduce <address/> under the <target/> element. This is also
more conceptual, as knobs under <target/> control guest visible
config of memory device (and .memaddr surely falls into that
category).

NB, SgxEPCDeviceInfo struct in QMP definition also has .memaddr
attribute, but because of the way we build cmd line there's no
(easy) way to set the attribute. So ignore that for now.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoconf: Run virDomainInputDefPostParse() only for VIR_DOMAIN_DEVICE_INPUT
Michal Privoznik [Fri, 26 May 2023 14:15:56 +0000 (16:15 +0200)]
conf: Run virDomainInputDefPostParse() only for VIR_DOMAIN_DEVICE_INPUT

Due to missed break; statement the virDomainInputDefPostParse()
is called not only for VIR_DOMAIN_DEVICE_INPUT but also
VIR_DOMAIN_DEVICE_LEASE and VIR_DOMAIN_DEVICE_NET, which can lead
to all sort of unpredictable results.

Fixes: c4bc4d3b82fbe22e03c986ca896090f481df5c10
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoUpdate translation files
Weblate [Fri, 26 May 2023 12:08:02 +0000 (14:08 +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>
23 months agopo: Refresh potfile for v9.4.0
Jiri Denemark [Fri, 26 May 2023 11:56:42 +0000 (13:56 +0200)]
po: Refresh potfile for v9.4.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
23 months agosync_qemu_models_i386.py: Add missing features
Tim Wiederhake [Wed, 24 May 2023 07:50:14 +0000 (09:50 +0200)]
sync_qemu_models_i386.py: Add missing features

This brings the tool's list of features in sync with qemu
commit 886c0453cbf10eebd42a9ccf89c3e46eb389c357.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agosync_qemu_models_i386.py: Fix complaint from flake8
Tim Wiederhake [Wed, 24 May 2023 08:02:10 +0000 (10:02 +0200)]
sync_qemu_models_i386.py: Fix complaint from flake8

Line was too long.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "vnmi"
Tim Wiederhake [Wed, 24 May 2023 07:33:04 +0000 (09:33 +0200)]
cpu_map: Add missing feature "vnmi"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "stibp-always-on"
Tim Wiederhake [Wed, 24 May 2023 07:32:10 +0000 (09:32 +0200)]
cpu_map: Add missing feature "stibp-always-on"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "prefetchiti"
Tim Wiederhake [Wed, 24 May 2023 07:30:56 +0000 (09:30 +0200)]
cpu_map: Add missing feature "prefetchiti"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "null-sel-clr-base"
Tim Wiederhake [Wed, 24 May 2023 07:29:49 +0000 (09:29 +0200)]
cpu_map: Add missing feature "null-sel-clr-base"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "no-nested-data-bp"
Tim Wiederhake [Wed, 24 May 2023 07:29:03 +0000 (09:29 +0200)]
cpu_map: Add missing feature "no-nested-data-bp"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "lfence-always-serializing"
Tim Wiederhake [Wed, 24 May 2023 07:28:32 +0000 (09:28 +0200)]
cpu_map: Add missing feature "lfence-always-serializing"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "flush-l1d"
Tim Wiederhake [Wed, 24 May 2023 07:25:05 +0000 (09:25 +0200)]
cpu_map: Add missing feature "flush-l1d"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "fb-clear"
Tim Wiederhake [Wed, 24 May 2023 07:23:48 +0000 (09:23 +0200)]
cpu_map: Add missing feature "fb-clear"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "cmpccxadd"
Tim Wiederhake [Wed, 24 May 2023 07:22:31 +0000 (09:22 +0200)]
cpu_map: Add missing feature "cmpccxadd"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "avx-vnni-int8"
Tim Wiederhake [Wed, 24 May 2023 07:21:30 +0000 (09:21 +0200)]
cpu_map: Add missing feature "avx-vnni-int8"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "avx-ne-convert"
Tim Wiederhake [Wed, 24 May 2023 07:20:53 +0000 (09:20 +0200)]
cpu_map: Add missing feature "avx-ne-convert"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "avx-ifma"
Tim Wiederhake [Wed, 24 May 2023 07:18:04 +0000 (09:18 +0200)]
cpu_map: Add missing feature "avx-ifma"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "auto-ibrs"
Tim Wiederhake [Wed, 24 May 2023 07:16:04 +0000 (09:16 +0200)]
cpu_map: Add missing feature "auto-ibrs"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "amx-fp16"
Tim Wiederhake [Wed, 24 May 2023 07:12:45 +0000 (09:12 +0200)]
cpu_map: Add missing feature "amx-fp16"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "amd-psfd"
Tim Wiederhake [Wed, 24 May 2023 07:10:41 +0000 (09:10 +0200)]
cpu_map: Add missing feature "amd-psfd"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agodocs: Clarify values reported by virDomainMemoryStats()
Michal Privoznik [Wed, 24 May 2023 08:53:03 +0000 (10:53 +0200)]
docs: Clarify values reported by virDomainMemoryStats()

I was approached by a KubeVirt developer to clarify what value
does VIR_DOMAIN_MEMORY_STAT_DISK_CACHES report, whether it's from
the guest or the host POV. And since I didn't know the answer
even after reading the docs I think we can do better. Clarify the
POV then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
23 months agodocs: newapi.xsl: Generate overall docs for enums too
Michal Privoznik [Tue, 23 May 2023 16:46:58 +0000 (18:46 +0200)]
docs: newapi.xsl: Generate overall docs for enums too

There are/can be overall docs for enums (e.g.
virDomainModificationImpact) not just individual values. But
these never make it into the generated HTML which is a bit
unfortunate as they can contain valuable information for users.

Generate a block with overall enum documentation, just like we do
for functions.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
23 months agodocs: newapi.xsl: Generate docs on generic typedefs
Michal Privoznik [Wed, 24 May 2023 08:22:47 +0000 (10:22 +0200)]
docs: newapi.xsl: Generate docs on generic typedefs

We have plenty of generic typedefs (that basically just alias a
struct, or our popular virXXXPtr). Because we do not generate
HTML docs for it, the documentation is placed at random places,
e.g.: comment from virDomainPtr typedef ("a virDomainPtr is
pointer to a virDomain private structure ...") ends up after
virDomainProcessSignal enum block.

There are some less weird occurrences of this problem (e.g.
virBlkioParameterPtr), but yet - the typedef appears in TOC.

Therefore, generate a block for each typedef and put its
description there.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
23 months agocpu_map: Add SapphireRapids CPU model
Lin Yang [Thu, 18 May 2023 00:30:57 +0000 (17:30 -0700)]
cpu_map: Add SapphireRapids CPU model

Introduced in QEMU by commit v8.0.0-7eb061b06e.

Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
23 months agonodedev: update transient mdevs
Boris Fiuczynski [Mon, 8 May 2023 17:10:46 +0000 (19:10 +0200)]
nodedev: update transient mdevs

Instead of updating defined mdevs only add another update for active
devices as well to cover transient mdev devices as well.

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>
23 months agoqemu_hotplug: Temporarily allow emulator thread to access other NUMA nodes during...
Michal Privoznik [Mon, 22 May 2023 13:55:10 +0000 (15:55 +0200)]
qemu_hotplug: Temporarily allow emulator thread to access other NUMA nodes during mem hotplug

Again, this fixes the same problem as one of previous commits,
but this time for memory hotplug. Long story short, if there's a
domain running and the emulator thread is restricted to a subset
of host NUMA nodes, but the memory that's about to be hotplugged
requires memory from a host NUMA node that's not in the set we
need to allow emulator thread to access the node, temporarily.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemu: Start emulator thread with more generous cpuset.mems
Michal Privoznik [Fri, 19 May 2023 12:02:06 +0000 (14:02 +0200)]
qemu: Start emulator thread with more generous cpuset.mems

Consider a domain with two guest NUMA nodes and the following
<numatune/> setting :

  <numatune>
    <memory mode="strict" nodeset="0"/>
    <memnode cellid="0" mode="strict" nodeset="1"/>
  </numatune>

What this means is the emulator thread is pinned onto host NUMA
node #0 (by setting corresponding cpuset.mems to "0"), and two
memory-backend-* objects are created:

  -object '{"qom-type":"memory-backend-ram","id":"ram-node0", .., "host-nodes":[1],"policy":"bind"}' \
  -numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
  -object '{"qom-type":"memory-backend-ram","id":"ram-node1", .., "host-nodes":[0],"policy":"bind"}' \
  -numa node,nodeid=1,cpus=2-3,memdev=ram-node1 \

Note, the emulator thread is pinned well before QEMU is even
exec()-ed.

Now, the way memory allocation works in QEMU is: the emulator
thread calls mmap() followed by mbind() (which is sane, that's
how everybody should do it). BUT, because the thread is already
restricted by CGroups to just NUMA node #0, calling:

  mbind(host-nodes:[1]); /* made up syntax (TM) */

fails. This is expected though. Kernel was instructed to place
the memory at NUMA node "0" and yet, process is trying to place
it elsewhere.

We used to solve this by not restricting emulator thread at all
initially, and only after it's done initializing (i.e. we got the
QMP greeting) we placed it onto desired nodes. But this had its
own problems (e.g. QEMU might have locked pieces of its memory
which were then unable to migrate onto different NUMA nodes).

Therefore, in v5.1.0-rc1~282 we've changed this and set cgroups
upfront (even before exec()-ing QEMU). And this used to work, but
something has changed (I can't really put my finger on it).

Therefore, for the initialization start the thread with union of
all configured host NUMA nodes ("0-1" in our example) and fix the
placement only after QEMU is started.

NB, the memory hotplug suffers the same problem, but that will
be fixed in the next commit.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2138150
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemuProcessSetupPid: Use @numatune variable more
Michal Privoznik [Fri, 19 May 2023 12:02:01 +0000 (14:02 +0200)]
qemuProcessSetupPid: Use @numatune variable more

Inside of qemuProcessSetupPid() there's @numatune variable which
is set to vm->def->numa, but it lives only in one block. In the
rest of places the expanded form (vm->def->numa) is used instead.
Move the variable declaration at the beginning of the function
and use it instead of the expanded form.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemu: Use thread-context even with numatune's restrictive mode
Martin Kletzander [Fri, 19 May 2023 09:52:27 +0000 (11:52 +0200)]
qemu: Use thread-context even with numatune's restrictive mode

We cannot use host-nodes attribute for it, but there is no reason for us
to skip the preallocation optimisation using thread-context in such
case.  Thankfully returning the proper nodemask from
qemuBuildMemoryBackendProps is enough to trigger this.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agocpu-data.py: Filter out apic current logical processor
Tim Wiederhake [Tue, 28 Mar 2023 14:14:55 +0000 (16:14 +0200)]
cpu-data.py: Filter out apic current logical processor

Commit 10b5e789c5 attempts to filter out the logical processor id
in the generated data to remove noise and irrelevant changes in the
output.

cpuid-leaf 0x0B may have more than two sub-leaves though. Filter out
logical processor id from all sub-leaves of 0x0B and 0x1F (superset
of the information in 0x0B).

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
23 months agoNEWS: Mention support for compressing parallel migration
Jiri Denemark [Thu, 18 May 2023 13:56:34 +0000 (15:56 +0200)]
NEWS: Mention support for compressing parallel migration

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
23 months agoRevert "conf: Introduce MTE domain feature"
Andrea Bolognani [Mon, 22 May 2023 07:50:20 +0000 (09:50 +0200)]
Revert "conf: Introduce MTE domain feature"

The QEMU interface is still in a state of flux, and KVM support
has been pulled shortly after having been merged. Let's not
commit to a stable interface in libvirt just yet.

Reverts: 720e8f13ff71377580cd37b118cee8a1f982d1d8
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
23 months agoRevert "qemu:: Introduce QEMU_CAPS_MACHINE_VIRT_MTE capability"
Andrea Bolognani [Mon, 22 May 2023 07:50:06 +0000 (09:50 +0200)]
Revert "qemu:: Introduce QEMU_CAPS_MACHINE_VIRT_MTE capability"

The QEMU interface is still in a state of flux, and KVM support
has been pulled shortly after having been merged. Let's not
commit to a stable interface in libvirt just yet.

Reverts: 1347a19f75a23b4d92e6a7b549fcde52b23f0258
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
23 months agoRevert "qemu: Validate MTE feature"
Andrea Bolognani [Mon, 22 May 2023 07:49:51 +0000 (09:49 +0200)]
Revert "qemu: Validate MTE feature"

The QEMU interface is still in a state of flux, and KVM support
has been pulled shortly after having been merged. Let's not
commit to a stable interface in libvirt just yet.

Reverts: c6c9b5d251de215ed378aa0bc31daa2e1170409e
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
23 months agoRevert "qemu: Generate command line for MTE feature"
Andrea Bolognani [Mon, 22 May 2023 07:49:33 +0000 (09:49 +0200)]
Revert "qemu: Generate command line for MTE feature"

The QEMU interface is still in a state of flux, and KVM support
has been pulled shortly after having been merged. Let's not
commit to a stable interface in libvirt just yet.

Reverts: b10bc8f7ab6f9986ccc54ba04fc5b3bad7576be6
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
23 months agorpm: Explain BuildRequires on qemu-img
Andrea Bolognani [Fri, 5 May 2023 17:42:59 +0000 (19:42 +0200)]
rpm: Explain BuildRequires on qemu-img

It's not used as part of the build process or searched for at
build time, and the QEMU driver detects its path at runtime,
so one could think that the BuildRequires is unnecessary. But
we actually need it to be present at build time in order to
run the full test suite.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
23 months agonuma_conf: Deny other memory modes than 'restrictive' if a memnode is 'restrictive'
Michal Privoznik [Thu, 18 May 2023 08:31:12 +0000 (10:31 +0200)]
numa_conf: Deny other memory modes than 'restrictive' if a memnode is 'restrictive'

We already do check that if there's <memory mode='restrictive'/>
then all <memnode/> have to be of 'restrictive' mode too. But
what we are missing the reverse: if there is <memnode/> with
'restrictive' mode, then the <memory/> has to be of the same mode
too.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2208946
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agonuma_conf: Move memnode mode validation into virDomainNumaDefValidate()
Michal Privoznik [Thu, 18 May 2023 08:27:52 +0000 (10:27 +0200)]
numa_conf: Move memnode mode validation into virDomainNumaDefValidate()

When parsing a <memnode/> we also check whether the @mode
argument fulfills some requirements wrt 'restrictive' mode. This
is not the right place though. There's virDomainNumaDefValidate()
which contains other checks.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agovirDomainNumatuneNodeSpecified: Fix const correctness
Michal Privoznik [Thu, 18 May 2023 08:27:36 +0000 (10:27 +0200)]
virDomainNumatuneNodeSpecified: Fix const correctness

The virDomainNumatuneNodeSpecified() function does not write into
passed @numatune pointer, it just reads from it. Therefore, the
argument should be const, which allows this function to be called
from places where virDomainNuma is already const (e.g. domain
validation code).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agodocs: make isa-debugcon example more useful / directly applicable
Laszlo Ersek [Thu, 18 May 2023 12:59:39 +0000 (14:59 +0200)]
docs: make isa-debugcon example more useful / directly applicable

The type='pty' attribute in the <serial> element causes a Pseudo TTY to be
allocated on the host side via "/dev/ptmx", which is meant to be
interacted with via "virsh console" or similar.

That's not how a firmware log is typically viewed or saved. Replace
type='pty' with type='file', and also provide an example <source> element
(with the pathname of the logfile), similarly to how the <serial> example
just above provides a <source> element too.

Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Andrea Bolognani <abologna@redhat.com>
Updates: 654968381df0256c047d2ecd4542ccc90dc57ad0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agodocs: fix typo in isa-debugcon example
Laszlo Ersek [Thu, 18 May 2023 12:59:38 +0000 (14:59 +0200)]
docs: fix typo in isa-debugcon example

The <serial> opening tag is paired with the </console> closing tag; that's
a mismatch. The question is then whether to modify the former to
<console>, or the latter to </serial>.

Per section "Relationship between serial ports and consoles", <serial> is
used for emulated (not paravirt) consoles, and it's the type that's
suitable for early debug output (such as from firmware). Thus, change
</console> to </serial>.

Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Andrea Bolognani <abologna@redhat.com>
Fixes: 654968381df0256c047d2ecd4542ccc90dc57ad0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoqemu: support set parallel migration compression method
Jiang Jiacheng [Fri, 24 Feb 2023 09:27:12 +0000 (17:27 +0800)]
qemu: support set parallel migration compression method

Add new compress methods zlib and zstd for parallel migration,
these method should be used with migration option --comp-methods
and will be processed in 'qemuMigrationParamsSetCompression'.
Note that only one compress method could be chosen for parallel
migration and they cann't be used in compress migration.

Signed-off-by: Jiang Jiacheng <jiangjiacheng@huawei.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
23 months agovirsh: Add migrate options to set parallel compress level
Jiang Jiacheng [Fri, 24 Feb 2023 09:27:11 +0000 (17:27 +0800)]
virsh: Add migrate options to set parallel compress level

Add migrate options: --compression-zlib-level
                     --compression-zstd-level
These options are used to set compress level for "zlib"
or "zstd" during parallel migration if the compress method
is specified.

Signed-off-by: Jiang Jiacheng <jiangjiacheng@huawei.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
23 months agoAdd public API for parallel compression method
Jiang Jiacheng [Fri, 24 Feb 2023 09:27:10 +0000 (17:27 +0800)]
Add public API for parallel compression method

Add description for VIR_MIGRATE_PARAM_COMPRESSION, it will
be reused in choosing compression method during parallel migration.
Add public API VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL,
VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL for migration APIs
to support set compress level during parallel migration.

Signed-off-by: Jiang Jiacheng <jiangjiacheng@huawei.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
23 months agodocs: xsl: Simplify templating XSL
Peter Krempa [Wed, 17 May 2023 12:17:56 +0000 (14:17 +0200)]
docs: xsl: Simplify templating XSL

Wrap the auto-generated pages (API ref and hvsupport.html) in the proper
top level element similarly to what the pages generated from RST have to
remove the extra case when templating our web.

(Best viewed with 'git show -w')

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agodocs: newapi.xsl: Remove support for generating index page
Peter Krempa [Wed, 17 May 2023 14:48:09 +0000 (16:48 +0200)]
docs: newapi.xsl: Remove support for generating index page

Since we need to generate API docs for multiple input files the index
page is not useful for us and was replaced by a manual one. Drop the XSL
for generating it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agodocs: html: Add a manually written index page
Peter Krempa [Wed, 17 May 2023 14:41:35 +0000 (16:41 +0200)]
docs: html: Add a manually written index page

The auto-generated index contains only references to one run of the
generator but we in total run it 4 times missing the admin, lxc, and
qemu specific apis.

Rewrite it manually so that we can drop the generator for it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agocss: Remove override of width for 'hvsupport' page
Peter Krempa [Wed, 17 May 2023 14:21:59 +0000 (16:21 +0200)]
css: Remove override of width for 'hvsupport' page

Now that the table is not so wide we can treat it as any other page.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agohvsupport: Split out common APIs from hypervisor API section
Peter Krempa [Wed, 17 May 2023 13:59:30 +0000 (15:59 +0200)]
hvsupport: Split out common APIs from hypervisor API section

Common APIs such as virConnectOpen/Close and similar which are used by
the non-hypervisor drivers in libvirt are grouped together with
hypervisor drivers, which makes the table very wide.

Split them out into a separate group and clean up the list of hypervisor
drivers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoscripts: hvsupport: Properly register virConnectOpenAuth/virConnectOpenReadOnly APIs
Peter Krempa [Wed, 17 May 2023 14:12:44 +0000 (16:12 +0200)]
scripts: hvsupport: Properly register virConnectOpenAuth/virConnectOpenReadOnly APIs

Use the proper driver struct member names for the aforementioned APIs so
that the fixup of the versions works properly.

Currently we reported that no of the drivers supported the APIs despite
being only shims above 'open'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agodocs: Remove XSLT table of contents generator
Peter Krempa [Wed, 17 May 2023 10:55:20 +0000 (12:55 +0200)]
docs: Remove XSLT table of contents generator

The only remaining page was 'hvsupport.html' which is generated by
'scripts/hvsupport.py'. The script already has all the data to generate
the table of contents internally so we can remove the whole complicated
template.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agodocs: index: Convert to 'rst'
Peter Krempa [Wed, 3 Aug 2022 12:59:14 +0000 (14:59 +0200)]
docs: index: Convert to 'rst'

Final piece of conversion of our non-generated pages to 'rst'.

Special raw HTML is used for adding the appropriate code to fetch the
blog planet.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agodocs: acl: Convert to 'rst'
Peter Krempa [Wed, 3 Aug 2022 12:59:03 +0000 (14:59 +0200)]
docs: acl: Convert to 'rst'

The only special bit about the 'acl' page was the inclusion of the
objects and permissions tables. We can do that by the '.. raw::'
directive.

One reference from 'aclpolkit.rst' needed to be updated to go with the
new header anchor naming.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agocss: Fix styling of the "3 panel" pages
Peter Krempa [Tue, 16 May 2023 13:53:11 +0000 (15:53 +0200)]
css: Fix styling of the "3 panel" pages

Use the same 'margin-bottom' bot for the normal and mobile layout fixing
one of the panels touching the footer.

Use same font size both for <h1> and <h2> used as the column titles as
rst2html5 based on version can generate either of them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agocss: mobile: Make colums in "3 column" mobile layout wider
Peter Krempa [Tue, 16 May 2023 15:09:00 +0000 (17:09 +0200)]
css: mobile: Make colums in "3 column" mobile layout wider

Use the full width of the parent box and drop the unnecessarily bigger
margin.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agocss: mobile: Fix hiding of big logo in mobile layout
Peter Krempa [Tue, 16 May 2023 15:07:08 +0000 (17:07 +0200)]
css: mobile: Fix hiding of big logo in mobile layout

Use the '#index' id to select the proper page as the body element
doesn't have 'index' class.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agocss: mobile: Fix responsive design of 'docs' and 'knowledgebase' pages
Peter Krempa [Tue, 16 May 2023 13:50:47 +0000 (15:50 +0200)]
css: mobile: Fix responsive design of 'docs' and 'knowledgebase' pages

When the pages were converted to rST it required changes to how the
panels are created. This change was not reproduced in the specific media
override for narrow displays and thus made those pages unusable.

Note that two lines per document are needed as some rst2html5 versions
format a <div class='section'> and others do a <section> element
instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agocss: mobile: Replace tabs with spaces
Peter Krempa [Tue, 16 May 2023 13:19:25 +0000 (15:19 +0200)]
css: mobile: Replace tabs with spaces

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

Last use was removed in 11850158bdae1572d587b10ea8cb7c12d4f61527

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
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>
23 months 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>