]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
4 years agotest_driver: Introduce testDomainObjCheckTaint
Luke Yue [Mon, 12 Jul 2021 11:32:16 +0000 (19:32 +0800)] 
test_driver: Introduce testDomainObjCheckTaint

In order to test the virDomainGetMessages for test driver, we need to
check some taints or deprecations, so introduce testDomainObjCheckTaint
for checking taints.

As we introduced testDomainObjCheckTaint for test driver, the `dominfo`
command in virshtest will now print tainting messages, so add them for
test.

Signed-off-by: Luke Yue <lukedyue@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agotest_driver: Implement virDomainGetMessages
Luke Yue [Mon, 12 Jul 2021 11:32:15 +0000 (19:32 +0800)] 
test_driver: Implement virDomainGetMessages

Signed-off-by: Luke Yue <lukedyue@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agoconf: domain: Introduce and use virDomainObjGetMessages()
Luke Yue [Mon, 12 Jul 2021 11:32:14 +0000 (19:32 +0800)] 
conf: domain: Introduce and use virDomainObjGetMessages()

The test driver and qemu driver could share the same code in
virDomainGetMessages(), so extract it to a function.

Signed-off-by: Luke Yue <lukedyue@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agogitlab: use custom docker:dind image
Daniel P. Berrangé [Tue, 27 Jul 2021 12:21:17 +0000 (13:21 +0100)] 
gitlab: use custom docker:dind image

The current docker:dind container has broken default seccomp filter that
results in clone3 being blocked, which in turn breaks Fedora 35 rawhide.

This custom image has a workaround that causes the seccomp filter to
return ENOSYS for clone3 instad of EPERM, thus triggering glibc to
fallback to clone correctly.

Reviewed-by: Erik Skultety <eskultet@redhat>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu: monitor: remove destroy callback
Ján Tomko [Wed, 21 Jul 2021 12:32:31 +0000 (14:32 +0200)] 
qemu: monitor: remove destroy callback

It was added by commit c2121602 and later removed by 5a4c2374a

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agorpm: fix mingw obsoletes lines
Daniel P. Berrangé [Mon, 2 Aug 2021 10:52:51 +0000 (11:52 +0100)] 
rpm: fix mingw obsoletes lines

The package is mistakenly obsoleting itself, when it should be
obsoleting the -static packages we dropped.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agotestutils: Don't leak @testBitmap and @failedTests
Michal Privoznik [Thu, 29 Jul 2021 13:53:16 +0000 (15:53 +0200)] 
testutils: Don't leak @testBitmap and @failedTests

In virTestMain() the @failedTests bitmap is allocated and
optionally @testBitmap too. But neither of them is freed.

Fixes: 0cd5a726e365e67690a81e3ce33ecd0cb0b5178d
Fixes: cebb468ef5e82b8d4253e27ef70c67812cf93c5a
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovmx: Parse vm.genid
Michal Privoznik [Wed, 28 Jul 2021 11:32:10 +0000 (13:32 +0200)] 
vmx: Parse vm.genid

The VMware metadata file contains genid but we are not parsing
and thus reporting it in domain XML. However, it's not as
straightforward as one might think. The UUID reported by VMware
is not in its usual string form, but split into two signed long
longs. That means, we have to do a bit of trickery when parsing.
But looking around it's the same magic that libguestfs does:

https://github.com/libguestfs/virt-v2v/blob/master/v2v/input_vmx.ml#L421

It's also explained by Rich on qemu-devel:

https://lists.nongnu.org/archive/html/qemu-devel/2018-07/msg02019.html

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1598348
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
4 years agoPost-release version bump to 7.7.0
Jiri Denemark [Mon, 2 Aug 2021 10:27:55 +0000 (12:27 +0200)] 
Post-release version bump to 7.7.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoRelease of libvirt-7.6.0 v7.6.0
Jiri Denemark [Mon, 2 Aug 2021 10:19:19 +0000 (12:19 +0200)] 
Release of libvirt-7.6.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Tue, 27 Jul 2021 18:43:14 +0000 (20:43 +0200)] 
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10349 of 10349 strings)

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

Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
4 years agoUpdate translation files
Weblate [Tue, 27 Jul 2021 18:43:12 +0000 (20:43 +0200)] 
Update translation files

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

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

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
4 years agogitlab: Add disclaimer to the 'feature' issue template
Peter Krempa [Mon, 26 Jul 2021 09:19:35 +0000 (11:19 +0200)] 
gitlab: Add disclaimer to the 'feature' issue template

