]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
2 years agoqemu: Report supported TPM version in domcaps
Michal Privoznik [Tue, 12 Jul 2022 13:58:17 +0000 (15:58 +0200)]
qemu: Report supported TPM version in domcaps

Now that we have everything prepared, we can start detecting
supported TPM versions and setting corresponding values in
backendModel struct.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/340
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2103119
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agodomcaps: Introduce TPM backendVersion
Michal Privoznik [Tue, 12 Jul 2022 13:58:12 +0000 (15:58 +0200)]
domcaps: Introduce TPM backendVersion

We accept TPM version in the domain XML. However, supported
version depends on the host (swtpm_setup binary) and thus it may
be tricky for users (or mgmt applications) chose a version.
Introduce machinery for reporting supported version in domain
capabilities.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agovirtpm: Introduce TPM-1.2 and TPM-2.0 capabilieis
Michal Privoznik [Tue, 12 Jul 2022 13:46:50 +0000 (15:46 +0200)]
virtpm: Introduce TPM-1.2 and TPM-2.0 capabilieis

These new capabilities will be used only to track whether
swtpm_setup is capable of TPM-1.2 and/or TPM-2.0.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agodocs: Document TPM portion of domcaps
Michal Privoznik [Tue, 12 Jul 2022 14:10:08 +0000 (16:10 +0200)]
docs: Document TPM portion of domcaps

Surprisingly, we don't document TPM part of domain capabilities.
Fortunately, the information exposed is pretty much self
explanatory, but we should document it regardless.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoremote: conf: Mention that 'virtproxyd' doesn't require the '--listen' flag
Peter Krempa [Tue, 12 Jul 2022 10:45:52 +0000 (12:45 +0200)]
remote: conf: Mention that 'virtproxyd' doesn't require the '--listen' flag

'virtproxyd' doesn't have the '--listen' parameter and it's enough just
to enable the corresponding option in the config.

The config file is generic for all the daemons and we just omit/adjust
some sections. Adding a separate mechanism to omit the note about the
'--listen' parameter would be overkill so mention explicitly that it's
required only for libvirtd and not virtproxyd.

The section is omitted for other daemons.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2094641
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2 years agoqemuxml2*test: Add 'startupPolicy' fields to aio-io_uring case
Peter Krempa [Tue, 14 Jun 2022 14:47:51 +0000 (16:47 +0200)]
qemuxml2*test: Add 'startupPolicy' fields to aio-io_uring case

Extend the test for io_uring to also test startup policy.

Since the actual logic for dropping disks is in the host preparation
phase, thus skipped for tests we can use any file path.

Add a case also for 'file' backing to have all cases covered.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agodocs: formatstorage: Format XML namespace definition as code block
Peter Krempa [Tue, 12 Jul 2022 09:22:34 +0000 (11:22 +0200)]
docs: formatstorage: Format XML namespace definition as code block

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2 years agovircpi: Add PCIe 5.0 and 6.0 link speeds
Michal Privoznik [Fri, 8 Jul 2022 12:29:32 +0000 (14:29 +0200)]
vircpi: Add PCIe 5.0 and 6.0 link speeds

The PCIe 5.0 and PCIe 6.0 standards define new link speeds:
32GT/s and 64GT/s, respectively. Update our internal enum to
include these new speeds. Otherwise we format incorrect XML:

  <pci-express>
    <link validity='cap' port='0' speed='(null)' width='16'/>
    <link validity='sta' speed='16' width='16'/>
  </pci-express>

Like all "good" specifications, these are also locked behind a
login portal. But we can look at pciutils' source code: [1] and
[2].

1: https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git/commit/ls-caps.c?id=caca31a0eea41c7b051705704c1158fddc02fbd2
2: https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git/commit/ls-caps.c?id=5bdf63b6b1bc35b59c4b3f47f7ca83ca1868155b

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2105231
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoci: Regenerate files with new lcitool
Peter Krempa [Mon, 11 Jul 2022 11:47:02 +0000 (13:47 +0200)]
ci: Regenerate files with new lcitool

Apart from other changes this fixes failures with builds on FreeBSD.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agoqemucapabilitiestest: Fake proper version for 'caps_4.2.0.aarch64' case
Peter Krempa [Wed, 22 Jun 2022 13:28:49 +0000 (15:28 +0200)]
qemucapabilitiestest: Fake proper version for 'caps_4.2.0.aarch64' case

The capabilities for that version were not updated from the development
version and thus would fail our upcoming minimum version change. Fake
the data to report 4.2.0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemucapabilitiestest: Fake proper version for 'caps_4.2.0.ppc64' case
Peter Krempa [Wed, 22 Jun 2022 13:28:49 +0000 (15:28 +0200)]
qemucapabilitiestest: Fake proper version for 'caps_4.2.0.ppc64' case

The capabilities for that version were not updated from the development
version and thus would fail our upcoming minimum version change. Fake
the data to report 4.2.0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: Remove qemu-4.0 version of 'cpu-translation' test case
Peter Krempa [Wed, 22 Jun 2022 13:07:22 +0000 (15:07 +0200)]
qemu: Remove qemu-4.0 version of 'cpu-translation' test case

