Commit Graph

42694 Commits

Author SHA1 Message Date
Peter Krempa
98f6f2081d util: alloc: Reimplement VIR_APPEND_ELEMENT using virAppendElement
Use virAppendElement instead of virInsertElementsN to implement
VIR_APPEND_ELEMENT which allows us to remove error handling as the
only relevant errors were removed when switching to aborting memory
allocation functions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00
Peter Krempa
8c22b28dbe util: alloc: Reimplement VIR_APPEND_ELEMENT_QUIET using virAppendElement
For now it was an alias to VIR_APPEND_ELEMENT. Use virAppendElement
directly until VIR_APPEND_ELEMENT is refactored too and we'll be able to
get rid of VIR_APPEND_ELEMENT_QUIET completely.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00
Peter Krempa
592517636f util: alloc: Reimplement VIR_APPEND_ELEMENT_COPY using virAppendElement
Use virAppendElement instead of virInsertElementsN to implement
VIR_APPEND_ELEMENT_COPY which allows us to remove error handling as the
only relevant errors were removed when switching to aborting memory
allocation functions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00
Peter Krempa
0215139bc6 util: alloc: Reimplement VIR_APPEND_ELEMENT_(COPY_)INPLACE using virAppendElement
VIR_APPEND_ELEMENT_INPLACE and VIR_APPEND_ELEMENT_COPY_INPLACE already
ignore the return value from 'virInsertElementsN' which allows a trivial
conversion to virAppendElement without the need for 'ignore_value'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00
Peter Krempa
51c8245847 util: alloc: Introduce virAppendElement helper
The new wrapper calls virInsertElementInternal with the appropriate
arguments without any checks which are unnecessary for appension. This
allows to have no return value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00
Peter Krempa
853fb577d8 virInsertElementsN: Split out actual insertion code
Split out the code doing the movement of the elements and insertion from
the range checks. This will help in adding an error-free version for
appension.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00
Peter Krempa
05b69f3ec4 virInsertElementsN: Rename 'add' argument
The idea of @add was that the insersion/appension macros would allow
adding more than one element but this feature was never implemented.

'add' is nowadays used as a dummy variable consuming the result of the
VIR_TYPEMATCH compile time check.

