]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
3 years agoqemuxml2argvdata: Use proper arch and emulator for x86 real capability tests
Peter Krempa [Tue, 4 Jan 2022 15:36:46 +0000 (16:36 +0100)]
qemuxml2argvdata: Use proper arch and emulator for x86 real capability tests

Upcoming patches will modify how we populate the capability cache in
tests to be more saner. This also means that the emulator binary and
architecture used in the test files using real capabilities must match
what the real capabilities have.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotestutilsqemu: Remove unused fake-caps x86 machine types
Peter Krempa [Wed, 5 Jan 2022 08:21:14 +0000 (09:21 +0100)]
testutilsqemu: Remove unused fake-caps x86 machine types

None of our tests reference 'isapc', and 'pc-i440fx-2.6'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agosecurityselinuxlabeldata: Purge unneeded versioned machine type
Peter Krempa [Thu, 6 Jan 2022 09:03:42 +0000 (10:03 +0100)]
securityselinuxlabeldata: Purge unneeded versioned machine type

Use 'pc' instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuhotplugtestdomains: Remove unnecessary use of versioned pc machine types
Peter Krempa [Wed, 5 Jan 2022 18:34:32 +0000 (19:34 +0100)]
qemuhotplugtestdomains: Remove unnecessary use of versioned pc machine types

The specific machine type is not important for the test. We can use 'pc'
instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: qemuxml2argvdata: Purge versioned i440fx machine types from fake-caps tests
Peter Krempa [Wed, 5 Jan 2022 10:52:04 +0000 (11:52 +0100)]
tests: qemuxml2argvdata: Purge versioned i440fx machine types from fake-caps tests

Use the 'pc' alias for them as it's equivalent.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2(argv|xml)test: Unify usage of DO_TEST_CAPS_LATEST
Peter Krempa [Wed, 5 Jan 2022 09:23:42 +0000 (10:23 +0100)]
qemuxml2(argv|xml)test: Unify usage of DO_TEST_CAPS_LATEST

The qemuxml2argv invocation of some tests used DO_TEST_CAPS_LATEST while
the qemuxml2xmltest invocation uses fake caps. Unify them on
DO_TEST_CAPS_LATEST.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2(argv|xml)test: Enable 'controller-usb-order' for qemuxml2argv and convert...
Peter Krempa [Wed, 5 Jan 2022 12:01:10 +0000 (13:01 +0100)]
qemuxml2(argv|xml)test: Enable 'controller-usb-order' for qemuxml2argv and convert it to latest caps

Since introduction in fc03eb53c0bf3f654 there wasn't a qemuxml2argv
version. As we are touching the files convert them to
DO_TEST_CAPS_LATEST directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2xmltest: Replace 'interface-server' by 'net-server' test case
Peter Krempa [Wed, 5 Jan 2022 11:35:40 +0000 (12:35 +0100)]
qemuxml2xmltest: Replace 'interface-server' by 'net-server' test case

According to commit 52222568490 the test case was added to verify that
the '<address>' element is covered by the schema. The test was not
registered for qemuxml2argvtest though. We can use 'net-server' instead
as it has the same type. On the other hand that one was not registered
for qemuxml2xmltest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: qemuxml2argvdata: Remove specific q35 machine types from fake-caps tests
Peter Krempa [Wed, 5 Jan 2022 09:19:36 +0000 (10:19 +0100)]
tests: qemuxml2argvdata: Remove specific q35 machine types from fake-caps tests

Use q35 instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: qemuxml2argvdata: Remove use of 'pc-1.0' and 'pc-1.2' machine types
Peter Krempa [Wed, 5 Jan 2022 08:28:31 +0000 (09:28 +0100)]
tests: qemuxml2argvdata: Remove use of 'pc-1.0' and 'pc-1.2' machine types

There's nothing special about the tests requiring to use very old
machine types. Most usage is cargo-culted from other tests. Switch all
the tests to use 'pc' instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotestutilsqemu: Remove unused non-x86 fake machine types
Peter Krempa [Tue, 4 Jan 2022 15:10:31 +0000 (16:10 +0100)]
testutilsqemu: Remove unused non-x86 fake machine types

For tests with fake capabilities we fill in a bunch of machine types
which the tests might use. For now there's a random collection of
machine types which are not actually used. Purge the unused ones for
non-x86 machines.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Remove redundant floppy controller tests
Peter Krempa [Wed, 5 Jan 2022 09:07:41 +0000 (10:07 +0100)]
qemuxml2argvtest: Remove redundant floppy controller tests

The two test cases were added to avoid regressions such as fixed in
17dff3584855e9. Nowadays the code is much simpler and any Q35 machine
will trigger the explicit FDC.

Remove the '2.11' machine type version and turn the '2.9' version into a
generic q35 machine.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuDomainNeedsFDC: Simplify and improve checking if a machine needs FDC
Peter Krempa [Wed, 5 Jan 2022 08:51:22 +0000 (09:51 +0100)]
qemuDomainNeedsFDC: Simplify and improve checking if a machine needs FDC