Add a disclaimer that filing a feature request issue has no guarantees
that anybody will actually implement the feature.

Based on the disclaimer in the QEMU project.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirnvme: Duplicate index in nested loop in virNVMeDeviceListCreateReAttachList v7.6.0-rc2
Jia Zhou [Thu, 29 Jul 2021 15:39:18 +0000 (17:39 +0200)] 
virnvme: Duplicate index in nested loop in virNVMeDeviceListCreateReAttachList

When loop in function virNVMeDeviceListCreateReAttachList() there may be
reused index @i, this patch fix this by using a new @j.

Signed-off-by: Jia Zhou <zhou.jia2@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoNEWS: Add haltpolling time statistic interface
Yang Fei [Thu, 29 Jul 2021 10:55:36 +0000 (18:55 +0800)] 
NEWS: Add haltpolling time statistic interface

Signed-off-by: Yang Fei <yangfei85@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agorpm: properly disable -Werror
Daniel P. Berrangé [Wed, 28 Jul 2021 14:13:48 +0000 (15:13 +0100)] 
rpm: properly disable -Werror

Since we use git to manage RPM applied patches, we need to disable both
meson's -Werror config knob and libvirt's equivalent.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoNEWS: Fix false positive of sc_prohibit_doubled_word
Michal Privoznik [Wed, 28 Jul 2021 15:43:05 +0000 (17:43 +0200)] 
NEWS: Fix false positive of sc_prohibit_doubled_word

In the previous commit we've added a sentence into NEWS.rst that
supposedly contains doubled word. Well, it doesn't really.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoNEWS: Add new launch security type s390-pv
Boris Fiuczynski [Wed, 28 Jul 2021 12:36:00 +0000 (14:36 +0200)] 
NEWS: Add new launch security type s390-pv

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Viktor Mihajlovski <mihajlov@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoNEWS: Mention fix for 'copy_on_read' disks with trimming enabled
Peter Krempa [Wed, 28 Jul 2021 07:38:44 +0000 (09:38 +0200)] 
NEWS: Mention fix for 'copy_on_read' disks with trimming enabled

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
4 years agoqemu: block: Pass discard requests through the copy-on-read block filter
Peter Krempa [Tue, 27 Jul 2021 17:12:09 +0000 (19:12 +0200)] 
qemu: block: Pass discard requests through the copy-on-read block filter

We need to pass the 'trim' requests through the copy-on-read filter so
if a user configures a discard policy on the disk the requests get
through to the appropriate format layer in the blockdev tree.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1986509
Reported-by: Richard W.M. Jones <rjones@redhat.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
4 years agoNEWS: Mention change to VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD
Peter Krempa [Tue, 27 Jul 2021 12:39:06 +0000 (14:39 +0200)] 
NEWS: Mention change to VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoNEWS: Mention security bug in storage pool object lookup (CVE-2021-3667)
Peter Krempa [Tue, 27 Jul 2021 12:36:30 +0000 (14:36 +0200)] 
NEWS: Mention security bug in storage pool object lookup (CVE-2021-3667)

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoNEWS: Use 'code' style for constant names in entry for recent migration fix
Peter Krempa [Tue, 27 Jul 2021 12:39:51 +0000 (14:39 +0200)] 
NEWS: Use 'code' style for constant names in entry for recent migration fix

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agopo: Refresh potfile for v7.6.0 v7.6.0-rc1
Pavel Hrdina [Tue, 27 Jul 2021 17:30:55 +0000 (19:30 +0200)] 
po: Refresh potfile for v7.6.0

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoschema: make target mandatory for filesystems
Ján Tomko [Tue, 27 Jul 2021 10:39:50 +0000 (12:39 +0200)] 
schema: make target mandatory for filesystems

