]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
3 years agobhyve: use g_auto in virBhyveProcessStop
Ján Tomko [Fri, 10 Dec 2021 17:31:03 +0000 (18:31 +0100)]
bhyve: use g_auto in virBhyveProcessStop

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agobhyve: use g_auto in virBhyveProcessStartImpl
Ján Tomko [Fri, 10 Dec 2021 17:29:18 +0000 (18:29 +0100)]
bhyve: use g_auto in virBhyveProcessStartImpl

Use g_auto and VIR_AUTOCLOSE where possible.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agobhyve: refactor bhyveConnectDomainXMLToNative
Ján Tomko [Fri, 10 Dec 2021 17:26:02 +0000 (18:26 +0100)]
bhyve: refactor bhyveConnectDomainXMLToNative

Use g_auto and remove the ret variable, as well as the cleanup label.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agobhyve: refactor bhyveProbeCapsFromHelp
Ján Tomko [Fri, 10 Dec 2021 16:41:56 +0000 (17:41 +0100)]
bhyve: refactor bhyveProbeCapsFromHelp

Use g_auto and remove the 'ret' variable, as well as the out label.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agobhyve: refactor bhyveProbeCapsDeviceHelper
Ján Tomko [Fri, 10 Dec 2021 16:41:56 +0000 (17:41 +0100)]
bhyve: refactor bhyveProbeCapsDeviceHelper

Use g_auto and remove the 'ret' variable, as well as the cleanup label.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agobhyve: refactor virBhyveProbeGrubCaps
Ján Tomko [Fri, 10 Dec 2021 16:39:57 +0000 (17:39 +0100)]
bhyve: refactor virBhyveProbeGrubCaps

Use g_auto and remove the 'ret' variable, as well as the cleanup label.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoNEWS: Document TCG features
Michal Privoznik [Thu, 2 Dec 2021 08:47:39 +0000 (09:47 +0100)]
NEWS: Document TCG features

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: Generate command line for tb-cache feature
Michal Privoznik [Thu, 4 Nov 2021 10:43:52 +0000 (11:43 +0100)]
qemu: Generate command line for tb-cache feature

Generating command line is pretty easy - just put tb-size=XXX
onto -accel tcg part. Note, that QEMU expects the size in MiB.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/229
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Tested-by: Kashyap Chamarthy <kchamart@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: Validate TCG feature is enabled only for TCG domains
Michal Privoznik [Tue, 30 Nov 2021 12:37:54 +0000 (13:37 +0100)]
qemu: Validate TCG feature is enabled only for TCG domains

After previous commit it's possible for domains to fine tune TCG
features (well, just one - tb-cache). Check that domain has TCG
enabled, otherwise the feature makes no sense.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoconf: Introduce TCG domain features
Michal Privoznik [Wed, 3 Nov 2021 12:15:41 +0000 (13:15 +0100)]
conf: Introduce TCG domain features

It may come handy to be able to tweak TCG options, in this
specific case the size of translation block cache size (tb-size).
Since we can expect more knobs to tweak let's put them under
common element, like this:

  <domain>
    <features>
      <tcg>
        <tb-cache unit='MiB'>128</tb-cache>
      </tcg>
    </features>
  </domain>

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Tested-by: Kashyap Chamarthy <kchamart@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoremote_driver: Implement virStreamInData() callback
Michal Privoznik [Mon, 6 Dec 2021 16:16:09 +0000 (17:16 +0100)]
remote_driver: Implement virStreamInData() callback

When using the monolithic daemon the driver for virStream is
always virFDStreamDrv and thus calling virStreamInData() results
in calling virFDStreamInData().

But things are different with split daemon, especially when a
client connects to one of hypervisor daemons (e.g. virtqemud) and
then lets the daemon connect to the storage daemon for
vol-upload/vol-download. Here, the hypervisor daemon acts like
both client and server. This is reflected by stream->driver
pointing to remoteStreamDrv, which doesn't have streamInData
callback implemented and thus vol-upload/vol-download with sparse
flag fails.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2026537
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agorpc: Introduce virNetClientStreamInData()
Michal Privoznik [Tue, 7 Dec 2021 13:04:35 +0000 (14:04 +0100)]
rpc: Introduce virNetClientStreamInData()

