]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
4 years agotests: qemucapabilities: Update qemu caps for object-add qapification
Peter Krempa [Wed, 24 Feb 2021 15:40:45 +0000 (16:40 +0100)] 
tests: qemucapabilities: Update qemu caps for object-add qapification

qemu qapified object-add, which means that it's introspectable via
query-qmp-schema. Update the qemu-6.0 capabilities to commit
v5.2.0-3205-g92566947b3

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemumonitorjsontest: Remove tripwire guarding object-add QAPIfication
Peter Krempa [Thu, 26 Nov 2020 17:31:47 +0000 (18:31 +0100)] 
qemumonitorjsontest: Remove tripwire guarding object-add QAPIfication

Libvirt is now prepared for QAPIfied object-add.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agotests: qemuxml2argv: Validate generation of JSON props for object-add
Peter Krempa [Thu, 26 Nov 2020 17:35:55 +0000 (18:35 +0100)] 
tests: qemuxml2argv: Validate generation of JSON props for object-add

Similarly to the validation for blockdev-add and netdev_add, use the
qemuxml2argv test repository to drive validation of props for
object-add.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: command: Use JSON for QAPIfied -object directly
Peter Krempa [Fri, 12 Mar 2021 14:44:19 +0000 (15:44 +0100)] 
qemu: command: Use JSON for QAPIfied -object directly

Skip the lossy conversion to legacy commandline arguments by using the
JSON props directly when -object is QAPIfied. This avoids issues with
conversion of bitmaps and also allows validation of the generated JSON
against the QMP schema in the tests.

Since the new approach is triggered by a qemu capability the code
from 'virQEMUBuildObjectCommandlineFromJSON' in util/virqemu.c was moved
to 'qemuBuildObjectCommandlineFromJSON' in qemu/qemu_command.c which has
the virQEMUCaps type.

Some functions needed to be modified to propagate qemuCaps.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: monitor: Don't add 'props' wrapper if qemu has QEMU_CAPS_OBJECT_QAPIFIED
Peter Krempa [Mon, 30 Nov 2020 17:30:46 +0000 (18:30 +0100)] 
qemu: monitor: Don't add 'props' wrapper if qemu has QEMU_CAPS_OBJECT_QAPIFIED

Set 'objectAddNoWrap' when the capability is present.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemuMonitorCreateObjectPropsWrap: Open-code in qemuBuildMemoryBackendProps
Peter Krempa [Mon, 30 Nov 2020 16:08:46 +0000 (17:08 +0100)] 
qemuMonitorCreateObjectPropsWrap: Open-code in qemuBuildMemoryBackendProps

There's just one caller left. Since qemuBuildMemoryBackendProps is too
complex to be modified for now, just move the adding of 'id' and 'qom'
type directly into the function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: monitor: Make wrapping of 'props' of 'object-add' optional
Peter Krempa [Mon, 30 Nov 2020 15:03:57 +0000 (16:03 +0100)] 
qemu: monitor: Make wrapping of 'props' of 'object-add' optional

Construct the JSON object which is used for object-add without the
'props' wrapper and add the wrapper only in the monitor code.

This simplifies the JSON->commandline generator in the first place and
also prepares for upcoming qemu where 'props' will be removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: capabilities: Introduce QEMU_CAPS_OBJECT_QAPIFIED
Peter Krempa [Fri, 27 Nov 2020 06:06:13 +0000 (07:06 +0100)] 
qemu: capabilities: Introduce QEMU_CAPS_OBJECT_QAPIFIED

Starting from qemu-6.0 the parameters of -object/object-add are formally
described by the QAPI schema. Additionally this changes the nesting of
the properties as the 'props' nested object will be flattened to the
parent.

We'll need to detect whether qemu switched to this new approach to
generate the objects with proper nesting and also allow testing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirQEMUQAPISchemaTraverse: Fix quoting in comment
Peter Krempa [Fri, 12 Mar 2021 16:25:00 +0000 (17:25 +0100)] 
virQEMUQAPISchemaTraverse: Fix quoting in comment

It tripped up highlighter in my editor.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemuxml2argvdata: Remove unused output file 'disk-network-tlsx509.x86_64-latest.args'
Peter Krempa [Fri, 12 Mar 2021 17:09:20 +0000 (18:09 +0100)] 
qemuxml2argvdata: Remove unused output file 'disk-network-tlsx509.x86_64-latest.args'

The file is unused since commit e34097750aa48292a25b1368eb1ba4f split
the test file for VXHS and NBD protocols.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodomain_conf: Don't leak def->os.firmwareFeatures
Michal Privoznik [Tue, 23 Mar 2021 10:53:41 +0000 (11:53 +0100)] 
domain_conf: Don't leak def->os.firmwareFeatures

The firmwareFeatures member of virDomainOSDef struct is allocated
in virDomainDefParseBootFirmwareOptions() but never freed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agodomain_conf: Separate virDomainOS clear into a function
Michal Privoznik [Tue, 23 Mar 2021 10:47:39 +0000 (11:47 +0100)] 
domain_conf: Separate virDomainOS clear into a function