The cpu commandline is identical with the '-latest' version so there's
no need for a separate case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Move real-caps versions of cpu-host tests out of the block setting...
Peter Krempa [Wed, 22 Jun 2022 11:30:18 +0000 (13:30 +0200)]
qemuxml2argvtest: Move real-caps versions of cpu-host tests out of the block setting fake host cpu

Make it obvious that the fake cpu does not apply to the test cases based
on real capabilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Make 'qemu-ns' test case more stable
Peter Krempa [Wed, 22 Jun 2022 11:07:53 +0000 (13:07 +0200)]
qemuxml2argvtest: Make 'qemu-ns' test case more stable

The test was showing that the 'blockdev' capability is properly added
although we didn't detect it yet. Unfortunately this test can't be
carried over once we bump minimum qemu version to qemu-4.2.

Make the test case future-proof by removing the qemu-4.0.0 version which
would become pointless and use only already deprecated capability flags
so that the test output does not change.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Convert 'net-user' case to _LATEST
Peter Krempa [Wed, 22 Jun 2022 11:03:24 +0000 (13:03 +0200)]
qemuxml2argvtest: Convert 'net-user' case to _LATEST

The tested net device has the same syntax with latest qemu so there's no
need to have a version-locked test for it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Remove qemu-4.0 versions of cpu feature test cases
Peter Krempa [Tue, 21 Jun 2022 14:54:01 +0000 (16:54 +0200)]
qemuxml2argvtest: Remove qemu-4.0 versions of cpu feature test cases

The cpu feature formatting doesn't change between the versions thus we
can just keep the '-latest' versions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Convert 'cpu-eoi-(disabled|enabled)' cases to VIR_TEST_CAPS_LATEST
Peter Krempa [Tue, 21 Jun 2022 15:07:51 +0000 (17:07 +0200)]
qemuxml2argvtest: Convert 'cpu-eoi-(disabled|enabled)' cases to VIR_TEST_CAPS_LATEST

The tested feature doesn't change across versions so we can use the
modern testing infrastructure.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Drop 'qemu-4.1' versions of hyperv tests
Peter Krempa [Tue, 21 Jun 2022 14:43:16 +0000 (16:43 +0200)]
qemuxml2argvtest: Drop 'qemu-4.1' versions of hyperv tests

The version-locked version of the test data is identical to the 'latest'
version so we can remove them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2(argv|xml)test: Drop qemu-3.1 version of 'cpu-Icelake-Server-pconfig'
Peter Krempa [Tue, 21 Jun 2022 13:48:06 +0000 (15:48 +0200)]
qemuxml2(argv|xml)test: Drop qemu-3.1 version of 'cpu-Icelake-Server-pconfig'

Prior to qemu-3.2 we'd have to disable the 'pconfig' feature explicitly
which is no longer needed with new qemu. Remove the version locked to
qemu-3.1 as the 'latest' case sufficiently handles what we want to test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotest: domaincaps: Remove old test data
Peter Krempa [Tue, 21 Jun 2022 13:37:51 +0000 (15:37 +0200)]
test: domaincaps: Remove old test data

Remove the test data for qemu-2.11, qemu-2.12 and qemu-3.0 which are no
longer supported.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu_monitor_json: Implement logic for setting iothread.thread-pool-{min,max}
Michal Privoznik [Thu, 30 Jun 2022 11:44:58 +0000 (13:44 +0200)]
qemu_monitor_json: Implement logic for setting iothread.thread-pool-{min,max}

When virDomainSetIOThreadParams() API is called, well its QEMU
impl: qemuDomainSetIOThreadParams() then typed params are parsed
by qemuDomainIOThreadParseParams() into this
qemuMonitorIOThreadInfo struct. In the struct we have a <int,
bool> pair for every IOThread attribute we can tune through
monitor. The struct is then passed to
qemuMonitorJSONSetIOThread() which looks at the bool and if set
then the corresponding attribute is set to given value. Each
attribute is thus changed in a separate call. While this works
for attributes independent of each other ("poll-max-ns",
"poll-grow", "poll-shrink"), it does not always work for the
other attributes ("thread-pool-min" and "thread-pool-max").

The limitation here is that the lower boundary (minimum) has to
be lower (or equal to) the upper boundary (maximum) at all times.

This means, that in some cases we might need to set attributes in
reversed order to meet the constraint.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/339
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Thu, 7 Jul 2022 10:33:55 +0000 (12:33 +0200)]
Translated using Weblate (Swedish)

Currently translated at 39.0% (4101 of 10491 strings)

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

Translated using Weblate (Swedish)

