]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
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>
23 months agomeson: Stop looking for QEMU helpers
Andrea Bolognani [Tue, 25 Apr 2023 14:30:44 +0000 (16:30 +0200)]
meson: Stop looking for QEMU helpers

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

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

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

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

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

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

Prepare for further changes.

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

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

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

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

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

Currently translated at 2.3% (243 of 10399 strings)

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

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

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

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

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

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

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

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

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

Use our modern cleanup path pattern.

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

Drop the unnecessary disk definition and use x86_64 emulator.

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

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

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

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

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

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

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

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

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

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

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

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

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

  EnvironmentFile=-@initconfdir@/virtxxxd

The daemon is then executed as:

  ExecStart=@sbindir@/virtxxxd $VIRTXXXD_ARGS

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

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

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

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

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

Reorder the hotplug code to have the same order.

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>