The virDomainDefFree() function frees individual members of
virDomainDef struct. The function is already long enough, move
code that handles def->os member into a separate function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoci: Drop FreeBSD 11 build
Andrea Bolognani [Mon, 22 Mar 2021 11:02:23 +0000 (12:02 +0100)] 
ci: Drop FreeBSD 11 build

FreeBSD 12 was released in December 2018, so according to our
platform support policy we can now drop support for the previous
major release. It would be going EOL in September anyway.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoutil: Make virReallocN return void
Jiri Denemark [Fri, 19 Mar 2021 23:37:06 +0000 (00:37 +0100)] 
util: Make virReallocN return void

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoDo not check return value of VIR_REALLOC_N
Jiri Denemark [Fri, 19 Mar 2021 23:37:05 +0000 (00:37 +0100)] 
Do not check return value of VIR_REALLOC_N

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoutil: Make virExpandN return void
Jiri Denemark [Fri, 19 Mar 2021 23:37:04 +0000 (00:37 +0100)] 
util: Make virExpandN return void

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoDo not check return value of VIR_EXPAND_N
Jiri Denemark [Fri, 19 Mar 2021 23:37:03 +0000 (00:37 +0100)] 
Do not check return value of VIR_EXPAND_N

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoutil: Make virResizeN return void
Jiri Denemark [Fri, 19 Mar 2021 23:37:02 +0000 (00:37 +0100)] 
util: Make virResizeN return void

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoDo not check return value of VIR_RESIZE_N
Jiri Denemark [Fri, 19 Mar 2021 23:37:01 +0000 (00:37 +0100)] 
Do not check return value of VIR_RESIZE_N

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoutil: Drop G_GNUC_WARN_UNUSED_RESULT from reallocation APIs
Jiri Denemark [Fri, 19 Mar 2021 23:37:00 +0000 (00:37 +0100)] 
util: Drop G_GNUC_WARN_UNUSED_RESULT from reallocation APIs

Our reallocation APIs already abort on OOM and thus can only return 0.
There's no need to force callers to check the result.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoqemu: Drop redundant checks for qemuCaps before virQEMUCapsGet
Jiri Denemark [Fri, 19 Mar 2021 22:30:24 +0000 (23:30 +0100)] 
qemu: Drop redundant checks for qemuCaps before virQEMUCapsGet

virQEMUCapsGet checks for qemuCaps itself, no need to do it explicitly.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoqemu: Use g_autoptr in qemuMonitorJSONSetCapabilities
Jiri Denemark [Fri, 19 Mar 2021 22:28:38 +0000 (23:28 +0100)] 
qemu: Use g_autoptr in qemuMonitorJSONSetCapabilities

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoqemu: Use g_autofree in qemuMigrationJobCheckStatus
Jiri Denemark [Fri, 19 Mar 2021 22:28:37 +0000 (23:28 +0100)] 
qemu: Use g_autofree in qemuMigrationJobCheckStatus

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoqemu: Update asyncOwnerAPI when entering async job phase
Jiri Denemark [Fri, 19 Mar 2021 21:42:25 +0000 (22:42 +0100)] 
qemu: Update asyncOwnerAPI when entering async job phase

In case an async job spans multiple APIs (e.g., incoming migration) the
API that started the job is recorded as the asyncOwnerAPI even though it
is no longer running and the owner thread is updated properly to the one
currently handling the job. Let's also update asyncOwnerAPI to make it
more obvious which is the current (or the most recent) API involved in
the job.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoqemu: Only raise memlock limit if necessary
Andrea Bolognani [Tue, 9 Mar 2021 10:40:21 +0000 (11:40 +0100)] 
qemu: Only raise memlock limit if necessary

Attempting to set the memlock limit might fail if we're running
in a containerized environment where CAP_SYS_RESOURCE is not
available, and if the limit is already high enough there's no
point in trying to raise it anyway.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Refactor qemuDomainAdjustMaxMemLock()
Andrea Bolognani [Wed, 3 Mar 2021 17:41:34 +0000 (18:41 +0100)] 
qemu: Refactor qemuDomainAdjustMaxMemLock()

Store the current memory locking limit and the desired one
separately, which will help with later changes.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Don't ignore virProcessGetMaxMemLock() errors
Andrea Bolognani [Wed, 3 Mar 2021 11:02:49 +0000 (12:02 +0100)] 
qemu: Don't ignore virProcessGetMaxMemLock() errors

Now that we've implemented a fallback for the function that
obtains the information from /proc, there is no reason we would
get a failure unless there's something seriously wrong with the
environment we're running in, in which case we're better off
reporting the issue to the user rather than pretending
everything is fine.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoutil: Try to get limits from /proc
Andrea Bolognani [Thu, 4 Mar 2021 10:37:36 +0000 (11:37 +0100)] 
util: Try to get limits from /proc

Calling prlimit() requires elevated privileges, specifically
CAP_SYS_RESOURCE, and getrlimit() only works for the current
process which is too limiting for our needs; /proc/$pid/limits,
on the other hand, can be read by any process, so implement
parsing that file as a fallback for when prlimit() fails.