Commit 12967c3e13 incorrectly made the target optional.
The validation was re-introduced by commit e8863b91f (which
put it into FSDefValidate instead of the parser), but
it did not amend the schema to make it mandatory again.

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

Fixes: e8863b91fb98f077d4c44a11bd7ea84c5e6b29ef
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agogitlab: let rawhide container builds fail
Daniel P. Berrangé [Mon, 26 Jul 2021 09:35:41 +0000 (10:35 +0100)] 
gitlab: let rawhide container builds fail

The nature of Fedora rawhide means that it will inevitably have failures
periodically. Currently it is failing to even update packages due to
glibc switching to use of clone3 syscall, which is mistakenly blocked by
seccomp in container runtimes using EPERM instead of ENOSYS.

When we fail to build the rawhide containers, it is quite likely that we
still have the previous build available in the gitlab registry, so it is
reasonable to allow the container job to fail and try the build job
anyway.

Ideally we would ignore the container build failure if-and-only-if the
previous container was build with the same list of packages. We don't
record the original dependency package list though, so that's not
currently possible.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu: Introduce qemuDomainGetStatsCpuHaltPollTime
Yang Fei [Thu, 22 Jul 2021 08:05:02 +0000 (16:05 +0800)] 
qemu: Introduce qemuDomainGetStatsCpuHaltPollTime

This function add halt polling time interface in domstats. So that
we can use command 'virsh domstats VM' to get the data if system
support.

Signed-off-by: Yang Fei <yangfei85@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoutil: Add virHostCPUGetHaltPollTime
Yang Fei [Thu, 22 Jul 2021 08:05:01 +0000 (16:05 +0800)] 
util: Add virHostCPUGetHaltPollTime

Add helper function virHostCPUGetHaltPollTime to obtain halt polling
time. If the kernel support halt polling time statistic, and mount
debugfs. This function will take effect on KVM VMs.

Signed-off-by: Yang Fei <yangfei85@huawei.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoutil: Add virFileReadValueUllongQuiet
Yang Fei [Thu, 22 Jul 2021 08:05:00 +0000 (16:05 +0800)] 
util: Add virFileReadValueUllongQuiet

Use function virFileReadValueUllongQuiet to read unsigned long
long value without error report.

Signed-off-by: Yang Fei <yangfei85@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agosecurityselinuxlabeltest: Add debug statements for testUserXattrEnabled return value
Peter Krempa [Fri, 23 Jul 2021 13:25:44 +0000 (15:25 +0200)] 
securityselinuxlabeltest: Add debug statements for testUserXattrEnabled return value

I've noticed the test being skipped in my build scenario (tmpfs) and
the output doesn't make it clear why it's happening.

Add debug statements for the various return values of
testUserXattrEnabled.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoNEWS: Mention enablement of incremental backups
Peter Krempa [Fri, 23 Jul 2021 09:36:24 +0000 (11:36 +0200)] 
NEWS: Mention enablement of incremental backups

Now that 'blockdev-reopen' will be stable in the upcoming qemu versions
we can finally enable incremental backups.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoqemu: capabilities: Enable detection of QEMU_CAPS_BLOCKDEV_REOPEN
Peter Krempa [Tue, 3 Nov 2020 08:16:30 +0000 (09:16 +0100)] 
qemu: capabilities: Enable detection of QEMU_CAPS_BLOCKDEV_REOPEN

Base it on the presence of the "blockdev-reopen" QMP command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoqemumonitorjsontest: Add test case for 'blockdev-reopen'
Peter Krempa [Mon, 22 Feb 2021 16:59:28 +0000 (17:59 +0100)] 
qemumonitorjsontest: Add test case for 'blockdev-reopen'

Export 'qemuBlockReopenFormatMon' and use it in a new test case wich
will validate the arguments against the QMP schema.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoqemuBlockReopenFormatMon: Adapt to new argument format of 'blockdev-reopen'
Peter Krempa [Mon, 22 Feb 2021 16:55:12 +0000 (17:55 +0100)] 
qemuBlockReopenFormatMon: Adapt to new argument format of 'blockdev-reopen'

This function was added prior 'blockdev-reopen' being stable and qemu
changed the arguments to actually contain an array of block node
definitions to reopen.