The aim of this function is to look at a virNetClientStream and
tell whether the incoming packet (if there's one) contains data
(type VIR_NET_STREAM) or a hole (type VIR_NET_STREAM_HOLE) and
how big the section is. This function will be called from the
remote driver in one of future commits.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agovirStreamInData: Allow callback to not rewind the stream
Michal Privoznik [Tue, 7 Dec 2021 13:43:33 +0000 (14:43 +0100)]
virStreamInData: Allow callback to not rewind the stream

So far, virStreamInData() is effectively a wrapper over
virFDStreamInData() which means it deals with files which can be
rewound (lseek()-ed) to whatever position we need. And in fact,
that's what virFDStreamInData() does - it makes sure that the FD
is left unchanged in terms of position in the file.  Skipping the
hole happens soon after - in daemonStreamHandleRead() when
virStreamSendHole() is called.

But this is about to change. Soon we will have another implementation
where we won't be dealing with FDs but virNetMessage queue and it will
be handy to pop message at the beginning of the queue. Implement and
document this new behavior.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoqemu: qemuBuildChardevCommand: use chrSourcePriv unconditionally
Ján Tomko [Mon, 13 Dec 2021 12:29:06 +0000 (13:29 +0100)]
qemu: qemuBuildChardevCommand: use chrSourcePriv unconditionally

In the QEMU driver, we allocate private source data unconditionally
for every chardev and the rest of the function just assumes it's there.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoRemove empty cleanup sections
Ján Tomko [Fri, 10 Dec 2021 15:21:59 +0000 (16:21 +0100)]
Remove empty cleanup sections

After recent cleanups, there are some pointless cleanup sections.

Clean them up.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agobhyve: bhyveConnectCompareCPU: remove cleanup label
Ján Tomko [Fri, 10 Dec 2021 15:12:59 +0000 (16:12 +0100)]
bhyve: bhyveConnectCompareCPU: remove cleanup label

Return the desired values directly and clean up the redundant
else branches.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agolxc: remove cleanup from lxcNodeGetSecurityModel
Ján Tomko [Fri, 10 Dec 2021 15:32:16 +0000 (16:32 +0100)]
lxc: remove cleanup from lxcNodeGetSecurityModel

Return the values directly.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agolxc: use g_auto for virLXCDriverGetConfig
Ján Tomko [Fri, 10 Dec 2021 13:56:46 +0000 (14:56 +0100)]
lxc: use g_auto for virLXCDriverGetConfig

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agolxc: define cleanup function for virLXCDriverConfig
Ján Tomko [Fri, 10 Dec 2021 13:51:38 +0000 (14:51 +0100)]
lxc: define cleanup function for virLXCDriverConfig

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoUse g_auto for stealing virCaps
Ján Tomko [Fri, 10 Dec 2021 14:07:13 +0000 (15:07 +0100)]
Use g_auto for stealing virCaps

Convert all the functions that generate virCaps to use g_auto
and g_steal_pointer.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoUse g_auto for freeing virCaps
Ján Tomko [Fri, 10 Dec 2021 14:04:07 +0000 (15:04 +0100)]
Use g_auto for freeing virCaps

Convert all the users who unref their virCaps object unconditionally.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agolxc: fix error value of lxcNodeGetSecurityModel
Ján Tomko [Fri, 10 Dec 2021 15:30:46 +0000 (16:30 +0100)]
lxc: fix error value of lxcNodeGetSecurityModel

When adding the ACL check and caps getter, we assumed that
the default return value is -1, not 0 as usual.

Fix the return value on error by assigning them explicitly.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonss: Use shared_library() for nss_libvirt_lib
Andrea Bolognani [Sat, 11 Dec 2021 00:10:40 +0000 (01:10 +0100)]
nss: Use shared_library() for nss_libvirt_lib

shared_module() is intended for shared objects that are
loaded at runtime using dlopen() whereas NSS plugins need to
be full-fledged shared libraries with, among other things, a
proper SONAME.

Meson seems to have become more strict about this recently,
because libnss_libvirt.so.2 gets a SONAME when I build it with
Meson 0.59.4 on Fedora 34 but doesn't when I use Meson 0.60.2
on Debian testing instead.

Either way, shared_library() was always the right function
to use for NSS plugins.

Fixes: 36780c931900555706fd6db9fc2ce2b4cabf9045
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuProcessPrepareHost: Create domain private dirs as early as possible
Michal Privoznik [Mon, 13 Dec 2021 11:17:14 +0000 (12:17 +0100)]
qemuProcessPrepareHost: Create domain private dirs as early as possible

As of ff024b60cc3 we are opening chardevs before starting QEMU.
However, we are also doing that before domain private directories
are created. This leaves us unable to create guest agent socket
which lives under priv->channelTargetDir.

While creating the dirs can be moved just before
qemuProcessPrepareHostBackendChardev() it's better to do it as
the very first step so that this kind of error is prevented in
future.

Fixes: ff024b60cc39d5d41b1e68728a00a47e103ec4dd
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoRevert "virt-ssh-helper: Add manual page"
Ján Tomko [Fri, 10 Dec 2021 22:07:48 +0000 (23:07 +0100)]
Revert "virt-ssh-helper: Add manual page"

This was pushed by mistake with incorrect claim of my R-b.

This reverts commit dadcd352604d9a4620a8a1d714e6324818cf9246.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agovirt-pki-query-dn: Add manual page
Andrea Bolognani [Thu, 9 Dec 2021 17:36:34 +0000 (18:36 +0100)]
virt-pki-query-dn: Add manual page

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirt-qemu-run: Improve manual page
Andrea Bolognani [Fri, 10 Dec 2021 10:05:54 +0000 (11:05 +0100)]
virt-qemu-run: Improve manual page

Specifically:

  * use the correct notation and markup for commands, options
    and arguments;
  * rename arguments meta-variables to be more descriptive;
  * sort options so that the most common ones come first;
  * use consistent vertical spacing;
  * fix a typo.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirt-qemu-run: Improve usage information
Andrea Bolognani [Fri, 10 Dec 2021 10:56:31 +0000 (11:56 +0100)]
virt-qemu-run: Improve usage information

Specifically, include non-option argument 'GUEST-XML-FILE'
in usage summary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirt-ssh-helper: Add manual page
Andrea Bolognani [Fri, 10 Dec 2021 14:56:29 +0000 (15:56 +0100)]
virt-ssh-helper: Add manual page

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirt-ssh-helper: Improve usage information
Andrea Bolognani [Fri, 10 Dec 2021 10:59:33 +0000 (11:59 +0100)]
virt-ssh-helper: Improve usage information

Specifically:

  * include non-option argument 'URI' in usage summary;
  * mention that it's an internal tool not meant to be
    called directly;
  * exit earlier if required arguments are absent.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirt-ssh-helper: Don't use optind
Andrea Bolognani [Fri, 10 Dec 2021 13:53:31 +0000 (14:53 +0100)]
virt-ssh-helper: Don't use optind

It's a getopt interface and we're not using getopt, at least
directly, so even though it works relying on it feels wrong.

GOption takes care of removing any trace of the arguments it
consumes from argc and argv, leaving behind only non-option
arguments, so we can just use those standard variables.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Enable unprivileged userfaultfd for post-copy migration
Jiri Denemark [Thu, 2 Dec 2021 14:43:27 +0000 (15:43 +0100)]
qemu: Enable unprivileged userfaultfd for post-copy migration

Userfaultfd is by default allowed only for privileged processes. Since
libvirt runs QEMU unprivileged, we need to enable unprivileged access to
userfaultfd to enable post-copy migration.

https://bugzilla.redhat.com/show_bug.cgi?id=1945420

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu: command: Use 'qemuBuildChrChardevCommand' to build TPM backend
Peter Krempa [Fri, 5 Nov 2021 16:12:37 +0000 (17:12 +0100)]
qemu: command: Use 'qemuBuildChrChardevCommand' to build TPM backend

Since the backend of the TPM is a chardev we can use the common helper
to instantiate it.

This commit also ensures proper ordering so that the backend chardev is
formatted before it's being referenced.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Implement chardev source setup for tpm
Peter Krempa [Wed, 8 Dec 2021 09:07:44 +0000 (10:07 +0100)]
qemu: Implement chardev source setup for tpm

Add handling to qemuDomainDeviceBackendChardevForeachOne and callbacks
so that we can later use 'qemuBuildChardevCommand' for TPM devices.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Use qemuBuildChrChardevCommand for vhost-user-gpu backend chardev
Peter Krempa [Fri, 5 Nov 2021 14:40:40 +0000 (15:40 +0100)]
qemu: Use qemuBuildChrChardevCommand for vhost-user-gpu backend chardev

Now that the API for qemuBuildChrChardevCommand is sane enough, we can
use it to centralize formatting of '-chardev' generally.

The 'virDomainVideoDef' doesn't use 'virDomainChrSourceDef' internally so
we create it for this occasion manually.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Use qemuBuildChrChardevCommand for virtiofs backend chardev
Peter Krempa [Fri, 5 Nov 2021 14:40:40 +0000 (15:40 +0100)]
qemu: Use qemuBuildChrChardevCommand for virtiofs backend chardev

Now that the API for qemuBuildChrChardevCommand is sane enough, we can
use it to centralize formatting of '-chardev' generally.

The 'virDomainFSDef' doesn't use 'virDomainChrSourceDef' internally so
we create it for this occasion manually.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Use qemuBuildChrChardevCommand for vhost-user disk backend
Peter Krempa [Thu, 4 Nov 2021 16:12:13 +0000 (17:12 +0100)]
qemu: Use qemuBuildChrChardevCommand for vhost-user disk backend

Now that the API for qemuBuildChrChardevCommand is sane enough, we can
use it to centralize formatting of '-chardev' generally.

For virtiofs we don't have a centrally stored chardev source so we
allocate one inline for temporary use.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Implement chardev source setup for disk
Peter Krempa [Wed, 8 Dec 2021 09:07:44 +0000 (10:07 +0100)]
qemu: Implement chardev source setup for disk

Add handling to qemuDomainDeviceBackendChardevForeachOne and callbacks
so that we can later use 'qemuBuildChardevCommand' for vhost-user disks
instead of a custom formatter.

Since we don't pass the FD for the vhost-user connection to qemu all of
the setup can be skipped.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuBuildChardevCommand: Remove unused 'cfg' parameter
Peter Krempa [Mon, 22 Nov 2021 13:46:24 +0000 (14:46 +0100)]
qemuBuildChardevCommand: Remove unused 'cfg' parameter

Now that the parameter is unused we can remove it as well as from each
caller that doesn't need it any more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Store TLS config options for chardevs in qemuDomainChrSourcePrivate
Peter Krempa [Mon, 22 Nov 2021 13:41:23 +0000 (14:41 +0100)]
qemu: Store TLS config options for chardevs in qemuDomainChrSourcePrivate

When setting up TLS options from config in qemuDomainPrepareChardevSourceOne
we can also extract the x509 certificate path and default tlsVerify
setting so that 'qemuBuildChardevCommand' doesn't need to access the
config object any more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuBuildChardevCommand: Split creation of the command and setup of other objects
Peter Krempa [Fri, 19 Nov 2021 16:35:21 +0000 (17:35 +0100)]
qemuBuildChardevCommand: Split creation of the command and setup of other objects

Completely seprate the creation of the commandline string from the setup
of other objects instantiated on the commandline.

'qemuBuildChardevCommand' will aggregate the setup of individual
parameters such as -add-fd and setup of TLS and the -chardev parameter
itself while the code formatting the commandline will be moved into
qemuBuildChardevStr.

'fdset' names are then stored in qemuDomainChrSourcePrivate.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuBuildChardevCommand: Don't prefix alias
Peter Krempa [Fri, 5 Nov 2021 14:28:43 +0000 (15:28 +0100)]
qemuBuildChardevCommand: Don't prefix alias

Make the callers construct the alias for the chardev so that the
function can be used also for code paths which use a different
convention.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuBuildChardevCommand: Move earlier
Peter Krempa [Thu, 4 Nov 2021 16:04:37 +0000 (17:04 +0100)]
qemuBuildChardevCommand: Move earlier

Make it accessible sooner inside qemu_command.c

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuBuildChrChardevStr: Directly generate command line
Peter Krempa [Thu, 4 Nov 2021 12:59:47 +0000 (13:59 +0100)]
qemuBuildChrChardevStr: Directly generate command line

'qemuBuildChrChardevStr' used a hybrid approach where some arguments
were directly added to '@cmd' while the commandline itself was returned
as a string.

This patch renames qemuBuildChrChardevStr to qemuBuildChardevCommand
and adds the argument directly to @cmd inside the function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuBuildConsoleCommandLine: Remove identical code
Peter Krempa [Thu, 4 Nov 2021 13:12:05 +0000 (14:12 +0100)]
qemuBuildConsoleCommandLine: Remove identical code

Unify the cases for SCLP/SCLPLM/VIRTIO consoles as the code is
identical.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Add _LATEST version for 'name-escape' case
Peter Krempa [Mon, 15 Nov 2021 16:00:56 +0000 (17:00 +0100)]
qemuxml2argvtest: Add _LATEST version for 'name-escape' case

It was impossible to use _LATEST when commit d7c814f7f75 was modernizing
the cases as improper separation in the code caused that files were
created in the host during the testsuite run.

Now that the host manipulation when instantiating chardevs is separated
we can add the missing version.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Add DO_TEST_CAPS_LATEST versions for all character device tests
Peter Krempa [Tue, 26 Oct 2021 12:38:41 +0000 (14:38 +0200)]
qemuxml2argvtest: Add DO_TEST_CAPS_LATEST versions for all character device tests

Now that the test cases won't cause host modification we can add the
contemporary versions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuBuildChrChardevStr: Remove unused arguments and clean up callers
Peter Krempa [Thu, 4 Nov 2021 09:51:34 +0000 (10:51 +0100)]
qemuBuildChrChardevStr: Remove unused arguments and clean up callers

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuBuildChrChardevStr: Remove 'cdevflags' argument
Peter Krempa [Wed, 3 Nov 2021 15:42:31 +0000 (16:42 +0100)]
qemuBuildChrChardevStr: Remove 'cdevflags' argument

The argument and corresponding enum are not used any more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Store chardev 'wait' flag in chardev source private data
Peter Krempa [Wed, 3 Nov 2021 13:12:16 +0000 (14:12 +0100)]
qemu: Store chardev 'wait' flag in chardev source private data

We have just one case when we wish to wait for incomming connections for
a listening socket and that is for vhost-user network devices.

Passing this via a flag to qemuBuildChrChardevStr is unwieldy. Add a
field to qemuDomainChrSourcePrivate and populate it for our special
case inside of qemuDomainPrepareChardevSourceOne.

Since we wait for incomming connections only on startup of a new VM we
also need to pass in a flag whether qemuDomainPrepareChardevSourceOne
is called on a new start or on hotplug.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: domain: Refactor chardev definition preparing
Peter Krempa [Thu, 18 Nov 2021 14:16:20 +0000 (15:16 +0100)]
qemu: domain: Refactor chardev definition preparing

Use the qemuDomainDeviceBackendChardevForeach helper to iterate all
eligible structs and convert the setup of the TLS defaults from the
config.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: command: remove the unused 'chardevStdioLogd' argument/variable
Peter Krempa [Wed, 3 Nov 2021 12:59:41 +0000 (13:59 +0100)]
qemu: command: remove the unused 'chardevStdioLogd' argument/variable

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: command: Remove unused QEMU_BUILD_CHARDEV_FILE_LOGD and QEMU_BUILD_CHARDEV_UNIX...
Peter Krempa [Wed, 3 Nov 2021 12:24:24 +0000 (13:24 +0100)]
qemu: command: Remove unused QEMU_BUILD_CHARDEV_FILE_LOGD and QEMU_BUILD_CHARDEV_UNIX_FD_PASS

'qemuBuildChrChardevStr' doesn't use these flags any more. Stop passing
them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Move creation and opening of chardev backend FDs to host prepare step
Peter Krempa [Mon, 25 Oct 2021 10:42:16 +0000 (12:42 +0200)]
qemu: Move creation and opening of chardev backend FDs to host prepare step

The opening of files for FD passing for a chardev backend was
historically done in the function which is formatting the commandline.

This has multiple problems. Firstly the function takes a lot of
parameters which need to be passed through the commandline formatters.
This made the 'qemuBuildChrChardevStr' extremely unappealing to the
extent that we have multiple other custom formatters in places which
didn't really want to use the function.

Additionally the function is also creating files in the host in certain
configurations which is wrong for a commandline formatter to do. This
meant that e.g. not all chardev test cases can be converted to use
DO_TEST_CAPS_LATEST as we attempt to use such code path and attempt to
create files outside of the test directory.

This patch moves the opening of the filedescriptors from
'qemuBuildChrChardevFileStr' into a new helper
'qemuProcessPrepareHostBackendChardevOne' which is called using
'qemuDomainDeviceBackendChardevForeach'.

To preserve test behaviour we also have another instance
'testPrepareHostBackendChardevOne' which is populating mock
filedescriptors.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: domain: Introduce helpers for initializing chardev backend of devices
Peter Krempa [Tue, 2 Nov 2021 13:15:58 +0000 (14:15 +0100)]
qemu: domain: Introduce helpers for initializing chardev backend of devices

Introduce qemuDomainDeviceBackendChardevForeach(One) which calls the
callback if either given device has a chardev backend or for all chardev
backends of all devices.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirDomainDeviceInfoIterateFlags: Export the symbol
Peter Krempa [Tue, 2 Nov 2021 13:15:10 +0000 (14:15 +0100)]
virDomainDeviceInfoIterateFlags: Export the symbol

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirHostCPUGetInfoPopulateLinux: Use automatic memory freeing for virBitmap
Peter Krempa [Tue, 7 Dec 2021 15:34:00 +0000 (16:34 +0100)]
virHostCPUGetInfoPopulateLinux: Use automatic memory freeing for virBitmap

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirt-host-validate-qemu: Use automatic memory freeing for virBitmap
Peter Krempa [Tue, 7 Dec 2021 15:34:00 +0000 (16:34 +0100)]
virt-host-validate-qemu: Use automatic memory freeing for virBitmap

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirt-host-validate-common: Use automatic memory freeing for virBitmap
Peter Krempa [Tue, 7 Dec 2021 15:34:00 +0000 (16:34 +0100)]
virt-host-validate-common: Use automatic memory freeing for virBitmap

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirLXCControllerSetup(Resource|Cgroup)Limits: Refactor cleanup
Peter Krempa [Tue, 7 Dec 2021 15:35:24 +0000 (16:35 +0100)]
virLXCControllerSetup(Resource|Cgroup)Limits: Refactor cleanup

Remove the pointless cleanup sections.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxc_controller: Use automatic memory freeing for virBitmap
Peter Krempa [Tue, 7 Dec 2021 15:34:00 +0000 (16:34 +0100)]
lxc_controller: Use automatic memory freeing for virBitmap

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolibxlDomainGetNumaParameters: Don't clear a freshly allocated bitmap
Peter Krempa [Tue, 7 Dec 2021 15:18:24 +0000 (16:18 +0100)]
libxlDomainGetNumaParameters: Don't clear a freshly allocated bitmap

The bitmap is allocated just above the explicit clear, so it's already
empty.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolibxl_driver: Use automatic memory freeing for virBitmap
Peter Krempa [Tue, 7 Dec 2021 15:17:38 +0000 (16:17 +0100)]
libxl_driver: Use automatic memory freeing for virBitmap

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolxcSetCpusetTune: Refactor memory clearing
Peter Krempa [Tue, 7 Dec 2021 15:12:34 +0000 (16:12 +0100)]
lxcSetCpusetTune: Refactor memory clearing

Use automatic memory clearing for virBitmap and remove a reuse of a
temporary string.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotest_driver: Use automatic memory freeing for temporary virBitmaps
Peter Krempa [Tue, 7 Dec 2021 15:08:07 +0000 (16:08 +0100)]
test_driver: Use automatic memory freeing for temporary virBitmaps

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoutil: bitmap: Unify parsing of bitmaps
Peter Krempa [Mon, 6 Dec 2021 15:28:44 +0000 (16:28 +0100)]
util: bitmap: Unify parsing of bitmaps

There were two separate instances of string->virBitmap code:
virBitmapParseInternal and virBitmapParseUnlimited.

By adding a flag to switch to expanding APIs we can merge the two
implementations into one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirBitmapParseInternal: Allocate the bitmap in the caller
Peter Krempa [Mon, 6 Dec 2021 15:18:57 +0000 (16:18 +0100)]
virBitmapParseInternal: Allocate the bitmap in the caller

In order to prepare for reuse of the function, move the allocation of
the bitmap to the caller.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirBitmapParseSeparator: Remove separator parsing capability
Peter Krempa [Mon, 6 Dec 2021 15:16:18 +0000 (16:16 +0100)]
virBitmapParseSeparator: Remove separator parsing capability

Since the feature is not needed remove it and remove the function to
virBitmapParseInternal.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirBitmapSetBitExpand: Remove return value
Peter Krempa [Mon, 6 Dec 2021 14:55:46 +0000 (15:55 +0100)]
virBitmapSetBitExpand: Remove return value

The function can't fail at this point. Remove the return value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirBitmapClearBitExpand: Remove return value
Peter Krempa [Mon, 6 Dec 2021 14:55:46 +0000 (15:55 +0100)]
virBitmapClearBitExpand: Remove return value

The function can't fail at this point. Remove the return value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirBitmapUnion: Remove return value
Peter Krempa [Mon, 6 Dec 2021 14:55:46 +0000 (15:55 +0100)]
virBitmapUnion: Remove return value

The function can't fail at this point. Remove the return value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirBitmapExpand: Remove return value
Peter Krempa [Mon, 6 Dec 2021 14:53:27 +0000 (15:53 +0100)]
virBitmapExpand: Remove return value

There's nothing that can fail in the function. Remove the return value
and adjust callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoutil: bitmap: Unexport 'virBitmapParseSeparator'
Peter Krempa [Mon, 6 Dec 2021 14:47:00 +0000 (15:47 +0100)]
util: bitmap: Unexport 'virBitmapParseSeparator'

The function isn't used besides tests. Since the separator parsing
capability is trivial we can keep it in place and just unexport it for
now.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotest_virCapabilitiesGetCpusForNodemask: Refactor cleanup
Peter Krempa [Tue, 7 Dec 2021 16:22:26 +0000 (17:22 +0100)]
test_virCapabilitiesGetCpusForNodemask: Refactor cleanup

Use automatic memory freeing for the temporary bitmap and remove the
pointless 'cleanup' section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirnumamock: Use automatic memory freeing for virBitmap
Peter Krempa [Mon, 6 Dec 2021 13:10:40 +0000 (14:10 +0100)]
virnumamock: Use automatic memory freeing for virBitmap

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirshParseCPUList: Refactor cleanup
Peter Krempa [Tue, 7 Dec 2021 16:22:26 +0000 (17:22 +0100)]
virshParseCPUList: Refactor cleanup

Use automatic memory freeing for the temporary bitmap and remove the
pointless 'cleanup' section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirCgroupGetPercpuStats: Refactor cleanup
Peter Krempa [Tue, 7 Dec 2021 16:22:26 +0000 (17:22 +0100)]
virCgroupGetPercpuStats: Refactor cleanup

Use automatic memory freeing for the temporary bitmap and remove the
pointless 'cleanup' section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirHostCPUParseNode: Use automatic memory freeing for virBitmap
Peter Krempa [Mon, 6 Dec 2021 12:21:37 +0000 (13:21 +0100)]
virHostCPUParseNode: Use automatic memory freeing for virBitmap

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirHostCPUHasValidSubcoreConfiguration: Refactor cleanup
Peter Krempa [Tue, 7 Dec 2021 16:22:26 +0000 (17:22 +0100)]
virHostCPUHasValidSubcoreConfiguration: Refactor cleanup

Use automatic memory freeing for the temporary bitmap and remove the
pointless 'cleanup' section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirHostCPUCountThreadSiblings: Refactor cleanup
Peter Krempa [Tue, 7 Dec 2021 16:22:26 +0000 (17:22 +0100)]
virHostCPUCountThreadSiblings: Refactor cleanup

Use automatic memory freeing for the temporary bitmap and remove the
pointless 'cleanup' section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuSnapshotCreateInactiveExternal: Automatically free temporary variables
Peter Krempa [Tue, 7 Dec 2021 16:24:48 +0000 (17:24 +0100)]
qemuSnapshotCreateInactiveExternal: Automatically free temporary variables

Automatically free 'cmd' and 'created' by moving them to the appropriate
scopes.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuProcessValidateHotpluggableVcpus: Refactor cleanup
Peter Krempa [Tue, 7 Dec 2021 16:22:26 +0000 (17:22 +0100)]
qemuProcessValidateHotpluggableVcpus: Refactor cleanup

Use automatic memory freeing for the temporary bitmap and remove the
pointless 'cleanup' section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuDomainSetVcpuInternal: Refactor cleanup
Peter Krempa [Tue, 7 Dec 2021 16:22:26 +0000 (17:22 +0100)]
qemuDomainSetVcpuInternal: Refactor cleanup

Use automatic memory freeing for the temporary bitmap and remove the
pointless 'cleanup' section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuDomainSetVcpusInternal: Refactor cleanup
Peter Krempa [Tue, 7 Dec 2021 16:22:26 +0000 (17:22 +0100)]
qemuDomainSetVcpusInternal: Refactor cleanup

Use automatic memory freeing for the temporary bitmap and remove the
pointless 'cleanup' section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuDomainSelectHotplugVcpuEntities: Refactor cleanup
Peter Krempa [Tue, 7 Dec 2021 16:22:26 +0000 (17:22 +0100)]
qemuDomainSelectHotplugVcpuEntities: Refactor cleanup

Use automatic memory freeing for the 'ret' bitmap and remove the
pointless 'cleanup' section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: driver: Automatically free temporary virBitmap-s
Peter Krempa [Tue, 7 Dec 2021 16:21:17 +0000 (17:21 +0100)]
qemu: driver: Automatically free temporary virBitmap-s

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuDomainAssignMemorySlots: Refactor cleanup
Peter Krempa [Tue, 7 Dec 2021 16:20:46 +0000 (17:20 +0100)]
qemuDomainAssignMemorySlots: Refactor cleanup

Automatically free the 'slotmap' bitmap and get rid of the cleanup
section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirDomainDriverGetIOThreadsConfig: Automatically free virBitmap
Peter Krempa [Tue, 7 Dec 2021 16:18:46 +0000 (17:18 +0100)]
virDomainDriverGetIOThreadsConfig: Automatically free virBitmap

Use g_autoptr for the temp bitmap. To achieve this the variable must be
moved down to the appropriate scope.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirDomainNumatuneParseXML: Refactor cleanup
Peter Krempa [Tue, 7 Dec 2021 16:17:13 +0000 (17:17 +0100)]
virDomainNumatuneParseXML: Refactor cleanup

Use automatic memory clearing for the temporary strings and bitmap and
remove the cleanup section. There are multiple temporary strings added
so that we don't reuse one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirDomainSchedulerParse: Refactor cleanup
Peter Krempa [Tue, 7 Dec 2021 16:16:14 +0000 (17:16 +0100)]
virDomainSchedulerParse: Refactor cleanup

Automatically free the 'ret' temporary bitmap and get rid of the cleanup
section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: capabilities: Clean up freeing of virBitmap
Peter Krempa [Tue, 7 Dec 2021 16:15:18 +0000 (17:15 +0100)]
conf: capabilities: Clean up freeing of virBitmap

Use automatic freeing where possible and use g_clear_pointer instead of
manual NULL-ing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirCapabilitiesInitCaches: Refactor freeing of temporary variables
Peter Krempa [Tue, 7 Dec 2021 16:13:50 +0000 (17:13 +0100)]
virCapabilitiesInitCaches: Refactor freeing of temporary variables

Move the 'path' and 'type' variables down to the appropriate block and
use automatic freeing for them as well as the temporary virBitmap.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoRevert "lxc: controller: Fix container launch on cgroup v1"
Michal Privoznik [Fri, 10 Dec 2021 12:46:54 +0000 (13:46 +0100)]
Revert "lxc: controller: Fix container launch on cgroup v1"

Unfortunately, this fix breakes machinectl in a very nasty way,
for instance 'machinectl shell' drops into the host shell. It's
worse than being unable to start a container with CGroupsV1.

Revert until a proper fix is figured out.

This reverts commit 1b9ce05ce241a581d4e80228c92ceb0266f21f94.

References: https://gitlab.com/libvirt/libvirt/-/issues/182
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoremote: Avoid crash in remoteSplitURIScheme()
Andrea Bolognani [Fri, 10 Dec 2021 09:54:54 +0000 (10:54 +0100)]
remote: Avoid crash in remoteSplitURIScheme()

We need to make sure the URI scheme is present before passing
it to strchr(), otherwise we're going to get

  $ virt-ssh-helper foo
  Segmentation fault (core dumped)

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoRevert "qemu: Avoid crash in qemuStateShutdownPrepare() and qemuStateShutdownWait()"
Michal Privoznik [Thu, 9 Dec 2021 14:29:27 +0000 (15:29 +0100)]
Revert "qemu: Avoid crash in qemuStateShutdownPrepare() and qemuStateShutdownWait()"

This reverts commit 69977ff10560a80bcf5bf93f1a3f819a2d1623ca.

After previous commit it's no longer possible that QEMU driver is
not initialized in qemuStateShutdownPrepare() nor
qemuStateShutdownWait().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoremote_daemon: Set shutdown callbacks only after init is done
Michal Privoznik [Thu, 9 Dec 2021 14:29:43 +0000 (15:29 +0100)]
remote_daemon: Set shutdown callbacks only after init is done

The initialization of drivers happens in a separate thread.
However, the main thread continues initialization and sets
shutdown callbacks (virStateShutdownPrepare() and
virStateShutdownWait()) even though the driver init thread is
still running. This is dangerous because if the daemon decides to
quit early (e.g. because SIGINT was delivered) the
shutdownPrepare and shutdownWait callback are called over
partially init drivers.

Set callbacks only after all drivers were initialized.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/218
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2027400

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu_monitor_json.h: Unify header formatting
Peter Krempa [Thu, 9 Dec 2021 16:34:46 +0000 (17:34 +0100)]
qemu_monitor_json.h: Unify header formatting

Use the modern style and fix all offenders since new functions were
already using the contemporary style.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuValidateDomainDeviceDefDiskFrontend: Aggregate disk iomode validation
Peter Krempa [Tue, 7 Dec 2021 12:51:00 +0000 (13:51 +0100)]
qemuValidateDomainDeviceDefDiskFrontend: Aggregate disk iomode validation

Move the two checks under a common block.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuValidateDomainDeviceDefDiskFrontend: Fix error message if io='native' is unsupported
Peter Krempa [Tue, 7 Dec 2021 12:53:30 +0000 (13:53 +0100)]
qemuValidateDomainDeviceDefDiskFrontend: Fix error message if io='native' is unsupported

The error is a hard error, so the part about fallback doesn't make
sense. Spell the attribute the same way as it's in XML.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Update more links to point to the new Go modules
Andrea Bolognani [Thu, 9 Dec 2021 11:15:49 +0000 (12:15 +0100)]
docs: Update more links to point to the new Go modules

A couple of links were still pointing to the obsolete Go
packages instead of the current module-aware ones.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>