This is useful in containerized environments.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agosyntax-check: Run flake8 on all Python scripts
Andrea Bolognani [Fri, 19 Mar 2021 13:24:19 +0000 (14:24 +0100)] 
syntax-check: Run flake8 on all Python scripts

Currenty we only check files that end in .py, but we have at
least a couple of scripts that don't have that suffix and we
nonetheless want to keep compliant with the code style.

Extend the sc_flake8 syntax-check rule so that any file that
contains a Python 3 shebang is fed to flake8 too.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agotests: Fix flake8 errors in virsh-auth
Andrea Bolognani [Fri, 19 Mar 2021 13:26:34 +0000 (14:26 +0100)] 
tests: Fix flake8 errors in virsh-auth

Specifically

  E111 indentation is not a multiple of four

This commit is better viewed with 'git show -w'.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agogitignore: Ignore __pycache__ directory
Andrea Bolognani [Fri, 19 Mar 2021 13:27:28 +0000 (14:27 +0100)] 
gitignore: Ignore __pycache__ directory

Unfortunately running Python scripts causes this directory to
be created in the *source* tree, and there doesn't seem to be
a way to prevent that from happening.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoci: Drop prefix from Dockerfiles
Andrea Bolognani [Fri, 19 Mar 2021 15:04:37 +0000 (16:04 +0100)] 
ci: Drop prefix from Dockerfiles

Since the string "ci" is already contained in the path, it
seems unnecessary to include it into the filename too: in fact,
we only do that for Dockerfiles and not for files in ci/cirrus,
even though those are generated the very same way.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agobhyve: add <os firmware='efi'> support
Roman Bogorodskiy [Mon, 22 Feb 2021 09:46:13 +0000 (13:46 +0400)] 
bhyve: add <os firmware='efi'> support

Implement "<os firmware='efi'>" support for bhyve driver.
As there are not really lot of options, try to find
"BHYVE_UEFI.fd" firmware which is installed by the
sysutils/uefi-edk2-bhyve FreeBSD port.

If not found, just use the first found firmware
in the firmwares directory (which is configurable via
config file).

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoTranslated using Weblate (Korean)
simmon [Fri, 19 Mar 2021 17:01:54 +0000 (18:01 +0100)] 
Translated using Weblate (Korean)

Currently translated at 29.9% (3158 of 10545 strings)

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

Co-authored-by: simmon <simmon@nplob.com>
Signed-off-by: simmon <simmon@nplob.com>
4 years agoqemu: backup: Restore security label on backup disk store image on VM termination
Peter Krempa [Wed, 17 Mar 2021 15:30:31 +0000 (16:30 +0100)] 
qemu: backup: Restore security label on backup disk store image on VM termination

When the backup job is terminated normally the security label is
restored by the blockjob finishing handler.

If the VM dies or is destroyed that wouldn't happen as the blockjob
handler wouldn't be called.

Restore the security label on disk store where we remember that the job
was running at the point when 'qemuBackupJobTerminate' was called.

Not resetting the security label means that we also leak the xattr
attributes remembering the label which prevents any further use of the
file, which is a problem for block devices.

This also requires that the call to 'qemuBackupJobTerminate' from
'qemuProcessStop' happens only after 'vm->pid' was reset as otherwise
the security subdrivers attempt to enter the process namespace which
fails if the process isn't running any more.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1939082
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoNEWS: Mention support for full backups via virDomainBackupBegin
Peter Krempa [Thu, 18 Mar 2021 14:14:43 +0000 (15:14 +0100)] 
NEWS: Mention support for full backups via virDomainBackupBegin

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: backup: Enable full backup support
Peter Krempa [Thu, 18 Mar 2021 14:11:55 +0000 (15:11 +0100)] 
qemu: backup: Enable full backup support

qemuBackupBegin can take a full backup of the disks (excluding any
operations with bitmaps) without the need to wait for the
blockdev-reopen support in qemu.

Add a check that no checkpoint creation is required and the disk backup
mode isn't VIR_DOMAIN_BACKUP_DISK_BACKUP_MODE_INCREMENTAL.

Call to virDomainBackupAlignDisks is moved earlier as it initializes the
disk backup mode if not present in user config.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: capabilities: Introduce QEMU_CAPS_BLOCKDEV_BACKUP
Peter Krempa [Thu, 18 Mar 2021 14:02:00 +0000 (15:02 +0100)] 
qemu: capabilities: Introduce QEMU_CAPS_BLOCKDEV_BACKUP

Upcoming commit will enable full backup support (incremental part
requires blockdev-reopen, which won't happen in qemu for at least
another release).

Add a capability that the 'blockdev-backup' job is supported by qemu
capped, but limited to when qemu supports QEMU_CAPS_BLOCKDEV.

We can also use it in the expression to enable
QEMU_CAPS_INCREMENTAL_BACKUP since it's a pre-requisite too.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoci: helper: Apply Python naming practice to private methods/attributes
Erik Skultety [Thu, 18 Mar 2021 07:34:18 +0000 (08:34 +0100)] 
ci: helper: Apply Python naming practice to private methods/attributes