In our case we are just changing between read-only and read-write modes
and thus we can keep operating on the nodes one-by-one.

Modify the code to add the wrapper array.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoqemuBlockReopenFormat: Extract @src handling and monitor invocation
Peter Krempa [Mon, 22 Feb 2021 16:55:01 +0000 (17:55 +0100)] 
qemuBlockReopenFormat: Extract @src handling and monitor invocation

This will simplify testing of the blockdev-reopen code once it's
enabled.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agotests: qemucapabilities: Update capabilities for qemu-6.1.0-rc0 on x86_64
Peter Krempa [Thu, 22 Jul 2021 07:09:07 +0000 (09:09 +0200)] 
tests: qemucapabilities: Update capabilities for qemu-6.1.0-rc0 on x86_64

Update to v6.1.0-rc0-48-g7b7ca8ebde

Notable changes are:
 - stabilization of 'blockdev-reopen'
 - addition of the 'vmx-tsc-scaling' cpu flag
 - Supported display types are now in the schema only if they are compiled in.
 - rbd image encryption
 - 'aio-max-batch' iothread property

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoqemu_vhost_user: don't raise error for unknown features
Cole Robinson [Fri, 23 Jul 2021 19:42:16 +0000 (15:42 -0400)] 
qemu_vhost_user: don't raise error for unknown features

Similar to what was done for qemu_firmware.c in 61d95a1073, don't
report an error for unknown vhost-user features, just log it and
correctly continue on

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
4 years agoqemuDomainObjPrivateAlloc: Fix unlikely memory leak
Peter Krempa [Fri, 23 Jul 2021 08:55:20 +0000 (10:55 +0200)] 
qemuDomainObjPrivateAlloc: Fix unlikely memory leak

Additional cleanup paths add the possibility of not freeing earlier
stuff. Add an AUTOPTR handler for qemuDomainObjPrivate and use it in
qemuDomainObjPrivateAlloc

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
4 years agoqemu: domain: Move qemuDomainObjPrivateAlloc after qemuDomainObjPrivateFree
Peter Krempa [Fri, 23 Jul 2021 08:51:08 +0000 (10:51 +0200)] 
qemu: domain: Move qemuDomainObjPrivateAlloc after qemuDomainObjPrivateFree

The freeing function will be needed to undo failures in allocation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
4 years agovirNetworkObjNew: Remove impossible error handling
Peter Krempa [Fri, 23 Jul 2021 08:46:40 +0000 (10:46 +0200)] 
virNetworkObjNew: Remove impossible error handling

'obj->classIdMap' is a bitmap with size of '16', thus the first 3 bits
are guaranteed to be available. Use 'virBitmapSetBit' instead of
'virBitmapSetBitExpand' since we don't need any expansion and ignore
errors as they are impossible.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
4 years agovirDomainDefValidateAliases: Refactor to avoid cleanup section
Peter Krempa [Fri, 23 Jul 2021 08:43:12 +0000 (10:43 +0200)] 
virDomainDefValidateAliases: Refactor to avoid cleanup section

Use a temporary auto-freed local variable to hold the hash table so that
the cleanup section can be removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
4 years agoqemuBlockNodeNameGetBackingChain: Shuffle around variable initialization
Peter Krempa [Fri, 23 Jul 2021 08:39:54 +0000 (10:39 +0200)] 
qemuBlockNodeNameGetBackingChain: Shuffle around variable initialization

Allocate the hash tables first so tat the 'data' struct can be directly
initialized removing the need for a memset and two additional
assignments.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
4 years agohypervCreateEmbeddedParam: Don't count elements needlessly
Peter Krempa [Fri, 23 Jul 2021 08:38:08 +0000 (10:38 +0200)] 
hypervCreateEmbeddedParam: Don't count elements needlessly

'count' is not used after calculating it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
4 years agovirHashNew: Ensure return value is used
Peter Krempa [Fri, 23 Jul 2021 08:36:36 +0000 (10:36 +0200)] 
virHashNew: Ensure return value is used