Commit c7f3a1f7870 turned qemuDomainMachineNeedsFDC() effectively into
qemuDomainIsQ35. Use it instead as it also matches the non-canonicalized
'q35'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuProcessPrepareQEMUCaps: Don't clear QEMU_CAPS_CHARDEV_FD_PASS_COMMANDLINE
Peter Krempa [Tue, 4 Jan 2022 14:13:45 +0000 (15:13 +0100)]
qemuProcessPrepareQEMUCaps: Don't clear QEMU_CAPS_CHARDEV_FD_PASS_COMMANDLINE

All the fd-passing setup of chardevs which this hack meant to disable
was moved to the host-preparation phase which is skipped for formatting
of non-real commandlines.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agochange return type of virURIParamAppend() to void type
Ani Sinha [Thu, 6 Jan 2022 17:07:55 +0000 (22:37 +0530)]
change return type of virURIParamAppend() to void type

virURIParamAppend() unconditionally returns 0. Simplify and make the return type
as void type.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoNEWS: Fix indentation
Andrea Bolognani [Fri, 7 Jan 2022 07:03:28 +0000 (08:03 +0100)]
NEWS: Fix indentation

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
3 years agoch_monitor: Get nicindexes in prep for cgroup mgmt
Vineeth Pillai [Fri, 10 Dec 2021 20:34:41 +0000 (20:34 +0000)]
ch_monitor: Get nicindexes in prep for cgroup mgmt

Signed-off-by: Vineeth Pillai <viremana@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoch_driver: domainGetVcpuPinInfo and nodeGetCPUMap
Vineeth Pillai [Fri, 10 Dec 2021 20:34:40 +0000 (20:34 +0000)]
ch_driver: domainGetVcpuPinInfo and nodeGetCPUMap

Add domainGetVcpuPinInfo and nodeGetCPUMap callbacks to ch driver

Signed-off-by: Vineeth Pillai <viremana@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoch_driver, ch_domain: vcpu info getter callbacks
Praveen K Paladugu [Fri, 10 Dec 2021 20:34:39 +0000 (20:34 +0000)]
ch_driver, ch_domain: vcpu info getter callbacks

Signed-off-by: Vineeth Pillai <viremana@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoch_domain: add methods to manage private vcpu data
Vineeth Pillai [Fri, 10 Dec 2021 20:34:38 +0000 (20:34 +0000)]
ch_domain: add methods to manage private vcpu data

Signed-off-by: Vineeth Pillai <viremana@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoch_domain: add virCHDomainGetMonitor helper method
Vineeth Pillai [Fri, 10 Dec 2021 20:34:37 +0000 (20:34 +0000)]
ch_domain: add virCHDomainGetMonitor helper method

Signed-off-by: Vineeth Pillai <viremana@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: Helper functions to get process info
Praveen K Paladugu [Fri, 10 Dec 2021 20:34:36 +0000 (20:34 +0000)]
util: Helper functions to get process info

Move qemuGetProcessInfo and qemuGetSchedInfo methods to util and share them
with ch driver.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoAdd VM info to improve error log message for qemu monitor
Rohit Kumar [Tue, 4 Jan 2022 12:43:11 +0000 (04:43 -0800)]
Add VM info to improve error log message for qemu monitor

This change adds the domain name in the error and debug logs during
monitor IO processing so that we may infer which VM experienced
errors such as IO or socket hangup. This may help in debugging
monitor IO errors.

Signed-off-by: Rohit Kumar <rohit.kumar3@nutanix.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: agent: remove all code around disabled DEBUG_IO/DEBUG_RAW_IO definitions
Ani Sinha [Tue, 4 Jan 2022 12:17:43 +0000 (17:47 +0530)]
qemu: agent: remove all code around disabled DEBUG_IO/DEBUG_RAW_IO definitions

DEBUG_IO and DEBUG_RAW_IO are disabled and hence the code #defined under them
are useless. Remove them.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: monitor: Remove disabled debug infrastructure
Peter Krempa [Mon, 3 Jan 2022 16:33:27 +0000 (17:33 +0100)]
qemu: monitor: Remove disabled debug infrastructure

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
3 years agoAccount for fact that virDomainDeviceDefCopy() does an inactive copy
Michal Privoznik [Tue, 4 Jan 2022 16:47:00 +0000 (17:47 +0100)]
Account for fact that virDomainDeviceDefCopy() does an inactive copy

In a few places (e.g. device attach/detach/update) we are given a
device XML, parse it but then need a copy of parsed data so that
the original can be passed to function handling the request over
inactive XML and the copy is then passed to function handling the
operation over live XML. Note, both functions consume passed
device on success, hence the need for copy.

The problem is in combination of how the copy is obtained and
where is passed. The copy is done by calling
virDomainDeviceDefCopy() which does only inactive copy, i.e. no
live information is copied over (e.g. no aliases).

Then, this copy (inactive XML effectively) is passed to function
handling live part of the operation (e.g.
qemuDomainUpdateDeviceLive()) and the definition containing all
the juicy, live bits is passed to function handling inactive part
of the operation (e.g. qemuDomainUpdateDeviceConfig()).

This is rather incorrect, and XML copies should be passed to
their respective functions.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2036895
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agoutil: fix prototype of virDaemonSetupLogging
Ján Tomko [Wed, 5 Jan 2022 15:32:28 +0000 (16:32 +0100)]
util: fix prototype of virDaemonSetupLogging