As documented at [1], the common practice with respect to private
attributes/methods naming is to prefix them with an underscore.

[1] https://docs.python.org/3/tutorial/classes.html#private-variables

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agoci: util: Add a registry checker for stale images
Erik Skultety [Mon, 15 Mar 2021 14:42:13 +0000 (15:42 +0100)] 
ci: util: Add a registry checker for stale images

This function checks whether there are any stale Docker images in the
registry that can be purged. Since we're pulling available container
images from our GitLab registry with the 'list-images' action, it
could happen that we'd list old (already unsupported) images and make
them available for the user to consume and run a build in them.
Naturally, the build will most likely fail leaving the user confused.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agoci: helper: Rewrite image listing to Python
Erik Skultety [Tue, 16 Mar 2021 08:47:23 +0000 (09:47 +0100)] 
ci: helper: Rewrite image listing to Python

The corresponding Bash script is dropped.
After this patch's rewrite, the Makefile's original image listing
target remains intact only to notify the user to use the Python helper
instead.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agoci: Introduce a util module
Erik Skultety [Wed, 10 Feb 2021 16:42:30 +0000 (17:42 +0100)] 
ci: Introduce a util module

With the gradual rewrite of the Makefile to the 'helper' script will
require helper functions that would better live in a separate util
module.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agoci: helper: Introduce --quiet for the refresh command
Erik Skultety [Tue, 16 Mar 2021 17:00:41 +0000 (18:00 +0100)] 
ci: helper: Introduce --quiet for the refresh command

Offer an option to silence all output to stdout coming out of the
dockerfiles/varsfiles generating code.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agoci: helper: Use the ArgumentDefaultsHelpFormatter help formatter
Erik Skultety [Tue, 16 Mar 2021 14:44:06 +0000 (15:44 +0100)] 
ci: helper: Use the ArgumentDefaultsHelpFormatter help formatter

This help formatter class reports the defaults we use for options
taking an argument.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agoqemu: implement support for firmware auto-selection feature filtering
Pavel Hrdina [Wed, 17 Mar 2021 15:34:24 +0000 (16:34 +0100)] 
qemu: implement support for firmware auto-selection feature filtering

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoconf: introduce support for firmware auto-selection feature filtering
Pavel Hrdina [Tue, 16 Mar 2021 12:07:26 +0000 (13:07 +0100)] 
conf: introduce support for firmware auto-selection feature filtering

When the firmware auto-selection was introduced it always picked first
usable firmware based on the JSON descriptions on the host. It is
possible to add/remove/change the JSON files but it will always be for
the whole host.

This patch introduces support for configuring the auto-selection per VM
by adding users an option to limit what features they would like to have
available in the firmware.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoconf: use switch in virDomainDefParseBootOptions
Pavel Hrdina [Wed, 10 Mar 2021 10:47:24 +0000 (11:47 +0100)] 
conf: use switch in virDomainDefParseBootOptions

The original code used a lot of conditions and was not that obvious
when each XML bits are parsed.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoconf: introduce virDomainDefParseBootAcpiOptions
Pavel Hrdina [Wed, 10 Mar 2021 10:39:34 +0000 (11:39 +0100)] 
conf: introduce virDomainDefParseBootAcpiOptions

Extract the code to it's own function.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoconf: introduce virDomainDefParseBootLoaderOptions
Pavel Hrdina [Wed, 10 Mar 2021 10:31:49 +0000 (11:31 +0100)] 
conf: introduce virDomainDefParseBootLoaderOptions

Extract the code to it's own function.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoconf: introduce virDomainDefParseBootFirmwareOptions
Pavel Hrdina [Wed, 10 Mar 2021 10:28:39 +0000 (11:28 +0100)] 
conf: introduce virDomainDefParseBootFirmwareOptions

Extract the code to it's own function.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoconf: introduce virDomainDefParseBootKernelOptions
Pavel Hrdina [Wed, 10 Mar 2021 10:23:42 +0000 (11:23 +0100)] 
conf: introduce virDomainDefParseBootKernelOptions

Extract the code to it's own function.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoconf: introduce virDomainDefParseBootInitOptions
Pavel Hrdina [Wed, 10 Mar 2021 10:20:37 +0000 (11:20 +0100)] 
conf: introduce virDomainDefParseBootInitOptions

Extract the code to it's own function.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodocs: improve description of secure attribute for loader element
Pavel Hrdina [Tue, 16 Mar 2021 12:05:08 +0000 (13:05 +0100)] 
docs: improve description of secure attribute for loader element

The original text was not explaining what this attribute actually
controls and could have been interpreted as a control switch for the
Secure boot feature in firmwares.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodomain_validate: XML validate that non-virtio video devices have none virtio options
Kristina Hanicova [Wed, 10 Mar 2021 16:42:51 +0000 (17:42 +0100)] 
domain_validate: XML validate that non-virtio video devices have none virtio options

With this, XML fails if non-virtio video devices have virtio
options. Previously it didn't raise error.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1922093
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodomain_validate: Move virDomainCheckVirtioOptionsAreAbsent() a few lines forward
Kristina Hanicova [Wed, 10 Mar 2021 16:42:50 +0000 (17:42 +0100)] 
domain_validate: Move virDomainCheckVirtioOptionsAreAbsent() a few lines forward