Make it obvious that we don't use 'add' by renaming it to
'typematchDummy', marking it as unused and replacing all occurences
where the value was used by literal '1'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 08:53:25 +02:00
Michal Privoznik
73890139bf tests: Don't leak cpu defs
There are cpu definitions that are allocated in
qemuTestDriverInit() but are missing corresponding
virCPUDefFree() call in qemuTestDriverFree(). It's safe to call
the free function because the definitions contain a refcounter
and thus even if they were still in use the refcounter would be
just decreased.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-08-05 14:53:19 +02:00
Ján Tomko
ca4f9e403f util: fix typo
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-05 11:18:13 +02:00
Ján Tomko
ca43a5198a qemu: virtiofs: kill the whole process group
Send TERM/KILL to virtiofsd and its child processes too
and do not exit until they are all dead.

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Tested-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
2021-08-05 11:18:13 +02:00
Ján Tomko
ff7b8043b6 util: virPidFileForceCleanupPath: add group argument
Add a version of virPidFileForceCleanupPath that takes
a 'group' bool argument and propagate it all the way
down to virProcessKillPainfullyDelay.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-05 11:18:09 +02:00
Ján Tomko
4b39c2aa2e util: introduce virProcessGroupGet
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-05 11:18:05 +02:00
Ján Tomko
fc180c741f util: Introduce virProcessGroupKill
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-05 11:18:00 +02:00
Daniel P. Berrangé
5998497d5f rpm: use direct remote connection for Fedora >= 35 / RHEL >= 9
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-08-04 16:06:11 +01:00
Daniel P. Berrangé
50eae3f885 rpm: handle enabling/disabling modular daemons post/postun-install
We need to enable or disable the modular daemons with systemd after the
RPM install/uninstall.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-08-04 15:59:15 +01:00
Daniel P. Berrangé
a97c2b14b2 rpm: macroize logic for enabling/disabling daemons post/postun-install
The patterns for enabling/disabling daemons post/postun-install has a
bit of duplication across the different part of the spec, due to the
number of socket units involved. This is going to get much worse with
the need to enable/disalbe modular daemons, so benefits from macroization.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-08-04 15:59:11 +01:00
Daniel P. Berrangé
b8ef625544 rpm: restart modular daemons on upgrade
The daemons all need restarting to ensure they pick up the newly
installed code.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-08-04 15:58:28 +01:00
Daniel P. Berrangé
c2eafaf7a3 rpm: restart virtnwfilter/virnetworkd if configs change
Currently we restart libvirtd if the nwfilter/network configs have
changed. We need to take account of possibility that the modular
daemons are in use instead though.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-08-04 15:57:45 +01:00
Daniel P. Berrangé
b5e8db8f14 rpm: macroize logic for restarting daemons post-transaction
The patterns for restarting daemons post-transaction has a bit of
duplication across the different part of the spec. This is going to
get much worse with the need to restart modular daemons, so benefits
from macroization.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-08-04 15:56:35 +01:00
Tim Wiederhake
49d2a42b69 virNWFilterParseParamAttributes: Simplify loop
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-08-04 10:39:27 +02:00
Andrea Bolognani
b298fc142f tests: Test pcie-expander-bus for aarch64/virt guests
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-04 09:58:16 +02:00
Andrea Bolognani
f225ef2a04 qemu: Allow pcie-expander-bus for aarch64/virt guests
Starting with QEMU 6.0, this controller is enabled by default
on aarch64.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-04 09:58:14 +02:00
Andrea Bolognani
e9e0876a96 tests: Add capabilities for QEMU 6.0 on aarch64
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-04 09:58:09 +02:00
Andrea Bolognani
d55547ec37 ci: Adapt to lcitool command line changes
lcitool now uses the term "target" instead of "host" to refer to
the various operating systems it supports, and we need to adapt
our helper script so that it works with the new command line
interface.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2021-08-04 09:52:28 +02:00
Kristina Hanicova
814a8aaeeb qemu_migration: check for interface type 'hostdev'
When we try to migrate vm, we check if it contains only devices
that are able to migrate. If a hostdev device is not able to
migrate we raise an error with <hostdev/>, but it can actually be
<interface/>, so we need to check if hostdev device was created
by us from interface and show the right error message.

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

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-03 16:07:53 +02:00
Luke Yue
8d90bf34f5 examples: test: Add a new test xml with more tainted configs for testing
Signed-off-by: Luke Yue <lukedyue@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2021-08-03 14:22:10 +02:00
Luke Yue
7c399a9b0e 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>
2021-08-03 14:22:10 +02:00
Luke Yue
68095b835f test_driver: Implement virDomainGetMessages
Signed-off-by: Luke Yue <lukedyue@gmail.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2021-08-03 14:22:09 +02:00
Luke Yue
8a7cfb10b8 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>
2021-08-03 14:22:08 +02:00
Daniel P. Berrangé
444c7c2725 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>
2021-08-02 16:49:49 +01:00
Ján Tomko
e0e72ce8bc 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>
2021-08-02 17:08:01 +02:00
Daniel P. Berrangé
39ed30d4a1 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>
2021-08-02 13:47:20 +01:00
Michal Privoznik
77f7067059 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: 0cd5a726e3
Fixes: cebb468ef5
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-08-02 14:14:33 +02:00
Michal Privoznik
7d661d6e20 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>
2021-08-02 12:54:17 +02:00
Jiri Denemark
919f25d36e Post-release version bump to 7.7.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-08-02 12:27:55 +02:00
Jiri Denemark
98c65e6d1e Release of libvirt-7.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2021-08-02 12:19:19 +02:00
Yuri Chornoivan
702d6d04ce 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>
2021-07-30 15:28:34 +02:00
Weblate
cb891d0b50 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>
2021-07-30 15:28:34 +02:00
Peter Krempa
aa7ddeb53f 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>
2021-07-30 15:26:45 +02:00
Jia Zhou
bae39ea871 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>
2021-07-29 17:44:38 +02:00
Yang Fei
a64de8994f NEWS: Add haltpolling time statistic interface
Signed-off-by: Yang Fei <yangfei85@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-29 17:24:32 +02:00
Daniel P. Berrangé
f5c022a389 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>
2021-07-28 17:33:43 +01:00
Michal Privoznik
efa367cbd5 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>
2021-07-28 17:43:05 +02:00
Boris Fiuczynski
cd0adbc0bc 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>
2021-07-28 17:09:13 +02:00
Peter Krempa
d44ec08cb3 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>
2021-07-28 15:18:18 +02:00
Peter Krempa
dc0b9c8376 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>
2021-07-28 15:18:18 +02:00
Peter Krempa
388df6f76a 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>
2021-07-28 08:10:20 +02:00
Peter Krempa
f379aabc74 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>
2021-07-28 08:10:20 +02:00
Peter Krempa
d26efd8be9 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>
2021-07-28 08:10:20 +02:00
Pavel Hrdina
776cc0e3fe po: Refresh potfile for v7.6.0
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2021-07-27 19:30:55 +02:00