The commit that added error checking to this function
forgot to adjust the WIN32 stub.

Fixes: a873924e36b28c5b125621e35b32beb6b077bcc8
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoDo not print error in remote_daemon.c:main
Martin Kletzander [Mon, 20 Dec 2021 21:19:15 +0000 (22:19 +0100)]
Do not print error in remote_daemon.c:main

There is no need to do that since both fallible functions do that already.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoDispatch error in virInitialize
Martin Kletzander [Mon, 20 Dec 2021 20:55:07 +0000 (21:55 +0100)]
Dispatch error in virInitialize

Callers that already do this anyway can be cleaned up thanks to this and the one
that does not (daemon startup) gains the benefit of the error being printed to
standard error output changing:

LIBVIRT_LOG_OUTPUTS=1:invalid libvirtd
/home/nert/dev/libvirt/upstream/build/src/libvirtd: initialisation failed

into:

LIBVIRT_LOG_OUTPUTS=1:invalid libvirtd
libvirt:  error : invalid argument: Invalid destination 'invalid' for output '1:invalid'
/home/nert/dev/libvirt/upstream/build/src/libvirtd: initialisation failed

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoutil: Check for errors in virLogSetFromEnv
Martin Kletzander [Wed, 15 Dec 2021 15:34:16 +0000 (16:34 +0100)]
util: Check for errors in virLogSetFromEnv

And make callers check the return value as well.  This helps error out early for
invalid environment variables.

That is desirable because it could lead to deadlocks.  This can happen when
resetting logging after fork() reports translated errors because gettext
functions are not reentrant.  Well, it is not limited to resetting logging after
fork(), it can be any translation at that phase, but parsing environment
variables is easy to make fail on purpose to show the result, it can also happen
just due to a typo.

Before this commit it is possible to deadlock the daemon on startup
with something like:

LIBVIRT_LOG_FILTERS='1:*' LIBVIRT_LOG_OUTPUTS=1:stdout libvirtd

where filters are used to enable more logging and hence make the race less rare
and outputs are set to invalid

Combined with the previous patches this changes
the following from:

...
<deadlock>

to:

...
libvirtd: initialisation failed

The error message is improved in future commits and is also possible thanks to
this patch.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoExit on errors from virDaemonSetupLogging
Martin Kletzander [Wed, 15 Dec 2021 15:35:41 +0000 (16:35 +0100)]
Exit on errors from virDaemonSetupLogging

This prevents starting any daemons with improper logging settings.  This is
desirable on its own, but will be even more beneficial when more functions start
reporting errors and failing on them, coming up in following patches

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoutil: Initialize virLogMutex statically
Martin Kletzander [Wed, 15 Dec 2021 15:36:51 +0000 (16:36 +0100)]
util: Initialize virLogMutex statically

The only difference is that we are not going to be guaranteed that the mutex is
normal (as opposed to recursive, although there is no system known to me that
would default to recursive mutexes), but that was done only to find occasional
errors (during runtime, back in 2010, commit 336fd879c00b).  Functions using
this mutex are mostly stable and unchanging, and it makes the virLogOnceInit()
function only return 0 (or possibly abort in glib calls).  On top of that we can
assume that the virLogMutex is always initialized which enables us to be more
consistent in some early error reporting.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoutil: Report error in virLogSetDefaultOutputToFile
Martin Kletzander [Tue, 4 Jan 2022 11:10:54 +0000 (12:10 +0100)]
util: Report error in virLogSetDefaultOutputToFile

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoutil: Do not hide errors in virLogSetDefaultOutput
Martin Kletzander [Wed, 15 Dec 2021 15:37:39 +0000 (16:37 +0100)]
util: Do not hide errors in virLogSetDefaultOutput

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoutil: Report error in virLogParseDefaultPriority
Martin Kletzander [Wed, 15 Dec 2021 15:37:10 +0000 (16:37 +0100)]
util: Report error in virLogParseDefaultPriority

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoNEWS: Mention new virDomainSetLaunchSecurityState API
Jim Fehlig [Tue, 21 Dec 2021 02:58:06 +0000 (19:58 -0700)]
NEWS: Mention new virDomainSetLaunchSecurityState API

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agotools: Add domsetlaunchsecstate virsh command
Jim Fehlig [Wed, 15 Dec 2021 03:15:40 +0000 (20:15 -0700)]
tools: Add domsetlaunchsecstate virsh command

After attesting a domain with the help of domlaunchsecinfo,
domsetlaunchsecstate can be used to set a secret in the guest
domain's memory prior to running the vcpus.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu: Implement the virDomainSetLaunchSecurityState API
Jim Fehlig [Wed, 17 Nov 2021 01:21:19 +0000 (18:21 -0700)]
qemu: Implement the virDomainSetLaunchSecurityState API

Set a launch secret in guest memory using the sev-inject-launch-secret
QMP API. Only supported with qemu >= 6.0.0 and SEV-enabled guests in a
paused state.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu_capabilities: Introduce QEMU_CAPS_SEV_INJECT_LAUNCH_SECRET
Jim Fehlig [Tue, 21 Dec 2021 01:07:37 +0000 (18:07 -0700)]
qemu_capabilities: Introduce QEMU_CAPS_SEV_INJECT_LAUNCH_SECRET