Move this function in order to use it in the next patch before
its previous declaration.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodomain_conf: Refactor virDomainDeviceInfoParseXML to use XPath
Kristina Hanicova [Fri, 12 Mar 2021 12:44:49 +0000 (13:44 +0100)] 
domain_conf: Refactor virDomainDeviceInfoParseXML to use XPath

Currently, virDomainDeviceInfoParseXML() uses node->children
evaluation which is too verbose. Use XPath evaluation which is
nicer.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodomain_conf: Propagate xmlXPathContextPtr into virDomainDeviceInfoParseXML()
Kristina Hanicova [Fri, 12 Mar 2021 12:44:48 +0000 (13:44 +0100)] 
domain_conf: Propagate xmlXPathContextPtr into virDomainDeviceInfoParseXML()

Function virDomainDeviceInfoParseXML() will need it soon, because it
will be doing XPath evaluation.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agonodedev: Don't crash when exiting before init is done
Jonathon Jongsma [Tue, 16 Mar 2021 22:27:25 +0000 (17:27 -0500)] 
nodedev: Don't crash when exiting before init is done

If libvirtd is terminated before the node driver finishes
initialization, it can crash with a backtrace similar to the following:

    Stack trace of thread 1922933:
    #0  0x00007f8515178774 g_hash_table_find (libglib-2.0.so.0)
    #1  0x00007f851593ea98 virHashSearch (libvirt.so.0)
    #2  0x00007f8515a1dd83 virNodeDeviceObjListSearch (libvirt.so.0)
    #3  0x00007f84cceb40a1 udevAddOneDevice (libvirt_driver_nodedev.so)
    #4  0x00007f84cceb5fae nodeStateInitializeEnumerate (libvirt_driver_nodedev.so)
    #5  0x00007f85159840cb virThreadHelper (libvirt.so.0)
    #6  0x00007f8511c7d14a start_thread (libpthread.so.0)
    #7  0x00007f851442bdb3 __clone (libc.so.6)

    Stack trace of thread 1922863:
    #0  0x00007f851442651d syscall (libc.so.6)
    #1  0x00007f85159842d4 virThreadSelfID (libvirt.so.0)
    #2  0x00007f851594e240 virLogFormatString (libvirt.so.0)
    #3  0x00007f851596635d vir_object_finalize (libvirt.so.0)
    #4  0x00007f8514efe8e9 g_object_unref (libgobject-2.0.so.0)
    #5  0x00007f85159667f8 virObjectUnref (libvirt.so.0)
    #6  0x00007f851517755f g_hash_table_remove_all_nodes.part.0 (libglib-2.0.so.0)
    #7  0x00007f8515177e62 g_hash_table_unref (libglib-2.0.so.0)
    #8  0x00007f851596637e vir_object_finalize (libvirt.so.0)
    #9  0x00007f8514efe8e9 g_object_unref (libgobject-2.0.so.0)
    #10 0x00007f85159667f8 virObjectUnref (libvirt.so.0)
    #11 0x00007f84cceb2b42 nodeStateCleanup (libvirt_driver_nodedev.so)
    #12 0x00007f8515b37950 virStateCleanup (libvirt.so.0)
    #13 0x00005648085348e8 main (libvirtd)
    #14 0x00007f8514352493 __libc_start_main (libc.so.6)
    #15 0x00005648085350fe _start (libvirtd)

This is because the initial population of the device list is done in a
separate initialization thread. If we attempt to exit libvirtd before
this init thread has completed, we'll try to free the device list while
accessing it from the other thread. In order to guarantee that this
init thread is not accessing the device list when we're cleaning up the
nodedev driver, make it joinable and wait for it to finish before
proceding with the cleanup. This is similar to how we handle the udev
event handler thread.

The separate initialization thread was added in commit
9f0ae0b1.

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

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirxml: Fix possible memory leak in virXMLNodeContentString()
Kristina Hanicova [Wed, 17 Mar 2021 16:43:19 +0000 (17:43 +0100)] 
virxml: Fix possible memory leak in virXMLNodeContentString()

Previously, if xml node passed to the virXMLNodeContentString()
was not of type XML_ELEMENT_NODE, @ret could have caused a memory
leak because xmlNodeGetContent() works for other types of nodes
as well.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoNEWS: Document domain memory dirty rate APIs
Hao Wang [Thu, 18 Mar 2021 09:00:29 +0000 (17:00 +0800)] 
NEWS: Document domain memory dirty rate APIs

Signed-off-by: Hao Wang <wanghao232@huawei.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agomigration/dirtyrate: Introduce command 'virsh domstats --dirtyrate'
Hao Wang [Tue, 16 Mar 2021 12:32:51 +0000 (20:32 +0800)] 
migration/dirtyrate: Introduce command 'virsh domstats --dirtyrate'

Introduce command 'virsh domstats --dirtyrate' for reporting memory
dirty rate information. The info is listed as:

Domain: 'vm0'
  dirtyrate.calc_status=2
  dirtyrate.calc_start_time=1534523
  dirtyrate.calc_period=1
  dirtyrate.megabytes_per_second=5

Signed-off-by: Hao Wang <wanghao232@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agomigration/dirtyrate: Extend dirtyrate statistics for domGetStats
Hao Wang [Tue, 16 Mar 2021 12:32:50 +0000 (20:32 +0800)] 
migration/dirtyrate: Extend dirtyrate statistics for domGetStats

Extend dirtyrate statistics for domGetStats to display the information
of a domain's memory dirty rate produced by domainStartDirtyRateCalc.

Signed-off-by: Hao Wang <wanghao232@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agomigration/dirtyrate: Implement qemuMonitorQueryDirtyRate
Hao Wang [Tue, 16 Mar 2021 12:32:49 +0000 (20:32 +0800)] 
migration/dirtyrate: Implement qemuMonitorQueryDirtyRate

Implement qemuMonitorQueryDirtyRate which query domain's memory
dirty rate calling qmp "query-dirty-rate".

Signed-off-by: Hao Wang <wanghao232@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agomigration/dirtyrate: Introduce virDomainDirtyRateStatus enum
Hao Wang [Tue, 16 Mar 2021 12:32:48 +0000 (20:32 +0800)] 
migration/dirtyrate: Introduce virDomainDirtyRateStatus enum

Introduce virDomainDirtyRateStatus enum.

Signed-off-by: Hao Wang <wanghao232@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agomigration/dirtyrate: Introduce domdirtyrate-calc virsh api
Hao Wang [Tue, 16 Mar 2021 12:32:47 +0000 (20:32 +0800)] 
migration/dirtyrate: Introduce domdirtyrate-calc virsh api

Introduce domdirtyrate-calc virsh api to start calculating domain's
memory dirty rate:
# virsh domdirtyrate-calc <domain> [--seconds <sec>]

Signed-off-by: Hao Wang <wanghao232@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agomigration/dirtyrate: Implement qemuDomainStartDirtyRateCalc
Hao Wang [Tue, 16 Mar 2021 12:32:46 +0000 (20:32 +0800)] 
migration/dirtyrate: Implement qemuDomainStartDirtyRateCalc

Implement qemuDomainStartDirtyRateCalc which calculates domain's memory
dirty rate calling qmp "calc-dirty-rate".

Signed-off-by: Hao Wang <wanghao232@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agomigration/dirtyrate: Introduce virDomainStartDirtyRateCalc API
Hao Wang [Tue, 16 Mar 2021 12:32:45 +0000 (20:32 +0800)] 
migration/dirtyrate: Introduce virDomainStartDirtyRateCalc API

Introduce virDomainStartDirtyRateCalc API for start calculation of
a domain's memory dirty rate with a specified time.

Signed-off-by: Hao Wang <wanghao232@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agotests: Adjust libxlxml2domconfigtest to work with Xen < 4.8
Olaf Hering [Mon, 8 Mar 2021 13:29:31 +0000 (14:29 +0100)] 
tests: Adjust libxlxml2domconfigtest to work with Xen < 4.8

Commit fcdc387410fadfb066b95395c5b5d2a6a16f7066 used a libxl API which
is only available since Xen 4.8.

Due to lack of a specific guard for this API change, reuse another
guard from libxl.h.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 years agoTranslated using Weblate (Korean)
simmon [Tue, 16 Mar 2021 18:01:52 +0000 (19:01 +0100)] 
Translated using Weblate (Korean)

Currently translated at 29.3% (3094 of 10545 strings)

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

Co-authored-by: simmon <simmon@nplob.com>
Signed-off-by: simmon <simmon@nplob.com>
4 years agodocs: stop mentioning insecure / broken SASL mechanisms
Daniel P. Berrangé [Thu, 4 Mar 2021 18:02:53 +0000 (18:02 +0000)] 
docs: stop mentioning insecure / broken SASL mechanisms

We don't need to go to the trouble of telling users about existance of
insecure SASL mechanisms only to then say that they shouldn't be used.
We should only tell people about the GSSAPI mechanism for TCP sockets.

For the SCRAM mechanism we should be telling people about the SHA256
variant only, and also warning that the password database stores the
passwords in clear text.

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: fix misc typos in auth docs
Daniel P. Berrangé [Wed, 17 Mar 2021 09:28:39 +0000 (09:28 +0000)] 
docs: fix misc typos in auth docs

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: convert auth page into RST format
Daniel P. Berrangé [Thu, 4 Mar 2021 16:48:12 +0000 (16:48 +0000)] 
docs: convert auth page into RST format

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoutil: tell users that memory locking ulimit is too low for BPF
Daniel P. Berrangé [Tue, 16 Mar 2021 17:04:24 +0000 (17:04 +0000)] 
util: tell users that memory locking ulimit is too low for BPF

If running libvirtd via systemd, it gets a 64 MB memlock limit, but if
running from the shell it will only get 64 KB on a Fedora 33 system.
The latter low limit causes any attempt to use BPF to fail and it is
not obvious why.