Currently translated at 38.7% (4062 of 10491 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2 years agokbase: debuglogs: Add a note about auto-shutdown of daemons
Peter Krempa [Mon, 13 Jun 2022 13:48:51 +0000 (15:48 +0200)]
kbase: debuglogs: Add a note about auto-shutdown of daemons

When using runtime setting of logging with 'virt-admin' it can be
confusing that the settings are discarded when the shutdown timeout of a
daemon is reached.

Add a note about this behaviour along with a suggestion to use
virt-admin to disable the behaviour if needed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agovirt-admin: Introduce 'daemon-timeout'
Peter Krempa [Mon, 13 Jun 2022 13:27:27 +0000 (15:27 +0200)]
virt-admin: Introduce 'daemon-timeout'

Add a simple command to drive the new 'virAdmConnectSetDaemonTimeout'
API.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoadmin: Introduce virAdmConnectSetDaemonTimeout
Peter Krempa [Mon, 13 Jun 2022 11:02:09 +0000 (13:02 +0200)]
admin: Introduce virAdmConnectSetDaemonTimeout

Use of the admin APIs to modify logging temporarily has a rather serious
deficiency when the daemon whose config is being changed is using
auto-shutdown (default with socket-activated deployments) as the
configuration is discarded if there is no client or VM/other object
blocking auto shutdown.

This API allows users to disable/postpone shutdown timeout so that the
configuration doesn't change under their hands.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoscripts: apibuild: Improve error when API is missing from symbol file
Peter Krempa [Mon, 13 Jun 2022 12:44:08 +0000 (14:44 +0200)]
scripts: apibuild: Improve error when API is missing from symbol file

Improve:

 KeyError: 'virAdmConnectSetDaemonTimeout'

to

 Exception: Missing symbol file entry for 'virAdmConnectSetDaemonTimeout'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agovirNetDaemonAutoShutdown: Allow live update of shutdown timeout
Peter Krempa [Mon, 13 Jun 2022 12:25:06 +0000 (14:25 +0200)]
virNetDaemonAutoShutdown: Allow live update of shutdown timeout

Modify the code so that calling 'virNetDaemonAutoShutdown' will update
the auto shutdown timeout also for running daemons.

This involves changing the logic when to do the update of the timer so
that it can be called from both when the daemon is not yet runnign and
when doing a live update.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agovirnetdaemon: Extract autoShutdownTimer operations from virNetDaemonRun
Peter Krempa [Mon, 13 Jun 2022 11:58:13 +0000 (13:58 +0200)]
virnetdaemon: Extract autoShutdownTimer operations from virNetDaemonRun

Introduce 'virNetDaemonShutdownTimerRegister' and
'virNetDaemonShutdownTimerUpdate' to aggregate the code to deal with the
auto-shutdown timer.

The code is also placed so that it can be called from
'virNetDaemonAutoShutdown' which involved the move of
'virNetDaemonAutoShutdownTimer'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agodomain_postparse: Move error messages onto single line
Michal Privoznik [Thu, 7 Jul 2022 08:44:13 +0000 (10:44 +0200)]
domain_postparse: Move error messages onto single line

Our coding style suggests 80 chars per line with error messages
being exception (for easier git-grep). Apply this exception onto
the newly created domain_postparse.c file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: Separate domain post parse code into domain_postparse.c
Michal Privoznik [Thu, 7 Jul 2022 08:03:33 +0000 (10:03 +0200)]
conf: Separate domain post parse code into domain_postparse.c

The domain post parse functions currently live in domain_conf.c
which thus grows always larger. Mimic what we've done for the
validation code and move the post parse code into a separate
file: domain_postparse.c.

I've started by moving every function with PostParse in its name
into the new file and then compile hunting for helper functions
only to move them as well.

In the end, I've moved virDomainDefPostParse symbol in
libvirt_private.syms into a new section. And while
virDomainDeviceDefPostParseOne() is made 'public' in
domain_postparse.h too, I'm not exporting it because it has no
caller outside src/conf/ and it's unlikely it ever will.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agodomain_conf: Unexport virDomainDefPostParseDeviceIteratorData
Michal Privoznik [Thu, 7 Jul 2022 08:09:27 +0000 (10:09 +0200)]
domain_conf: Unexport virDomainDefPostParseDeviceIteratorData

The virDomainDefPostParseDeviceIteratorData struct is exported in
domain_conf.h because it's used in both domain_conf.c and
domain_validate.c. However, the latter usage is not warranted,
it's just a shortcut so that we don't have to introduce a similar
struct just for domain_validate.c. Well, do the extra step and
introduce a separate structure for domain_validate.c. This allows
us to move post parse code later on.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirt-xml-validate: Fix incorrect wildcards for XML roots
Han Han [Wed, 6 Jul 2022 02:02:52 +0000 (10:02 +0800)]
virt-xml-validate: Fix incorrect wildcards for XML roots

To match the XML roots domainCapabilities and storagepoolCapabilities,
the wildcards should be *domainCap* and *storagepoolCap*.

Fixes: 7b0e2e4a558da6ea7e450d5a1a30d1557abc5aae
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoschemas: rng: Make secret optional in storage vol
Han Han [Wed, 6 Jul 2022 02:42:02 +0000 (10:42 +0800)]
schemas: rng: Make secret optional in storage vol

For a qcow2 storage volume with luks encryption created by qemu-img, its
dumped storage vol XML has no secret element in encryption:
<volume type='file'>
    ...
    <encryption format='luks'>
    </encryption>
    ...
</volume>

That will cause a failure in rng validation. Fix that validation failure.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agodocs: Fix syntax error in defaultiothread example
Han Han [Wed, 6 Jul 2022 06:20:30 +0000 (14:20 +0800)]
docs: Fix syntax error in defaultiothread example

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agodomain_validate: Properly terminate switch() in virDomainIOMMUDefValidate()
Michal Privoznik [Mon, 4 Jul 2022 13:32:35 +0000 (15:32 +0200)]
domain_validate: Properly terminate switch() in virDomainIOMMUDefValidate()

In my previous commit I've introduced virDomainIOMMUDefValidate()
function with a switch() statement. However, two cases in it,
though empty, were not terminated with a break statement which
made compiler complain.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2 years agodomain_validate: Disallow non-virtio IOMMU with an <address/>
Michal Privoznik [Mon, 4 Jul 2022 09:10:31 +0000 (11:10 +0200)]
domain_validate: Disallow non-virtio IOMMU with an <address/>

Per v8.3.0-rc1~199 it's only a virtio IOMMU that can have
<address/>. The rest (Intel and SMMUv3) are system devices and
thus have no address associated with them. However, this
assumption is never checked for.

Fixes: b0eb1e193f5db033d0fbbf91ff71a121066ad77c
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agodocs: Document <address/> for IOMMU device
Michal Privoznik [Mon, 4 Jul 2022 09:10:09 +0000 (11:10 +0200)]
docs: Document <address/> for IOMMU device

The commit v8.3.0-rc1~199 introduced <address/> to <iommu/>
device. And while it updated the RNG it forgot to update the
docs. Fix that.

Fixes: b0eb1e193f5db033d0fbbf91ff71a121066ad77c
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu_domain_address: Drop needless virDomainIOMMUModel typecast
Michal Privoznik [Mon, 4 Jul 2022 09:09:46 +0000 (11:09 +0200)]
qemu_domain_address: Drop needless virDomainIOMMUModel typecast

There are two places where the @model member of
_virDomainIOMMUDef struct is typecasted to virDomainIOMMUModel
which is completely unnecessary because the struct already
defines the member of that type.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoTranslated using Weblate (Russian)
Sergey A [Mon, 4 Jul 2022 01:18:58 +0000 (03:18 +0200)]
Translated using Weblate (Russian)

Currently translated at 91.3% (9567 of 10472 strings)

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

Co-authored-by: Sergey A <sw@atrus.ru>
Signed-off-by: Sergey A. <sw@atrus.ru>
2 years agoFix spelling
Tim Wiederhake [Mon, 4 Jul 2022 08:07:47 +0000 (10:07 +0200)]
Fix spelling

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
2 years agoTranslated using Weblate (Korean)
김인수 [Sat, 2 Jul 2022 01:18:53 +0000 (03:18 +0200)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10472 of 10472 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2 years agoconf: fix error message for wrong thread_pool_size
Ján Tomko [Fri, 1 Jul 2022 14:13:23 +0000 (16:13 +0200)]
conf: fix error message for wrong thread_pool_size

Fix the copy-and-paste error by referring to the correct variable.

Fixes: 0df2e7df80452f81edbfeb0ee355235b533346a9
https://bugzilla.redhat.com/show_bug.cgi?id=2103132

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2 years agostoragepoolxml2argvtest: Fix output data for 'pool-netfs-protocol-ver'
Peter Krempa [Fri, 1 Jul 2022 14:53:08 +0000 (16:53 +0200)]
storagepoolxml2argvtest: Fix output data for 'pool-netfs-protocol-ver'

The storage pool tests have host-specific versions which I neglected to
update in commit c44930d932203b4a58dccbbeaa814fff6cea8216 thus breaking
the test-suite on non-linux OSes.

Fixes: c44930d932203b4a58dccbbeaa814fff6cea8216
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2 years agostorage: pool: Allow more intricate nfs protocol versions
Peter Krempa [Thu, 23 Jun 2022 15:17:06 +0000 (17:17 +0200)]
storage: pool: Allow more intricate nfs protocol versions

Treat the 'protocolVer' field as a string so that e.g. '4.1' can be
used. Forbid only ',' in the string as it's a separator of arguments for
mount options.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoNEWS: Document improvements to firmware autoselection
Andrea Bolognani [Thu, 23 Jun 2022 13:26:00 +0000 (15:26 +0200)]
NEWS: Document improvements to firmware autoselection

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agodocs: Add kbase page for Secure Boot
Andrea Bolognani [Wed, 22 Jun 2022 10:08:04 +0000 (12:08 +0200)]
docs: Add kbase page for Secure Boot

Provide simple recipes for the most common high-level tasks.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu_firmware: enrolled-keys requires secure-boot
Andrea Bolognani [Thu, 9 Jun 2022 17:02:15 +0000 (19:02 +0200)]
qemu_firmware: enrolled-keys requires secure-boot

No sane firmware build will fail this check, but just to be on
the safe side let's check anyway.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu_firmware: Enable loader.secure when requires-smm
Andrea Bolognani [Thu, 9 Jun 2022 15:59:33 +0000 (17:59 +0200)]
qemu_firmware: Enable loader.secure when requires-smm

Currently, a firmware configuration such as

  <os firmware='efi'>
    <firmware>
      <feature enabled='yes' name='enrolled-keys'/>
    </firmware>
  </os>

will correctly pick a firmware that implements the Secure Boot
feature and initialize the NVRAM file so that it contains the
keys necessary to enforce the signing requirements. However, the
lack of a

  <loader secure='yes'/>

element makes it possible for pflash writes to happen outside
of SMM mode. This means that the authenticated UEFI variables
where the keys are stored could potentially be overwritten by
malicious code running in the guest, thus making it possible to
circumvent Secure Boot.

To prevent that from happening, automatically turn on the
loader.secure feature whenever a firmware that implements Secure
Boot is chosen by the firmware autoselection logic. This is
identical to the way we already automatically enable SMM in such
a scenario.

Note that, while this is technically a guest-visible change, it
will not affect migration of existings VMs and will not prevent
legitimate guest code from running.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Reject features when using manual firmware selection
Andrea Bolognani [Mon, 20 Jun 2022 15:44:31 +0000 (17:44 +0200)]
conf: Reject features when using manual firmware selection

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Always parse firmware features
Andrea Bolognani [Mon, 20 Jun 2022 15:44:17 +0000 (17:44 +0200)]
conf: Always parse firmware features

Regardless of whether firmware autoselection is in use, we
still want to parse the list of requested features. Doing this
will allow us to produce better error messages.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Validate firmware configuration more thoroughly
Andrea Bolognani [Wed, 15 Jun 2022 10:00:58 +0000 (12:00 +0200)]
conf: Validate firmware configuration more thoroughly

Generally speaking, when firmware autoselection is in use we
don't want any information to be provided manually. There are
two exceptions:

  * we still want the path to the NVRAM file to be customizable;

  * using <loader secure='yes'/> was how you would ask for a
    firmware that implements the Secure Boot feature in the
    original approach to firmware autoselection, so we want to
    keep that working.

Anything else should result in a descriptive error.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/327
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Refactor virDomainDefOSValidate()
Andrea Bolognani [Thu, 16 Jun 2022 09:30:30 +0000 (11:30 +0200)]
conf: Refactor virDomainDefOSValidate()

This makes it explicit that there are two possible scenarios
(whether or not firmware autoselection is in use) and will make
upcoming changes cleaner to implement.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Always parse all firmware information
Andrea Bolognani [Thu, 16 Jun 2022 09:26:37 +0000 (11:26 +0200)]
conf: Always parse all firmware information

Currently we're simply ignoring some elements and attributes,
such as the loader path, when firmware autoselection is enabled
because we know we're not going to use them.

This makes sense, but has the unfortunate consequence of
confusing users who experience part of their configuration
simply going away for no apparent reason.

A more user-friendly approach is to produce meaningful error
messages in those scenarios. As a first step towards that goal,
stop conditionally parsing information.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Reject enrolled-keys=yes with secure-boot=no
Andrea Bolognani [Wed, 15 Jun 2022 09:30:48 +0000 (11:30 +0200)]
conf: Reject enrolled-keys=yes with secure-boot=no

This combination doesn't make sense and so the firmware
autoselection logic will not be able to find a suitable firmware,
but it's more user-friendly to report a detailed error upfront.

Note that this check would ideally happen in the validate phase,
but if we moved it there we would no longer be able to
automatically enable secure-boot when enrolled-keys=yes. Since
the combination never resulted in a working configuration, the
chances of this causing real-world VMs to disappear are
extremely low.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Add return value to virDomainDefPostParseOs()
Andrea Bolognani [Wed, 15 Jun 2022 09:34:12 +0000 (11:34 +0200)]
conf: Add return value to virDomainDefPostParseOs()

There are currently no failure scenarios for the function, but
we're about to add one.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Enable secure-boot when enrolled-keys is enabled
Andrea Bolognani [Wed, 15 Jun 2022 08:36:42 +0000 (10:36 +0200)]
conf: Enable secure-boot when enrolled-keys is enabled

The latter doesn't make sense without the former, so make that
visible in the XML.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Always parse NVRAM path if present
Andrea Bolognani [Fri, 17 Jun 2022 09:40:14 +0000 (11:40 +0200)]
conf: Always parse NVRAM path if present

Currently, the lack of a <loader> element results in the <nvram>
element being completely ignored, but this is unnecessarily
limiting: even when firmware autoselection is in use, it should
be possible for the user to specify a custom path for the NVRAM
file.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Use nodes in virDomainLoaderDefParseXMLNvram()
Andrea Bolognani [Fri, 17 Jun 2022 09:04:17 +0000 (11:04 +0200)]
conf: Use nodes in virDomainLoaderDefParseXMLNvram()

This makes the function more consistent with
virDomainLoaderDefParseXML() by preferring the virXMLProp
class of functions to XPath access.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Rename virDomainLoaderDefParseXML() argument
Andrea Bolognani [Fri, 17 Jun 2022 08:36:01 +0000 (10:36 +0200)]
conf: Rename virDomainLoaderDefParseXML() argument

We're going to start passing multiple nodes to the function in
a moment, so we need a more specific name.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Handle NVRAM in virDomainLoaderDefParseXML()
Andrea Bolognani [Thu, 16 Jun 2022 16:02:14 +0000 (18:02 +0200)]
conf: Handle NVRAM in virDomainLoaderDefParseXML()

All the data in the <nvram> element ends up in the same struct
as that coming from the <loader> element, so it makes sense to
have a single entry point for parsing an XML document into a
virDomainLoaderDef instance.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Move nvramTemplate parsing
Andrea Bolognani [Thu, 16 Jun 2022 15:52:14 +0000 (17:52 +0200)]
conf: Move nvramTemplate parsing

It belongs to virDomainLoaderDefParseXMLNvram(), where the other
parts of the <nvram> element are handled.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Move setting type for NVRAM source
Andrea Bolognani [Thu, 16 Jun 2022 15:53:11 +0000 (17:53 +0200)]
conf: Move setting type for NVRAM source

When the 'type' attribute is present we'd end up overwriting
this value via virDomainStorageSourceParse(). Moving this
assignment makes the current code clearer and will also help
with upcoming changes.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Rename virDomainLoaderDefParseXMLNvram()
Andrea Bolognani [Thu, 16 Jun 2022 15:49:08 +0000 (17:49 +0200)]
conf: Rename virDomainLoaderDefParseXMLNvram()

The previous name was identical, modulo the case, to the
completely unrelated virDomainNVRAMDefParseXML().

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Move virDomainLoaderDefParseXML()
Andrea Bolognani [Thu, 16 Jun 2022 16:01:46 +0000 (18:01 +0200)]
conf: Move virDomainLoaderDefParseXML()

Pure code movement, needed to prepare for upcoming changes.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agotests: Add more firmware tests
Andrea Bolognani [Thu, 9 Jun 2022 13:56:32 +0000 (15:56 +0200)]
tests: Add more firmware tests

Note that some of these new tests are displaying incorrect or
suboptimal behavior. When we address those in upcoming patches,
this will be highlighted by changes in the test data.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agotests: Don't use loader.secure=no with firmware autoselection
Andrea Bolognani [Thu, 9 Jun 2022 16:05:33 +0000 (18:05 +0200)]
tests: Don't use loader.secure=no with firmware autoselection

This currently has not effect whatsoever, so it's just cluttering
the input files.

We're going to add specific handling for this scenario, as well
as a test case covering it, in an upcoming commit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agotests: Don't set NVRAM path manually
Andrea Bolognani [Thu, 9 Jun 2022 13:51:56 +0000 (15:51 +0200)]
tests: Don't set NVRAM path manually

This does the opposite of

  commit 392292cd99ee275f986e9e21f325a9fee8e8bbfe
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Wed Feb 23 12:45:51 2022 +0000

    tests: don't use auto-generated NVRAM path in tests

in order to minimize input files.

We're going to add a test case specifically covering the use of
custom NVRAM paths with firmware autoselection in an upcoming
commit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agotests: Use minimal hardware for firmware tests
Andrea Bolognani [Thu, 9 Jun 2022 13:02:19 +0000 (15:02 +0200)]
tests: Use minimal hardware for firmware tests

When testing firmware selection, we don't really care about any
of the hardware assigned to the VM, and in fact it's better to
keep it as minimal as possible to make sure that the focus
remains on the firmware bits.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agotests: Rename and reorganize firmware tests
Andrea Bolognani [Thu, 9 Jun 2022 13:54:36 +0000 (15:54 +0200)]
tests: Rename and reorganize firmware tests

Group all tests related to firmware selection together and give
them consistent names that leave room for further tests to be
added in an upcoming commit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agotests: Drop bios-nvram-os-interleave test
Andrea Bolognani [Fri, 17 Jun 2022 13:23:46 +0000 (15:23 +0200)]
tests: Drop bios-nvram-os-interleave test

This was introduced in

  commit 5882064084a733a661759f8f3461f7cbc259175e
  Author: Martin Kletzander <mkletzan@redhat.com>
  Date:   Wed Feb 25 15:45:26 2015 +0100

    tests: Add test for os interleaving

to ensure a recent change in the schema was behaving correctly.

Seven years later, it no longer seems very useful to keep it
around.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agotests: Use firmware autoselection on aarch64
Andrea Bolognani [Fri, 17 Jun 2022 14:20:16 +0000 (16:20 +0200)]
tests: Use firmware autoselection on aarch64

This simplifies the test data without negatively impacting test
coverage.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agotests: Remove firmware bits from unrelated tests
Andrea Bolognani [Fri, 17 Jun 2022 12:59:56 +0000 (14:59 +0200)]
tests: Remove firmware bits from unrelated tests

The pci-bridge-many-disks test case is not related to firmware
handling at all, so we can trim it without losing any coverage.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agosecurity_selinux.c: Relabel existing mode="bind" UNIX sockets
David Michael [Tue, 28 Jun 2022 12:33:41 +0000 (08:33 -0400)]
security_selinux.c: Relabel existing mode="bind" UNIX sockets

This supports sockets created by libvirt and passed by FD using the
same method as in security_dac.c.

Signed-off-by: David Michael <david@bigbadwolfsecurity.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agovirnettlscontext: Don't set DH parameters ourselves
Michal Privoznik [Wed, 29 Jun 2022 09:16:06 +0000 (11:16 +0200)]
virnettlscontext: Don't set DH parameters ourselves

According to [1]:

  Prior to GnuTLS 3.6.0 for the ephemeral or anonymous
  Diffie-Hellman (DH) TLS ciphersuites the application was
  required to generate or provide DH parameters. That is no
  longer necessary as GnuTLS utilizes DH parameters and
  negotiation from [RFC7919].

This allows us to:

  a) drop the code that's setting DH params,
  b) drop @dhParams member from _virNetTLSContext struct. and
  c) drop gnutls_dh_params_generate2() mock.