The 'sev-inject-launch-secret' qmp command is only available with
qemu >= 6.0.0. Introduce a capability for sev-inject-launch-secret.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoremote: Add RPC support for the virDomainSetLaunchSecurityState API
Jim Fehlig [Tue, 16 Nov 2021 23:39:44 +0000 (16:39 -0700)]
remote: Add RPC support for the virDomainSetLaunchSecurityState API

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agolibvirt: Introduce virDomainSetLaunchSecurityState public API
Jim Fehlig [Tue, 9 Nov 2021 23:28:55 +0000 (16:28 -0700)]
libvirt: Introduce virDomainSetLaunchSecurityState public API

This API allows setting a launch secret within a guests's memory. The
launch secret is created by the guest owner after retrieving and
verifying the launch measurement with virDomainGetLaunchSecurityInfo.

The API uses virTypedParameter for input, allowing it to be expanded
to support other confidential computing technologies. In the case of
SEV, a basic guest launch workflow is described in the SEV API spec
in section "1.3.1 Launch"

https://www.amd.com/system/files/TechDocs/55766_SEV-KM_API_Specification.pdf

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoci: Refresh configuration
Andrea Bolognani [Tue, 4 Jan 2022 16:01:48 +0000 (17:01 +0100)]
ci: Refresh configuration

Notable changes:

  * drop parted and XFS headers.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Add entries for libxl changes during 8.0.0 development
Jim Fehlig [Mon, 3 Jan 2022 22:57:19 +0000 (15:57 -0700)]
NEWS: Add entries for libxl changes during 8.0.0 development

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agovirnetdevopenvswitch: Fix 'burst' value passed to ovs-vsctl
Michal Privoznik [Mon, 3 Jan 2022 15:24:58 +0000 (16:24 +0100)]
virnetdevopenvswitch: Fix 'burst' value passed to ovs-vsctl

As described in the previous commit, the units for 'burst' are
kibibytes and not kilobytes, i.e. multiples of 1024 not 1000.
Therefore, when constructing ovs-vsctl command the burst value
must be multiplied by 1024 and not just 1000. And because ovs
expects this size in bits the value has to be multiplied again by
8.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1510237#c26
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agodocs: Clarify 'burst' units for QoS
Michal Privoznik [Mon, 3 Jan 2022 14:56:43 +0000 (15:56 +0100)]
docs: Clarify 'burst' units for QoS

The burst attribute for bandwidth specifies how much bytes can be
transmitted in a single burst. Therefore, the unit is in
multiples of 1024 (thus kibibytes) not SI-like 1000. It has
always been like that.

The 'tc' output is still confusing though, for instance:

  # tc class add dev $DEV parent 1: classid 1:1 htb rate 1000kbps burst 2097152
  # tc class show dev vnet2
  class htb 1:1 root rate 8Mbit ceil 8Mbit burst 2Mb cburst 1600b

Please note that 2097152 = 2*1024*1024. Even the man page is
confusing. From tc(8):

  kb or k        Kilobytes
  mb or m        Megabytes

But I guess this is because 'tc' predates IEC standardisation of
binary multiples and thus can't change without breaking scripts
parsing its output.

And while at it, adjust _virNetDevBandwidthRate struct member
description, to make it obvious which members use SI/IEC units.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agodomain_conf: Use virXMLFormatElement*() more in virDomainDefFormatFeatures()
Michal Privoznik [Tue, 14 Dec 2021 12:54:44 +0000 (13:54 +0100)]
domain_conf: Use virXMLFormatElement*() more in virDomainDefFormatFeatures()

There are few places in virDomainDefFormatFeatures() which can
use virXMLFormatElement() or virXMLFormatElementEmpty() instead
of writing directly into the output buffer.

After this, there are still a lot of places left, but that is
much bigger task.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoqemuxml2xmloutdata: Turn kvm-features*.xml into symlinks
Michal Privoznik [Tue, 14 Dec 2021 11:28:34 +0000 (12:28 +0100)]
qemuxml2xmloutdata: Turn kvm-features*.xml into symlinks

There's no real difference between input and output XMLs for
kvm-features and kvm-features-off test cases. Do what we usually
do in such case - turn the output file into a symlink of the
input file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agodocs: Move font definitions with other CSS files
Andrea Bolognani [Tue, 21 Dec 2021 15:21:35 +0000 (16:21 +0100)]
docs: Move font definitions with other CSS files

We have a subdirectory specifically for CSS files now, so it makes
sense to have the stylesheet that defines fonts to be there too.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agodocs: Move all CSS files to a subdirectory
Andrea Bolognani [Tue, 21 Dec 2021 15:10:13 +0000 (16:10 +0100)]
docs: Move all CSS files to a subdirectory

This unclutters the top-level docs directory.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agodocs: Move all images to a subdirectory
Andrea Bolognani [Tue, 21 Dec 2021 11:11:25 +0000 (12:11 +0100)]
docs: Move all images to a subdirectory

This unclutters the top-level docs directory.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agodocs: Drop structures.svg
Andrea Bolognani [Tue, 21 Dec 2021 11:13:39 +0000 (12:13 +0100)]
docs: Drop structures.svg