This improves the error message thus:

  # virsh -c lxc:/// start sh
error: Failed to start domain 'sh'
error: internal error: guest failed to start: Failure in libvirt_lxc startup: failed to initialize device BPF map; locked memory limit for libvirtd probably needs to be raised: Operation not permitted

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agosrc: ensure GSource background unref happens in correct event loop
Daniel P. Berrangé [Tue, 16 Mar 2021 16:26:06 +0000 (16:26 +0000)] 
src: ensure GSource background unref happens in correct event loop

The g_idle_add function adds a callback to the primary GMainContext.

To workaround the GSource unref bugs, we need to add our callbacks
to the GMainContext that is associated with the GSource being
unref'd. Thus code using the per-VM virEventThread must use its
private GMainContext.

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs/compiling: Add note on how to check minimum meson version
Peter Krempa [Tue, 16 Mar 2021 09:19:45 +0000 (10:19 +0100)] 
docs/compiling: Add note on how to check minimum meson version

Give guidance on how to check minimum meson version for a given package.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/140
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agolib: Debug print all arguments of virNetworkUpdate()
Michal Privoznik [Mon, 1 Mar 2021 18:22:48 +0000 (19:22 +0100)] 
lib: Debug print all arguments of virNetworkUpdate()

Somehow, command argument was not printed into debug logs. It is
imperative that all arguments are logged.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemu_process: Use accessor for def->mem.total_memory
Michal Privoznik [Mon, 15 Mar 2021 14:47:04 +0000 (15:47 +0100)] 
qemu_process: Use accessor for def->mem.total_memory

When connecting to the monitor, a timeout is calculated that is
bigger the more memory guest has (because QEMU has to allocate
and possibly zero out the memory and what not, empirically
deducted). However, when computing the timeout the @total_memory
mmember is accessed directly even though
virDomainDefGetMemoryTotal() should have been used.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agocoding-style: Don't encourage virXXXPtr typedefs
Michal Privoznik [Mon, 15 Mar 2021 17:49:45 +0000 (18:49 +0100)] 
coding-style: Don't encourage virXXXPtr typedefs

We don't like virXXXPtr typedefs really and they are going away
shortly, possibly. Do not encourage new code to put in the
typedefs.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agomeson: Don't check for addr2line
Michal Privoznik [Mon, 15 Mar 2021 17:22:22 +0000 (18:22 +0100)] 
meson: Don't check for addr2line

In the past, we used to have this oomtrace.pl script that
attempted to print the stack trace of where an OOM error
occurred and it used addr2line for that. But since v5.8.0-rc1~189
we don't really care about OOM anymore and the script is long
gone so there's no need to check for addr2line program either.

Fixes: 2c52ecd96086b4643b99b4570b5823d40ce2787b
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoci: Discourage users from using the Makefile directly
Andrea Bolognani [Fri, 12 Mar 2021 16:34:23 +0000 (17:34 +0100)] 
ci: Discourage users from using the Makefile directly

We now wrap all its important functionality with the much more
user-friendly ci/helper script, and the long term plan is for
the Makefile to disappear completely.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoci: Delete refresh scripts
Andrea Bolognani [Fri, 12 Mar 2021 16:42:31 +0000 (17:42 +0100)] 
ci: Delete refresh scripts

The functionality is now available in the ci/helper script.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoci: Implement 'test' helper action
Andrea Bolognani [Fri, 12 Mar 2021 17:01:43 +0000 (18:01 +0100)] 
ci: Implement 'test' helper action

This simply calls the underlying Makefile target, but allows
additional arguments to be specified in a more convenient and
discoverable way.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoci: Implement 'build' helper action
Andrea Bolognani [Fri, 12 Mar 2021 17:00:52 +0000 (18:00 +0100)] 
ci: Implement 'build' helper action

This simply calls the underlying Makefile target, but allows
additional arguments to be specified in a more convenient and
discoverable way.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoci: Implement 'shell' helper action
Andrea Bolognani [Fri, 12 Mar 2021 16:55:08 +0000 (17:55 +0100)] 
ci: Implement 'shell' helper action

This simply calls the underlying Makefile target, but allows
additional arguments to be specified in a more convenient and
discoverable way.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoci: Implement 'list-images' helper action
Andrea Bolognani [Fri, 12 Mar 2021 16:52:50 +0000 (17:52 +0100)] 
ci: Implement 'list-images' helper action

This simply calls the underlying Makefile target.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoci: Implement 'refresh' helper action
Andrea Bolognani [Fri, 12 Mar 2021 16:48:47 +0000 (17:48 +0100)] 
ci: Implement 'refresh' helper action

This provides the same functionality as the two refresh scripts
that are currently in the repository, with the following
advantages:

  * all files are refreshed with a single command;

  * if lcitool is present in the user's $PATH, it will be
    discovered and used automatically;

  * some output is produced, so the user can follow along with
    the progress of the operation.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoci: Add helper script
Andrea Bolognani [Tue, 16 Feb 2021 16:21:49 +0000 (17:21 +0100)] 
ci: Add helper script