Declare the function with G_GNUC_WARN_UNUSED_RESULT as we always want to
use the returned value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
4 years agovirStoragePoolObjListNew: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 11:33:59 +0000 (13:33 +0200)] 
virStoragePoolObjListNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirLockSpaceNewPostExecRestart: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 15:02:17 +0000 (17:02 +0200)] 
virLockSpaceNewPostExecRestart: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agodocs: Fix two spelling mistakes
Tim Wiederhake [Mon, 26 Jul 2021 08:10:12 +0000 (10:10 +0200)] 
docs: Fix two spelling mistakes

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirSetUIDGIDWithCaps: Set bounding capabilities only with CAP_SETPCAP
Michal Privoznik [Thu, 22 Jul 2021 12:26:00 +0000 (14:26 +0200)] 
virSetUIDGIDWithCaps: Set bounding capabilities only with CAP_SETPCAP

In one of my previous patches I've tried to postpone dropping
CAP_SETPCAP until the very end because it's needed for
capng_apply(). What I did not realize back then was that we might
not have the capability to begin with. Because of unknown reasons
capng_apply() pollutes logs only for CAPNG_SELECT_BOUNDS and not
for CAPNG_SELECT_CAPS.

Reproducer is really simple: run libvirtd as a regular user.
During its initialization, libvirtd will spawn some binaries
(dnsmasq, qemu-*, etc.) and while doing so it will try to drop
capabilities.

Anyway, let's call capng_apply(CAPNG_SELECT_BOUNDS) only if we
have the CAP_SETPCAP (which is tracked in need_setpcap variable).

Fixes: 438b50dda8a863fdc988e9ab612f097cc1626e8a
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1924218
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
4 years agovirSetUIDGIDWithCaps: Drop redundant parenthesis around capng_apply()
Michal Privoznik [Thu, 22 Jul 2021 12:12:14 +0000 (14:12 +0200)] 
virSetUIDGIDWithCaps: Drop redundant parenthesis around capng_apply()

After all capabilities were set (except for CAP_SETGID,
CAP_SETUID and CAP_SETPCAP) and after UID:GID was changed we drop
the last aforementioned capabilities (we couldn't drop them
before because we needed UID:GID and capabilities change).
Therefore, there's final capng_apply() call. However, it is
wrapped in one layer of parenthesis more than needed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoTranslated using Weblate (German)
Christian Kirbach [Thu, 22 Jul 2021 13:07:58 +0000 (15:07 +0200)] 
Translated using Weblate (German)

Currently translated at 49.6% (5132 of 10342 strings)

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

Co-authored-by: Christian Kirbach <christian.kirbach@gmail.com>
Signed-off-by: Christian Kirbach <christian.kirbach@gmail.com>
4 years agoTranslated using Weblate (Czech)
Matej Cepl [Thu, 22 Jul 2021 13:07:58 +0000 (15:07 +0200)] 
Translated using Weblate (Czech)

Currently translated at 88.2% (9124 of 10342 strings)

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

Co-authored-by: Matej Cepl <mcepl@cepl.eu>
Signed-off-by: Matej Cepl <mcepl@cepl.eu>
4 years agoTranslated using Weblate (Korean)
simmon [Thu, 22 Jul 2021 13:07:57 +0000 (15:07 +0200)] 
Translated using Weblate (Korean)

Currently translated at 45.2% (4679 of 10342 strings)

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

Translated using Weblate (Korean)