It was introduced in ff4ede005567 but it doesn't seem to have
ever actually been used anywhere.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agospec: Drop BuildRequires on xfsprogs-devel
Andrea Bolognani [Tue, 28 Dec 2021 17:11:32 +0000 (18:11 +0100)]
spec: Drop BuildRequires on xfsprogs-devel

We no longer need its contents.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agomeson: Don't look for btrfs and xfs headers
Andrea Bolognani [Tue, 28 Dec 2021 18:08:08 +0000 (19:08 +0100)]
meson: Don't look for btrfs and xfs headers

We no longer use them anywhere.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agostorage: Use the FICLONE ioctl unconditionally on Linux
Andrea Bolognani [Tue, 28 Dec 2021 18:08:00 +0000 (19:08 +0100)]
storage: Use the FICLONE ioctl unconditionally on Linux

According to ioctl_ficlonerange(2)

  These ioctl operations [FICLONE and FICLONERANGE] first
  appeared in Linux 4.5. They were previously known as
  BTRFS_IOC_CLONE and BTRFS_IOC_CLONE_RANGE, and were private
  to Btrfs.

We no longer target any distro that comes with a kernel older
than 4.5, so we can stop looking for the btrfs and xfs
specific versions of the constant and just use the generic
version directly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agorpc: Require dtrace sources to be generated first
Michal Privoznik [Mon, 20 Dec 2021 11:02:41 +0000 (12:02 +0100)]
rpc: Require dtrace sources to be generated first

The virt_socket_lib is built from virnetsocket.c (among others).
But this file includes virprobe.h which includes libvirt_probes.h
which is a generated file. But this dependency is not recorded in
meson which may lead to a failed build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoconf: Make virDomainTPMDefFormat() return void
Michal Privoznik [Tue, 4 Jan 2022 07:57:47 +0000 (08:57 +0100)]
conf: Make virDomainTPMDefFormat() return void

The virDomainTPMDefFormat() function can't fail really. There's
no point in it returning an integer then. Make it return void and
fix both places which check for its retval.

And while at it, turn @def into a const pointer to make it
obvious the function does not modify passed struct.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemuxml2xmloutdata: Turn tpm-*.xml files into symlinks
Michal Privoznik [Tue, 4 Jan 2022 07:24:35 +0000 (08:24 +0100)]
qemuxml2xmloutdata: Turn tpm-*.xml files into symlinks

Make the tpm-*.xml files symlinks to their respective input XMLs
from qemuxml2argvdata/ directory. Neither of the XMLs relies on
autofill of any TPM data.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoconf: Rework <tpm/> formatting
Michal Privoznik [Tue, 4 Jan 2022 07:24:25 +0000 (08:24 +0100)]
conf: Rework <tpm/> formatting

The <tpm/> element formatting is handled in
virDomainTPMDefFormat() which uses the "old style" - appending
strings directly into the output buffer. With this, it's easy to
get conditions that tell when an element has ended wrong. In this
particular case, if both <encryption/> and <active_pcr_banks/>
are to be formatted the current code puts a stray '>' into the
output buffer, resulting in invalid XML.

Rewrite the function to use virXMLFormatElement() which is more
clever.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2016599#c15
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemuxml2xmltest: Introduce tpm-emulator-spapr test
Michal Privoznik [Tue, 4 Jan 2022 07:38:37 +0000 (08:38 +0100)]
qemuxml2xmltest: Introduce tpm-emulator-spapr test

We already have the input xml because of xml2arg test. However,
the corresponding xml2xml test case is missing. Make the expected
XML a symlink to the input XML and clean the latter up a bit.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoconf: Extend TPM ABI stability check for <active_pcr_banks/>
Michal Privoznik [Tue, 4 Jan 2022 08:26:08 +0000 (09:26 +0100)]
conf: Extend TPM ABI stability check for <active_pcr_banks/>

Changing <active_pcr_banks/> means changing the guest ABI and as
such must be prevented on both restoring from a file or
migration.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2035888
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoci: Refresh configuration
Andrea Bolognani [Mon, 3 Jan 2022 15:48:18 +0000 (16:48 +0100)]
ci: Refresh configuration

Notable changes:

  * drop libdbus and radvd;
  * add codespell.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
3 years agotests: Remove 'qemucapsfixreplies'
Peter Krempa [Wed, 22 Dec 2021 13:01:07 +0000 (14:01 +0100)]
tests: Remove 'qemucapsfixreplies'