1: https://www.gnutls.org/manual/html_node/Parameter-generation.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agomeson: Require gnutls-3.6.0 or newer
Michal Privoznik [Wed, 29 Jun 2022 14:01:59 +0000 (16:01 +0200)]
meson: Require gnutls-3.6.0 or newer

Released almost 5 years ago, gnutls-3.6.0 brings some important
features (which are utilized in next commit). Hence, require that
version at least.

Per repology, currently shipped versions are:

                 RHEL-8: 3.6.16
                 RHEL-9: 3.7.3
              Debian 11: 3.7.1
              Debian 12: 3.7.6
     openSUSE Leap 15.3: 3.6.7
       Ubuntu LTS 20.04: 3.6.13
       Ubuntu LTS 22.04: 3.7.3
             FreeBSD 12: 3.7.6
              Fedora 34: 3.7.4
              Fedora 35: 3.7.6

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirnetdevbandwidthtest: Test QoS for OVS
Michal Privoznik [Tue, 28 Jun 2022 08:02:01 +0000 (10:02 +0200)]
virnetdevbandwidthtest: Test QoS for OVS

Ever since v7.6.0-rc1~235 we can use ovs-vsctl to set QoS instead
of tc. However, we don't have a test that's verifying generated
cmd line for ovs-vsctl.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agovirnetdevbandwidthtest: Reformat TC cmd line
Michal Privoznik [Tue, 28 Jun 2022 08:01:54 +0000 (10:01 +0200)]
virnetdevbandwidthtest: Reformat TC cmd line