This is intended to be perform a number of CI-related operations
that are currently implemented in various different scripts
written in various different programming languages.

Eventually, all existing functionality will be reimplemented in
Python and made available through this single entry point; for
now, let's start with a very basic skeleton.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoci: Fix name for ci-test target in help output
Andrea Bolognani [Fri, 12 Mar 2021 16:29:22 +0000 (17:29 +0100)] 
ci: Fix name for ci-test target in help output

The target was renamed when moving to Meson, but the help text
was not updated accordingly.

Fixes: 1a0af38ae75262390061b8d07681b50f82e500fc
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agosyntax-check: Allow exceptions for sc_prohibit_nonreentrant
Andrea Bolognani [Fri, 12 Mar 2021 16:26:51 +0000 (17:26 +0100)] 
syntax-check: Allow exceptions for sc_prohibit_nonreentrant

We're going to need it in a bit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agodocs: html.in: Convert 'compiling' to rst
Erik Skultety [Fri, 12 Mar 2021 07:34:15 +0000 (08:34 +0100)] 
docs: html.in: Convert 'compiling' to rst

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agodocs: html.in: Convert bindings to rst
Erik Skultety [Fri, 12 Mar 2021 11:09:01 +0000 (12:09 +0100)] 
docs: html.in: Convert bindings to rst

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agodocs: html.in: Convert auditlog to rst
Erik Skultety [Fri, 12 Mar 2021 11:04:40 +0000 (12:04 +0100)] 
docs: html.in: Convert auditlog to rst

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agodocs: html.in: Convert apps to rst
Erik Skultety [Fri, 12 Mar 2021 11:14:57 +0000 (12:14 +0100)] 
docs: html.in: Convert apps to rst

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agodocs: html.in: Convert api to rst
Erik Skultety [Fri, 12 Mar 2021 10:53:13 +0000 (11:53 +0100)] 
docs: html.in: Convert api to rst

There were a number of occurrences where we used nested inline markup
(verbatim + refs) which is currently not possible with RST syntax [1].
There is a possible workaround involving substitution definitions like

  .. |virConnectPtr| replace:: ``virConnectPtr``
  .. _virConnectPtr: /html/libvirt-libvirt-host.html#virConnectPtr

Substitutions cannot be made generic, hence we cannot create a template
for substitution and use a single template everywhere, so we'd end up
with a lot of clutter and convolution. Therefore, we can make an
exception and just link the data type without further style markup.

[1] https://docutils.sourceforge.io/FAQ.html#is-nested-inline-markup-possible

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agodocs: html.in: Convert api_extension to rst
Erik Skultety [Fri, 12 Mar 2021 10:30:33 +0000 (11:30 +0100)] 
docs: html.in: Convert api_extension to rst

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agodocs: html.in: Convert aclpolkit to rst
Erik Skultety [Fri, 12 Mar 2021 10:12:47 +0000 (11:12 +0100)] 
docs: html.in: Convert aclpolkit to rst

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemu_driver: fix setting vcpu_quota if not all vCPUs are online
Pavel Hrdina [Mon, 15 Mar 2021 13:10:45 +0000 (14:10 +0100)] 
qemu_driver: fix setting vcpu_quota if not all vCPUs are online

When switching to g_autoptr this was incorrectly changed from
'continue;' into 'return -1;' resulting into an error when user tries
to set vcpu_quota of running VM:

    error: An error occurred, but the cause is unknown

Fixes: e4a8bbfaf2b4cdd741bb441873bb730f9134b714
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agolib: Put some variable declarations on individual lines
Michal Privoznik [Thu, 11 Mar 2021 14:37:07 +0000 (15:37 +0100)] 
lib: Put some variable declarations on individual lines

In short, virXXXPtr type is going away. With big bang. And to
help us rewrite the code with a sed script, it's better if each
variable is declared on its own line.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirconftypes: Fix name of virCapsGuestArchPtr
Michal Privoznik [Thu, 11 Mar 2021 16:40:15 +0000 (17:40 +0100)] 
virconftypes: Fix name of virCapsGuestArchPtr

The name is supposed to be virCapsGuestArchPtr not ..ptr.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agosyntax-check: Fix and rename virSecurity rule
Michal Privoznik [Thu, 11 Mar 2021 07:29:42 +0000 (08:29 +0100)] 
syntax-check: Fix and rename virSecurity rule

The aim of virSecurity rule is to discourage from using plain
virSecurityManager*() APIs within QEMU driver in favor of their
qemuSecurity*() counterparts. The reason is simple: namespaces;
virSecurityManager*() needs additional
virSecurityManagerTransactionCommit() call to enter given
namespace and do its work from there. And that's exactly what
those qemuSecurity*() wrappers do.

To help us ensure correctness (from this POV), we have a
syntax-check rule that forbids any occurrence of
"virSecurityManager" string under src/qemu/ (except for
qemu_security of course).

But with if we want to remove virSecurityManagerPtr type, then we
have to allow "virSecurityManager *". Therefore, change the rule
so that no call of a function with "virSecurityManager" prefix is
allowed. And also change the name to better reflect what is going
on.

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