The 'qemucapabilitiesnumbering' tool now replaces the role of this
script and provides way to programmatically modify the replies file on
top.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: Tool for programatic modification of qemucapabilitiesdata/*.replies
Peter Krempa [Wed, 7 Apr 2021 14:53:20 +0000 (16:53 +0200)]
tests: Tool for programatic modification of qemucapabilitiesdata/*.replies

The tool is assembled from individual bits used for tests and actual
capturing of the replies files. The tool ensures correct numbering and
formatting of entries.

In normal usage mode it masks as a test which validates formatting and
numbering of the tests/qemucapabilitiesdata/*.replies files. This tool
was actually used to produce commits 096ac87a1a46 and aa21615ccbc.

In case a manual modification of the replies file is needed the
'modify()' function provides a convenient way to do programatic
modification of the caps file.

As an example the modify() function has commented-out code which
provides a basic scaffold to do modifications along with a how-to.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemumonitortestutils: Extract parser for the monitor conversation dump file
Peter Krempa [Tue, 21 Dec 2021 13:51:26 +0000 (14:51 +0100)]
qemumonitortestutils: Extract parser for the monitor conversation dump file

Make the parser reusable by extracting it and making it parse into
command,reply tuples.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: qemumonitortestutils.h: Reformat header file
Peter Krempa [Tue, 21 Dec 2021 14:10:45 +0000 (15:10 +0100)]
tests: qemumonitortestutils.h: Reformat header file

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoutil: json: Introduce virJSONValueObjectReplaceValue
Peter Krempa [Mon, 20 Dec 2021 14:55:26 +0000 (15:55 +0100)]
util: json: Introduce virJSONValueObjectReplaceValue

The new helper replaces the 'value' part of the key-value tuple in an
object. The advantage of this new helper is that it preserves the
ordering of the key in the object when compared to a combination of
stealing the old key and adding a new value. This will be needed for a
new test/helper for validating and modifying qemu capabilities data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agomeson: Don't require the parted command at build time
Andrea Bolognani [Tue, 28 Dec 2021 10:47:56 +0000 (11:47 +0100)]
meson: Don't require the parted command at build time

We need libparted to be available at build time otherwise we
can't link against it; we don't, however, need the parted
command to be present until runtime and, just as is the case
for other commands, we already perform a lookup through the
virCommand API so making sure it's available at build time
is unnecessary.

This doesn't make any difference for platform such as Fedora
and CentOS, where both the library and the command are in the
same package, but others like Debian, Ubuntu and openSUSE
have separate packages for the two components and this change
means that we can install one less package at build time.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agospec: Drop BuildRequires on ZFS
Andrea Bolognani [Tue, 28 Dec 2021 15:58:32 +0000 (16:58 +0100)]
spec: Drop BuildRequires on ZFS

We're no longer performing build time detection.

Fixes: 506c3a39d6e645c8414c278ceaba97935f90cb95
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agovirnettlscontext: Don't pass static key length to gnutls_dh_params_generate2()
Michal Privoznik [Tue, 21 Dec 2021 09:04:21 +0000 (10:04 +0100)]
virnettlscontext: Don't pass static key length to gnutls_dh_params_generate2()

As encryption norms get more strict it's easy to fall on the
insecure side. For instance, so far we are generating 2048 bits
long prime for Diffie-Hellman keys. Some systems consider this
not long enough. While we may just keep increasing the value
passed to the corresponding gnutls_* function, that is not well
maintainable. Instead, we may do what's recommended in the
gnutls_* manpage. From gnutls_dh_params_generate2(3):

  It is recommended not to set the number of bits directly, but
  use gnutls_sec_param_to_pk_bits() instead.

Looking into the gnutls_sec_param_to_pk_bits() then [1], 2048
bits corresponds to parameter MEDIUM.

1: https://www.gnutls.org/manual/gnutls.html#tab_003akey_002dsizes

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirnettlscontext: Drop gnutls_dh_set_prime_bits()
Michal Privoznik [Tue, 21 Dec 2021 09:05:00 +0000 (10:05 +0100)]
virnettlscontext: Drop gnutls_dh_set_prime_bits()

According to the gnutls_dh_set_prime_bits() manpage:

  The function has no effect in server side.

Therefore, don't call it when creating server side context.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: virtimetest: Mention GLib version containing fix
Andrea Bolognani [Sat, 1 Jan 2022 18:50:21 +0000 (19:50 +0100)]
tests: virtimetest: Mention GLib version containing fix

We now know exactly which GLib version we need to depend on
for the workaround to no longer be necessary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: virtimetest: Skip more tests near year's end
Andrea Bolognani [Sat, 1 Jan 2022 18:39:40 +0000 (19:39 +0100)]
tests: virtimetest: Skip more tests near year's end

All of these are affected by the same issue as the ones that
we're already skipping during this specific time interval.

Suggested-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: virtimetest: Move comment
Andrea Bolognani [Sat, 1 Jan 2022 18:38:57 +0000 (19:38 +0100)]
tests: virtimetest: Move comment

Will keep things reasonable as we perform further code
movements.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agospec: Demote netcat to Recommends
Andrea Bolognani [Fri, 24 Dec 2021 09:56:04 +0000 (10:56 +0100)]
spec: Demote netcat to Recommends

It is only needed if compatibility with clients that have
libvirt < 6.9.0 is required, and can be uninstalled otherwise.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agodocs: Fix indentation in shell snippet
Andrea Bolognani [Fri, 24 Dec 2021 09:46:50 +0000 (10:46 +0100)]
docs: Fix indentation in shell snippet

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
3 years agospec: relocate pre script of daemon-driver-qemu
Olaf Hering [Tue, 21 Dec 2021 11:22:43 +0000 (12:22 +0100)]
spec: relocate pre script of daemon-driver-qemu

Reduce the delta in an upcoming change.
No change in behavior intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
3 years agospec: fix %preun of virtnetworkd
Olaf Hering [Tue, 21 Dec 2021 11:22:42 +0000 (12:22 +0100)]
spec: fix %preun of virtnetworkd

Fixes: 50eae3f8859c746aa474401b38902fa500f23fad
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
3 years agoci: Refresh dockerfiles
Peter Krempa [Wed, 22 Dec 2021 16:24:43 +0000 (17:24 +0100)]
ci: Refresh dockerfiles

Apart from some churn, the important is the removal of 'netcf-devel'
from the fedora rawhide container.

Update to state as of 174fe4999204afcae (libvirt-ci).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: Fix typo in comment
Tim Wiederhake [Mon, 20 Dec 2021 12:02:59 +0000 (13:02 +0100)]
qemu: Fix typo in comment

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoutil: virjson.h: Reformat headers to conform with new style
Peter Krempa [Mon, 20 Dec 2021 14:16:23 +0000 (15:16 +0100)]
util: virjson.h: Reformat headers to conform with new style

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoutil: json: Remove virJSONValueIsNull/virJSONValueObjectIsNull
Peter Krempa [Mon, 20 Dec 2021 14:17:40 +0000 (15:17 +0100)]
util: json: Remove virJSONValueIsNull/virJSONValueObjectIsNull

If needed 'virJSONValueIsNull' can be easily replaced by
'virJSONValueGetType(obj) == VIR_JSON_TYPE_NULL'.

'virJSONValueObjectIsNull' has confusing name because it checks that a
virJSONValue of OBJECT type has a key which is NULL, not that the object
itself is NULL. This can be replaced according to the needs e.g. by
virJSONValueObjectHasKey or the above check.

Both are unused.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoutil: json: Open-code only call of virJSONValueNewStringLen
Peter Krempa [Mon, 20 Dec 2021 13:56:13 +0000 (14:56 +0100)]
util: json: Open-code only call of virJSONValueNewStringLen

Replace the function by a call to virJSONValueNewString, when we copy
the string using g_strndup. Remove the unused helper.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoutil: json: Don't copy string in virJSONValueNewString
Peter Krempa [Mon, 20 Dec 2021 13:52:13 +0000 (14:52 +0100)]
util: json: Don't copy string in virJSONValueNewString

With 'g_strdup' not needing error handling we can ask callers to pass a
copy of the string which will be adopted by the JSON value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoReplace open coded virJSONValueArrayAppendString
Peter Krempa [Mon, 20 Dec 2021 13:41:03 +0000 (14:41 +0100)]
Replace open coded virJSONValueArrayAppendString

In two instances we've created a string virJSONValue just to append it
to the array. Replace it by use of the virJSONValueArrayAppendString
helper.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoqemuBlockStorageSourceGetRBDProps: Simplify generation of auth modes
Peter Krempa [Mon, 20 Dec 2021 13:22:06 +0000 (14:22 +0100)]
qemuBlockStorageSourceGetRBDProps: Simplify generation of auth modes

The auth mode array is static, parse it from a JSON string.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
3 years agoqemuBlockStorageSourceCreateDetectSize: Propagate 'extended_l2' feature to new overlays
Peter Krempa [Thu, 16 Dec 2021 17:35:34 +0000 (18:35 +0100)]
qemuBlockStorageSourceCreateDetectSize: Propagate 'extended_l2' feature to new overlays

In cases where the qcow2 image is using subclusters/extended_l2 entries
we should propagate them to the new images which are based on such
images.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: monitor: Extract whether qcow2 image uses extended L2 allocation data
Peter Krempa [Thu, 16 Dec 2021 10:00:55 +0000 (11:00 +0100)]
qemu: monitor: Extract whether qcow2 image uses extended L2 allocation data

In order to be able to propagate image configuration to newly formatted
images we need to be able to query it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuBlockStorageSourceCreateGetFormatPropsQcow2: Add support for 'extended-l2' feature
Peter Krempa [Thu, 16 Dec 2021 11:46:51 +0000 (12:46 +0100)]
qemuBlockStorageSourceCreateGetFormatPropsQcow2: Add support for 'extended-l2' feature

Allow creating the qcow2 with the new subcluster format if required.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agostorage_file_probe: Add support for probing qcow2's incompatible features
Peter Krempa [Fri, 17 Dec 2021 09:21:04 +0000 (10:21 +0100)]
storage_file_probe: Add support for probing qcow2's incompatible features

Add machinery for probing the incompatible feature flags field and
specifically extract whether the extended l2 feature (1 << 4) is
present.

For now we don't care abot the other features.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqcow2GetFeatures: Extract population of features bitmap
Peter Krempa [Fri, 17 Dec 2021 09:09:14 +0000 (10:09 +0100)]
qcow2GetFeatures: Extract population of features bitmap

Prepare for extraction of features from the 'incompatible features'
group.

This is done by moving the extraction loop into a new function called
qcow2GetFeaturesProcessGroup. The new function also allows to ingore
features we don't care about by passing VIR_STORAGE_FILE_FEATURE_LAST as
the target flag.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agostorage: Introduce 'extended_l2' feature for storage volume
Peter Krempa [Tue, 14 Dec 2021 15:05:09 +0000 (16:05 +0100)]
storage: Introduce 'extended_l2' feature for storage volume

QCOW2 images now support 'extended_l2' which splits the default clusters
into 32 subcluster allocation units. This allows the allocation units to
be smaller without increasing the size of L2 table too much and thus also
the cache requirements for holding the full L2 table in memory.

Unfortunately it's incompatible with qemu versions older than 5.2 thus
can't be used as default.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: formatstorage: Convert to RST
Peter Krempa [Tue, 14 Dec 2021 14:35:41 +0000 (15:35 +0100)]
docs: formatstorage: Convert to RST

Apart from the bulk conversion itself, the section names 'general
metadata' and 'target elements' were duplicated between the storage pool
and storage volume sections. To prevent heading name clashes they were
renamed appropriately.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Remove dependency on external resources
Andrea Bolognani [Thu, 9 Dec 2021 14:27:35 +0000 (15:27 +0100)]
docs: Remove dependency on external resources

The internals/eventloop document uses two images for
illustrative purposes, but unlike other graphics included
in the documentation these are not part of libvirt.git but
rather were added to libvirt-media.git with

  commit fae5622074cf5e18d190496f8a43260c614599b2
  Author: Michal Privoznik <mprivozn@redhat.com>
  Date:   Mon Jun 6 17:27:50 2016 +0200

    Add two event loop images

    These images are going to be used in our documentation of the
    event loop.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
  https://gitlab.com/libvirt/libvirt-media/-/commit/fae5622074cf5e18d190496f8a43260c614599b2

and are requested directly from there. Specifically, the
URLs point to the libvirt.org mirror of libvirt-media.git
instead of the primary repository hosted on GitLab.

Import the images into libvirt.git so that the website
doesn't rely on external resources and can, if desired, be
browsed entirely offline from installed packages.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoTranslated using Weblate (Japanese)
Yasuhiko Kamata [Sat, 18 Dec 2021 10:16:25 +0000 (11:16 +0100)]
Translated using Weblate (Japanese)

Currently translated at 49.7% (5198 of 10439 strings)

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

Co-authored-by: Yasuhiko Kamata <belphegor@belbel.or.jp>
Signed-off-by: Yasuhiko Kamata <belphegor@belbel.or.jp>
3 years agovirt-host-validate: Fix IOMMU output on S390
Boris Fiuczynski [Fri, 17 Dec 2021 15:20:37 +0000 (16:20 +0100)]
virt-host-validate: Fix IOMMU output on S390

Commit 93e9e92c1e eliminated the option for skipping but left code in
the s390 check which makes use of a skip. This leads to an output
without result destroying the correct format. e.g.

  QEMU: Checking for hardware virtualization                                 : PASS
  QEMU: Checking if device /dev/kvm exists                                   : PASS
  QEMU: Checking if device /dev/kvm is accessible                            : PASS
  QEMU: Checking if device /dev/vhost-net exists                             : PASS
  QEMU: Checking if device /dev/net/tun exists                               : PASS
  QEMU: Checking for cgroup 'cpu' controller support                         : PASS
  QEMU: Checking for cgroup 'cpuacct' controller support                     : PASS
  QEMU: Checking for cgroup 'cpuset' controller support                      : PASS
  QEMU: Checking for cgroup 'memory' controller support                      : PASS
  QEMU: Checking for cgroup 'devices' controller support                     : PASS
  QEMU: Checking for cgroup 'blkio' controller support                       : PASS
  QEMU: Checking for device assignment IOMMU support                         :   QEMU: Checking for secure guest support                                    : PASS

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuGetSEVInfoToParams: Reformat to standard coding style
Peter Krempa [Thu, 16 Dec 2021 17:24:58 +0000 (18:24 +0100)]
qemuGetSEVInfoToParams: Reformat to standard coding style

The function was formatted weirdly which prompted additions to conform
to the unusual style.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agovsh-table: Ensure NULL terminated arguments to vshTable*()
Michal Privoznik [Tue, 14 Dec 2021 14:26:47 +0000 (15:26 +0100)]
vsh-table: Ensure NULL terminated arguments to vshTable*()

There are two functions that take variable arguments:
vshTableNew() and vshTableRowAppend(). Both expect the list of
arguments to be NULL terminated. Annotate them with
G_GNUC_NULL_TERMINATED to enable compile time check for this.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovsh-table.h: Modernize declarations
Michal Privoznik [Wed, 15 Dec 2021 09:37:25 +0000 (10:37 +0100)]
vsh-table.h: Modernize declarations

Use modern style of function declarations where the return type
and function name are on two separate lines.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovsh-table: Hide vshTableRow typedef
Michal Privoznik [Wed, 15 Dec 2021 09:35:50 +0000 (10:35 +0100)]
vsh-table: Hide vshTableRow typedef

There's no need for any caller to know vshTableRow typedef.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovshtabletest: Fix potential memleak
Michal Privoznik [Wed, 15 Dec 2021 09:23:15 +0000 (10:23 +0100)]
vshtabletest: Fix potential memleak

In testVshTableNew() we test whether vshTableNew(NULL) allocates
a table. This is expected to fail (and return NULL), because
passing nothing but NULL to vshTableNew() is viewed as error.
Nevertheless, if vshTableNew() did not fail and returned an
allocated table it would be leaked.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>