Our coding style expects a long line to be broken into shorter
lines which are then aligned on the first character, for
instance:

  "some string that's broken "
  "into multiple lines"

However, one can argue that there are few cases where shifting
the alignment makes the code more readable. And this is the case
of expected cmd line for DO_TEST_SET() where a long cmd line can
be aligned on the arguments rather than the binary:

  TC " filter ..."
     " police ..."

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agovirnetdevbandwidthtest: Drop unused testMinimalStruct
Michal Privoznik [Tue, 28 Jun 2022 08:00:08 +0000 (10:00 +0200)]
virnetdevbandwidthtest: Drop unused testMinimalStruct

The last usage of the testMinimalStruct struct was removed in
v1.2.2-rc1~206 which forgot to remove the struct as well. Remove
it now.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agovirnetdevbandwidthtest: Drop unnecessary brackets
Michal Privoznik [Tue, 28 Jun 2022 06:41:43 +0000 (08:41 +0200)]
virnetdevbandwidthtest: Drop unnecessary brackets

Some cases that call DO_TEST_SET() macro wrap each argument in
curved brackets. This is unnecessary, drop the brackets.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemu_migration: Apply max-postcopy-bandwidth on post-copy resume
Jiri Denemark [Thu, 30 Jun 2022 10:52:38 +0000 (12:52 +0200)]
qemu_migration: Apply max-postcopy-bandwidth on post-copy resume