Currently translated at 45.1% (4674 of 10342 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 agosrc: workaround warning triggered in glib 2.69
Daniel P. Berrangé [Fri, 23 Jul 2021 12:41:02 +0000 (13:41 +0100)] 
src: workaround warning triggered in glib 2.69

Libvirt is using the G_GNUC_FALLTHROUGH macro provided by glib since
version 2.60. Since we need to support older glib, we also have some
compatibility code to define it if missing.

We set the GLIB_VERSION_MAX_ALLOWED macro to ensure we get warnings
when we use an API that dates from a glib version newer than our
minimum benchmark. Historically this didn't get enforced for (most)
macros, but GLib 2.69 has addressed that gap.

This causes our usage of G_GNUC_FALLTHROUGH to trigger warnings.
GLib is right to warn, because it does not know that we have added
our own fallback for older versions.

The only way to squelch this warning though, is to fully undefine
the GLib provided G_GNUC_FALLTHROUGH and use our own in its place.
We'll be able to remove all this compat burden when we finally
update the min glib version to be >= 2.60

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agostorage: create logical volume with --yes option
Kristina Hanicova [Thu, 22 Jul 2021 09:45:52 +0000 (11:45 +0200)] 
storage: create logical volume with --yes option

If lvcreate found an existing signature when trying to create a
new logical volume (E.g. left after some deleted volume), the
action failed due to inability to answer interactive question to
wiping it (lvcreate assumed 'no' was the answer). With added
option --yes to the command line, the answer to any interactive
question is assumed to be yes. Therefore, lvcreate wipes the
signature and the new volume is created successfully.

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

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirStorageVolObjListNew: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 11:34:44 +0000 (13:34 +0200)] 
virStorageVolObjListNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirSecuritySELinuxQEMUInitialize: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 11:33:09 +0000 (13:33 +0200)] 
virSecuritySELinuxQEMUInitialize: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirSecuritySELinuxLXCInitialize: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 11:32:29 +0000 (13:32 +0200)] 
virSecuritySELinuxLXCInitialize: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirQEMUCapsProbeQMPHostCPU: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 11:31:12 +0000 (13:31 +0200)] 
virQEMUCapsProbeQMPHostCPU: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNodeDeviceObjListNew: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 08:06:35 +0000 (10:06 +0200)] 
virNodeDeviceObjListNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNetworkObjNew: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 07:16:06 +0000 (09:16 +0200)] 
virNetworkObjNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNetworkObjListNew: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 07:13:54 +0000 (09:13 +0200)] 
virNetworkObjListNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNetDaemonNew: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 07:13:02 +0000 (09:13 +0200)] 
virNetDaemonNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirLockSpaceNew: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 15:01:54 +0000 (17:01 +0200)] 
virLockSpaceNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirLockDaemonNewPostExecRestart: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 15:01:25 +0000 (17:01 +0200)] 
virLockDaemonNewPostExecRestart: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirLockDaemonNew: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 15:00:47 +0000 (17:00 +0200)] 
virLockDaemonNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirInterfaceObjListNew: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:59:53 +0000 (16:59 +0200)] 
virInterfaceObjListNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirHashAtomicNew: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:59:17 +0000 (16:59 +0200)] 
virHashAtomicNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirFileCacheNew: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:58:22 +0000 (16:58 +0200)] 
virFileCacheNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirDomainObjListNew: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:57:21 +0000 (16:57 +0200)] 
virDomainObjListNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirDomainMomentObjListNew: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:56:09 +0000 (16:56 +0200)] 
virDomainMomentObjListNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirDomainDefValidateAliases: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:55:37 +0000 (16:55 +0200)] 
virDomainDefValidateAliases: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirDomainDefBootOrderPostParse: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:54:01 +0000 (16:54 +0200)] 
virDomainDefBootOrderPostParse: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirDomainCCWAddressSetCreate: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:53:01 +0000 (16:53 +0200)] 
virDomainCCWAddressSetCreate: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirCloseCallbacksNew: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:52:11 +0000 (16:52 +0200)] 
virCloseCallbacksNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirChrdevAlloc: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 14:51:35 +0000 (16:51 +0200)] 
virChrdevAlloc: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemuInteropFetchConfigs: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 13:56:00 +0000 (15:56 +0200)] 
qemuInteropFetchConfigs: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemuDomainObjPrivateAlloc: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 13:55:20 +0000 (15:55 +0200)] 
qemuDomainObjPrivateAlloc: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemuBlockNodeNameGetBackingChain: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 13:53:56 +0000 (15:53 +0200)] 
qemuBlockNodeNameGetBackingChain: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemuBlockNodeNamesDetect: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 13:49:26 +0000 (15:49 +0200)] 
qemuBlockNodeNamesDetect: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agolibxlLoggerNew: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 13:47:52 +0000 (15:47 +0200)] 
libxlLoggerNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemusecuritymock: init_hash: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 13:42:46 +0000 (15:42 +0200)] 
qemusecuritymock: init_hash: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agohypervCreateEmbeddedParam: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 13:41:27 +0000 (15:41 +0200)] 
hypervCreateEmbeddedParam: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoebiptablesApplyNewRules: `virHashNew` cannot return NULL
Tim Wiederhake [Mon, 5 Jul 2021 13:40:33 +0000 (15:40 +0200)] 
ebiptablesApplyNewRules: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterRuleDefToRuleInst: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 11:29:59 +0000 (13:29 +0200)] 
virNWFilterRuleDefToRuleInst: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterCreateVarsFrom: Remove superfluous `goto`s
Tim Wiederhake [Tue, 6 Jul 2021 11:43:28 +0000 (13:43 +0200)] 
virNWFilterCreateVarsFrom: Remove superfluous `goto`s

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterCreateVarsFrom: Use automatic memory management
Tim Wiederhake [Tue, 6 Jul 2021 08:20:38 +0000 (10:20 +0200)] 
virNWFilterCreateVarsFrom: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterCreateVarsFrom: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 08:20:07 +0000 (10:20 +0200)] 
virNWFilterCreateVarsFrom: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirSystemdActivationNew: Remove superfluous `goto`s
Tim Wiederhake [Tue, 6 Jul 2021 11:38:53 +0000 (13:38 +0200)] 
virSystemdActivationNew: Remove superfluous `goto`s

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirSystemdActivationNew: Use automatic memory management
Tim Wiederhake [Tue, 6 Jul 2021 11:38:05 +0000 (13:38 +0200)] 
virSystemdActivationNew: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirSystemdActivationNew: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 11:36:19 +0000 (13:36 +0200)] 
virSystemdActivationNew: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNWFilterLearnInit: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 08:27:16 +0000 (10:27 +0200)] 
virNWFilterLearnInit: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirNWFilterIPAddrMapInit: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 08:26:21 +0000 (10:26 +0200)] 
virNWFilterIPAddrMapInit: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirNWFilterDoInstantiate: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 08:25:30 +0000 (10:25 +0200)] 
virNWFilterDoInstantiate: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirNWFilterParseParamAttributes: Remove superfluous `goto`s
Tim Wiederhake [Wed, 14 Jul 2021 09:11:01 +0000 (11:11 +0200)] 
virNWFilterParseParamAttributes: Remove superfluous `goto`s

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirNWFilterParseParamAttributes: Simplify loop body
Tim Wiederhake [Wed, 14 Jul 2021 09:08:50 +0000 (11:08 +0200)] 
virNWFilterParseParamAttributes: Simplify loop body

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirNWFilterParseParamAttributes: Use automatic memory management
Tim Wiederhake [Wed, 14 Jul 2021 08:49:23 +0000 (10:49 +0200)] 
virNWFilterParseParamAttributes: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirNWFilterParseParamAttributes: Remove tautological `if`
Tim Wiederhake [Wed, 14 Jul 2021 08:42:58 +0000 (10:42 +0200)] 
virNWFilterParseParamAttributes: Remove tautological `if`

`cur` is guaranteed to be of type `XML_ELEMENT_NODE` by using
`xmlFirstElementChild()` and `xmlNextElementSibling()`.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirNWFilterParseParamAttributes: Iterate over "element" children
Tim Wiederhake [Tue, 6 Jul 2021 08:35:27 +0000 (10:35 +0200)] 
virNWFilterParseParamAttributes: Iterate over "element" children

"xmlNextElementSibling()" skips attribute nodes, making the explicit
check for the type of `cur` redundant. This prepares for the removal
of this check in the next commit.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agovirNWFilterParseParamAttributes: `virHashNew` cannot return NULL
Tim Wiederhake [Tue, 6 Jul 2021 08:30:34 +0000 (10:30 +0200)] 
virNWFilterParseParamAttributes: `virHashNew` cannot return NULL

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoconf: Add AUTOPTR_CLEANUP_FUNC for virNWFilterVarValue
Tim Wiederhake [Tue, 6 Jul 2021 09:09:56 +0000 (11:09 +0200)] 
conf: Add AUTOPTR_CLEANUP_FUNC for virNWFilterVarValue

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>