When resuming post-copy migration users may want to limit the bandwidth
used by the migration and use a value that is different from the one
specified when the migration was originally started.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu_migration: Pass migParams to qemuMigrationSrcResume
Jiri Denemark [Thu, 30 Jun 2022 10:51:55 +0000 (12:51 +0200)]
qemu_migration: Pass migParams to qemuMigrationSrcResume

So the we can apply selected migration parameters even when resuming
post-copy migration.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu_migration_params: Replace qemuMigrationParamTypes array
Jiri Denemark [Wed, 29 Jun 2022 13:12:20 +0000 (15:12 +0200)]
qemu_migration_params: Replace qemuMigrationParamTypes array

We will need to annotate individual parameters a bit more than just
noting their type. Let's introduce qemuMigrationParamInfo replacing
simple qemuMigrationParamTypes with an array of structs.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu: Pass migration flags to qemuMigrationParamsApply
Jiri Denemark [Wed, 29 Jun 2022 10:00:03 +0000 (12:00 +0200)]
qemu: Pass migration flags to qemuMigrationParamsApply

The flags will later be used to determine which parameters should
actually be applied.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu_migration: Avoid mem.hard_limit > 0 check
Jiri Denemark [Fri, 24 Jun 2022 14:26:06 +0000 (16:26 +0200)]
qemu_migration: Avoid mem.hard_limit > 0 check

My original commit v8.4.0-288-gf01fc4d119 accidentally forgot to fix
both instances of the same problem. While it fixed the destination side
of migration, the source one remained broken.

However, that commit was also wrong in saying the issue could have
caused unlimited memory locking to be allowed for QEMU when RDMA
migration was used. It could not, because the code would refuse to even
think about starting RDMA migration if hard_limit was not set. But
avoiding the "mem.hard_limit > 0" check is useful anyway.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoPost-release version bump to 8.6.0
Jiri Denemark [Fri, 1 Jul 2022 09:27:31 +0000 (11:27 +0200)]
Post-release version bump to 8.6.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoRelease of libvirt-8.5.0
Jiri Denemark [Fri, 1 Jul 2022 09:19:54 +0000 (11:19 +0200)]
Release of libvirt-8.5.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoqemu_hotplug: Don't skip cleanup in qemuDomainAttachNetDevice()
Michal Privoznik [Fri, 1 Jul 2022 07:03:28 +0000 (09:03 +0200)]
qemu_hotplug: Don't skip cleanup in qemuDomainAttachNetDevice()

Introduced in v8.4.0-rc1~183 but the first real problem
introduced in v8.4.0-rc1~170, there's a
qemuBuildInterfaceConnect() call inside of
qemuDomainAttachNetDevice(). If the former fails, then the
function is immediately returned from instead of jumping onto the
cleanup label. This is crucial, because at this point the domain
definition contains 'borrowed' net definition, which is then
freed, since an error was met. The domain definition is then left
with a dangling pointer which leads to all sorts of different
crashes.

Fixes: 29d022b1eb7b2330ed224a08509e6d3a5eeecc53
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2102009
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoAPI: Remove internal impl detail from VIR_DOMAIN_IOTHREAD_THREAD_POOL_{MIN,MAX} descr...
Michal Privoznik [Thu, 30 Jun 2022 06:32:49 +0000 (08:32 +0200)]
API: Remove internal impl detail from VIR_DOMAIN_IOTHREAD_THREAD_POOL_{MIN,MAX} description

When introducing VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN and
VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX typed parameters, I've made a
shortcut. Since at the monitor level these two are set in two
separate calls and minimum has to be always smaller than maximum
(or equal to it), it may happen that one of the values we want to
set violates this restriction. So I've put a little note in the
public API description warning users about this.

However, the proper solution is to have a logic that checks the
current values and based on that set either minimum or maximum
value first. But until we get there, remove that note from the
public API before it gets released.

Related: https://gitlab.com/libvirt/libvirt/-/issues/339
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agoNEWS: Mention 3 user-visible regressions fixed in this release
Peter Krempa [Wed, 29 Jun 2022 15:02:45 +0000 (17:02 +0200)]
NEWS: Mention 3 user-visible regressions fixed in this release

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoTranslated using Weblate (Korean)
김인수 [Thu, 30 Jun 2022 00:21:26 +0000 (02:21 +0200)]
Translated using Weblate (Korean)

Currently translated at 99.5% (10424 of 10472 strings)

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

Translated using Weblate (Korean)

Currently translated at 99.5% (10424 of 10472 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2 years agoUpdate translation files
Weblate [Thu, 30 Jun 2022 00:21:24 +0000 (02:21 +0200)]
Update translation files

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

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

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Thu, 30 Jun 2022 00:21:21 +0000 (02:21 +0200)]
Translated using Weblate (Swedish)

Currently translated at 37.5% (3942 of 10491 strings)

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

Translated using Weblate (Swedish)

Currently translated at 37.4% (3920 of 10472 strings)

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

Translated using Weblate (Swedish)

Currently translated at 37.3% (3901 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2 years agoqemucapabilitiestest: Update capabilities for the 7.1 release cycle on x86_64
Peter Krempa [Fri, 24 Jun 2022 09:03:07 +0000 (11:03 +0200)]
qemucapabilitiestest: Update capabilities for the 7.1 release cycle on x86_64

Update to v7.0.0-2187-g2a8835cb45

Notable changes:
    - VFU_CLIENT_HANGUP event added
    - query-stats and query-stats-schemas commands added
    - 'vduse-blk' block export export
    - 'loongarch64' arch added
    - added new qom types:
        - cxl-downstream
        - cxl-upstream
        - qio-channel-block
        - qio-channel-null
    - added smi-irq[0], smm-enabled, unnamed-gpio-out[0] properties for PIIX4_PM

    - removed:
        - piix3-ide-xen

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: virDomainMemoryDefValidate: Improve error message
Liu Yiding [Tue, 28 Jun 2022 03:53:35 +0000 (11:53 +0800)]
conf: virDomainMemoryDefValidate: Improve error message

An explicit limit would be more user friendly. Add the limit to error message.

Before this commit:
```
error: requested size must be smaller than or equal to @size
```

Now:
```
error: requested size must be smaller than or equal to @size (8388608KiB)
```

Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoNEWS: Document my contributions for the upcoming release
Michal Privoznik [Mon, 27 Jun 2022 07:52:15 +0000 (09:52 +0200)]
NEWS: Document my contributions for the upcoming release

There are couple of features/improvements/bugfixes I contributed
into the upcoming release. Include those worth mentioning in the
NEWS.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agopo: Refresh potfile for v8.5.0
Jiri Denemark [Mon, 27 Jun 2022 06:56:55 +0000 (08:56 +0200)]
po: Refresh potfile for v8.5.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Sat, 25 Jun 2022 08:18:52 +0000 (10:18 +0200)]
Translated using Weblate (Swedish)

Currently translated at 37.0% (3861 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2 years agoschema: Be more flexible for diskSourceNetworkProtocolPropsCommon
Jonathon Jongsma [Wed, 15 Jun 2022 16:29:47 +0000 (11:29 -0500)]
schema: Be more flexible for diskSourceNetworkProtocolPropsCommon

Add <interleave> to allow the subproperties to be specified in any
order.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agodocs: clarify 'readahead' and 'timeout' for disks
Jonathon Jongsma [Wed, 15 Jun 2022 16:21:58 +0000 (11:21 -0500)]
docs: clarify 'readahead' and 'timeout' for disks

Document the format of the 'readahead' and 'timeout' XML elements more
accurately.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu_migration: Implement VIR_MIGRATE_ZEROCOPY flag
Jiri Denemark [Wed, 22 Jun 2022 14:37:31 +0000 (16:37 +0200)]
qemu_migration: Implement VIR_MIGRATE_ZEROCOPY flag

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>