Commit Graph

38265 Commits

Author SHA1 Message Date
Ján Tomko
a7d7c2a451 conf: pass elementName to virDomainThreadSchedParseHelper
Pass the scheduler element name instead of trying to reconstructing
it from the attribute name.

This has the benefit of not mixing '%s' with regular text in
translatable strings as well as preventing the confusion when
the 's' marking the plural in the element name ('vcpus') is taken
as a first letter of the 'sched' suffix.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 7ea55a481d
Fixes: 99c5fe0e7c
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-08-03 07:23:45 +02:00
Ján Tomko
dd44868423 conf: rename 'name' in scheduler parser
virDomainThreadSchedParseHelper is used for parsing both iothread
and vcpu scheduling settings. Rename its 'name' attribute to
make it obvious this refers to the attribute name, not the name of
the element (which is currently constructed from the attribute name).

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-08-03 07:23:45 +02:00
Ján Tomko
31c69e188c ci: move sanity_checks after other stages
Be less hostile to developers and run the build jobs even
if the dco-check failed. That way they can test their own
"private" branches without a sign-off.

Also specify empty `needs` for it, since it does not depend
on any of the jobs in the container phase and can be run
right away.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-08-03 07:23:45 +02:00
Peter Krempa
00bb850eb0 qemu: snapshot: Collect 'query-named-block-nodes' prior to memory migration
When doing an external snapshot we migrate memory to a file as a form of
taking the memory state. This creates a problem as qemu deactivates all
active bitmaps after a successful migration. This means that calling
'query-named-block-nodes' will return an empty list of bitmaps for
devices. We use the bitmap list to propagate the active bitmaps into the
overlay files being created which is required for backups to work after
a snapshot. Since we wouldn't propagate anything a subsequent backup
will fail with:

invalid argument: missing or broken bitmap 'testchck' for disk 'vda'

To fix this, we can simply collect the bitmap list prior to the
migration.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2020-08-03 07:17:38 +02:00
Jiri Denemark
60f6f16c0c Post-release version bump to 6.7.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2020-08-03 00:21:59 +02:00
Jiri Denemark
da94294404 Release of libvirt-6.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2020-08-03 00:20:01 +02:00
Michal Privoznik
3c76ee42e7 NEWS: Document changes for upcoming release
In contrast with other releases, this time NEWS is pretty much
updated. I've identified only a couple of features/bug fixes
worth mentioning that were not mentioned yet.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-07-31 17:39:31 +02:00
Peter Krempa
b8616c6d5c NEWS: Mention fixes and improvements of BLOCK_THRESHOLD and TLS key tencryption
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-07-31 12:33:21 +02:00
Peter Krempa
7877e0d2e4 tests: qemucapabitilies: Bump for 5.1 caps to rc2 for x86_64
Note that 'numa-mem-supported' turned off for certain machine types
which in turn forced us to generate a newer command line in certain
tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-31 10:27:51 +02:00
Peter Krempa
bfe82ec142 tests: qemuxml2argv: Lock in "disk-network-tlsx509-vxhs" case to qemu-5.0.0
QEMU 5.1 will drop the vxhs driver.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-31 10:27:51 +02:00
Peter Krempa
e34097750a tests: qemu: Split NBD and VXHS protocol tests
QEMU is going to drop 'vxhs' in the upcoming release so we'll need to
track these separately to prevent test suite breakage.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-31 10:27:50 +02:00
Peter Krempa
4a2cbf2108 tests: qemuxml2argv: Use only modern versions of 'disk-network-tlsx509' test
We already test with real caps so there's no real need for this special
case. While it technically tested the state without TLS encryption key
secrets, it doesn't really matter that much.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-31 10:27:50 +02:00
Hao Wang
f7f5b86be2 virNodeDevPCICapSRIOVVirtualParseXML: fix memleak of addr
virPCIDeviceAddressPtr 'addr' is forgotten to be freed in the branch
'VIR_APPEND_ELEMENT() < 0'. Use g_autoptr instead.

Signed-off-by: Hao Wang <wanghao232@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-30 17:52:47 +02:00
Han Han
347de9b3c0 docs: Mention supported hypervisor of transient element
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-30 10:47:34 +02:00
Zheng Chuan
ffa7fab440 qemu: fix memory leak in qemuDomainSaveInternal()
Use g_autoptr to free the temporary virDomainDef object created by
qemuDomainSaveInternal() when xmlin is non-NULL. Leak was added in
commit 0ea479f8f6, first appearing in libvirt 0.9.4 in August 2011.

Signed-off-by: Zheng Chuan <zhengchuan@huawei.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2020-07-29 15:47:24 -04:00
Andrea Bolognani
8a4f807536 ci: Use correct name for armv7l architecture
Turns out 'ldebian' was not a typo, but rather the result of
mistakenly shifting the dash in 'armv7l-debian' one spot to the
left.

Fixes: 821100e812
Reported-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-07-29 10:55:01 +02:00
Andrea Bolognani
821100e812 ci: Fix typo 'ldebian'
Fixes: 95abbdc432
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-07-29 10:21:24 +02:00
Paulo de Rezende Pinatti
42db3cc265 docs: fix name of file containing max number of VFs
Signed-off-by: Paulo de Rezende Pinatti <ppinatti@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-07-28 19:20:02 +02:00
Nikolay Shirokovskiy
2c206f2006 src: add missing balloon stats docs
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-28 17:31:53 +02:00
Nikolay Shirokovskiy
b246267170 docs: add missing iothread stats docs in domstats
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-28 17:27:21 +02:00
Nikolay Shirokovskiy
061565f918 docs: add missing balloon stats docs in domstats
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-28 17:26:16 +02:00
Nikolay Shirokovskiy
188a71c8eb lib: clarify docs for hugetlb in virDomainMemoryStatTags
The term number is used for other stats and even for hugetlb
stats in virsh man page. The term number is also more clear.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-28 17:24:39 +02:00
Nikolay Shirokovskiy
1ae53c027b docs: fix typo in virsh.rst for balloon.major_fault
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-07-28 17:19:57 +02:00
Piotr Drąg
c9da4ae909 Translated using Weblate (Polish)
Currently translated at 23.5% (2437 of 10349 strings)

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

Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
2020-07-27 19:11:39 +02:00
Szymon Scholz
4e2d4d5a51 Translated using Weblate (Polish)
Currently translated at 23.4% (2432 of 10349 strings)

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

Signed-off-by: Szymon Scholz <szymonscholz@gmail.com>
2020-07-27 19:11:36 +02:00
Pino Toscano
a34fab5399 docs: virConnectGetCapabilities do not provide pool types
Remove the paragraph in the storage pool page that mentions
virConnectGetCapabilities, as virConnectGetCapabilities does not return
any information about pools.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2020-07-27 17:25:52 +02:00
Peter Krempa
6ae53a1509 tests: commandtest: Make 'test4' checking daemonization more reliable
The 'commandhelper' checks effectively whether the parent process is
still around to report whether it was daemonized or not.

This creates a unlikely race condition in cases when we do actually
daemonize the process as the intermediate process used for the
daemonization might not have terminated yet which would report wrong
result leading to test failure.

For now there's just 'test4' which actually daemonizes the process.

Add an argument '--check-daemonize' which asks for retries of the
daemonization check in cases where we expect that the commandhelper is
going to be daemonized and use it in 'test4' to make the test more
reliable.

I've observed the test failure sporadically when my box is under load
e.g. while building two trees at once.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-07-27 15:44:38 +02:00
Michal Privoznik
957107184f news: Document recent CVE fix
Document the fix of leaking /dev/mapper/control to QEMU (fixed in
v6.6.0-rc1-3-g2249455654).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020-07-27 12:35:20 +02:00
Weblate
0e6dcc2f52 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/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2020-07-27 09:35:44 +02:00
Yuri Chornoivan
55ae526ba5 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/

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2020-07-27 09:35:40 +02:00
Szymon Scholz
a7b584b32e Translated using Weblate (Polish)
Currently translated at 23.4% (2431 of 10349 strings)

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

Signed-off-by: Szymon Scholz <szymonscholz@gmail.com>
2020-07-27 09:35:37 +02:00
Pino Toscano
3584061b74 Translated using Weblate (Italian)
Currently translated at 24.7% (2560 of 10349 strings)

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

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
2020-07-27 09:35:34 +02:00
Weblate
eabc6e4236 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/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2020-07-27 09:35:29 +02:00
Daniel P. Berrangé
4ed10ab698 Translated using Weblate (Finnish)
Currently translated at 3.3% (348 of 10318 strings)

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2020-07-27 09:35:21 +02:00
Michal Privoznik
e450ebb4c6 virDevMapperGetTargets: Don't ignore EBADF
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-25 11:14:39 +02:00
Michal Privoznik
2249455654 virdevmapper: Don't use libdevmapper to obtain dependencies
CVE-2020-14339

When building domain's private /dev in a namespace, libdevmapper
is consulted for getting full dependency tree of domain's disks.
The reason is that for a multipath devices all dependent devices
must be created in the namespace and allowed in CGroups.

However, this approach is very fragile as building of namespace
happens in the forked off child process, after mass close of FDs
and just before dropping privileges and execing QEMU. And it so
happens that when calling libdevmapper APIs, one of them opens
/dev/mapper/control and saves the FD into a global variable. The
FD is kept open until the lib is unlinked or dm_lib_release() is
called explicitly. We are doing neither.

However, the virDevMapperGetTargets() function is called also
from libvirtd (when setting up CGroups) and thus has to be thread
safe. Unfortunately, libdevmapper APIs are not thread safe (nor
async signal safe) and thus we can't use them. Reimplement what
libdevmapper would do using plain C (ioctl()-s, /proc/devices
parsing, /dev/mapper dirwalking, and so on).

Fixes: a30078cb83
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1858260

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-25 11:14:39 +02:00
Michal Privoznik
b8ebbe0545 virDevMapperGetTargetsImpl: Use VIR_AUTOSTRINGLIST
Since we have VIR_AUTOSTRINGLIST we can use it to free string
lists used in the function automatically.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-25 11:14:39 +02:00
Michal Privoznik
ae5752aabc virdevmapper.c: Join two WITH_DEVMAPPER sections together
There are two distinct WITH_DEVMAPPER sections in the file, for
different functions each. Rearrange the code to make some of
future commits smaller.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-25 11:14:39 +02:00
Jiri Denemark
e2fd95ed45 po: Refresh potfile for v6.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2020-07-25 00:45:52 +02:00
Daniel P. Berrangé
af3aa60dbd Translated using Weblate (French)
Currently translated at 12.4% (1282 of 10318 strings)

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2020-07-24 15:02:00 +02:00
Balázs Meskó
662785151b Translated using Weblate (Hungarian)
Currently translated at 2.5% (265 of 10318 strings)

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

Signed-off-by: Balázs Meskó <meskobalazs@mailbox.org>
2020-07-24 15:01:57 +02:00
Weblate
c9d6401668 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/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>

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/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2020-07-24 15:01:54 +02:00
Jean-Baptiste Holcroft
7b68cbb42b Translated using Weblate (French)
Currently translated at 12.4% (1282 of 10318 strings)

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

Signed-off-by: Jean-Baptiste Holcroft <jean-baptiste@holcroft.fr>

Translated using Weblate (French)

Currently translated at 12.0% (1241 of 10318 strings)

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

Signed-off-by: Jean-Baptiste Holcroft <jean-baptiste@holcroft.fr>
2020-07-24 15:01:51 +02:00
Pino Toscano
1b2f99ed48 Translated using Weblate (Italian)
Currently translated at 23.5% (2435 of 10318 strings)

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

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>

Translated using Weblate (Italian)

Currently translated at 15.1% (1566 of 10318 strings)

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

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
2020-07-24 15:01:48 +02:00
Daniel P. Berrangé
bb8ccb050d conf: add control over COW for storage pool directories
The storage pool code now attempts to disable COW by default on btrfs,
but management applications may wish to override this behaviour. Thus we
introduce a concept of storage pool features:

  <features>
    <cow state='yes|no'/>
  </features>

If the <cow> feature policy is set, it will be enforced. It will always
return an hard error if COW cannot be explicitly set or unset.

Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-23 16:18:09 +01:00
Daniel P. Berrangé
f12b283897 storage: attempt to disable COW by default
This calls virFileSetCOW when building a pool with a request to attempt,
but not require, COW to be disabled. The effect is that nothing changes
on non-btrfs filesystems, but btrfs will get COW disabled on the
directory. This setting is then inherited by all newly created files in
the pool, avoiding the need for mgmt app to set "nocow" on a per-volume
basis.

Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-23 16:18:09 +01:00
Daniel P. Berrangé
e944a71f09 storage: convert to use virFileSetCOW
When disabling COW on individual files, we now use the virFileSetCOW
method. Note that this change has a slight semantic difference to the
old implementation.

The original code reported errors but returned success when disabling
COW failed.

With this new code, we will always report an error if the user requested
disabling of COW and we could not honour it, either because btrfs
returned an error, or because the filesystem is not btrfs.

Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-23 16:18:08 +01:00
Daniel P. Berrangé
7230bc95aa util: add a helper method for controlling the COW flag on btrfs
btrfs defaults to performing copy-on-write for files. This is often
undesirable for VM images, so we need to be able to control whether this
behaviour is used.

The virFileSetCOW() will allow for this. We use a tristate, since out of
the box, we want the default behaviour attempt to disable cow, but only
on btrfs, silently do nothing on non-btrfs. If someone explicitly asks
to disable/enable cow, then we want to raise a hard error on non-btrfs.

Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-23 16:18:08 +01:00
Bastien Orivel
d3aa28925f Add a check attribute on the mac address element
This is only used in the ESX driver where, when set to "no", it will
ignore all the checks libvirt does about the origin of the MAC address
(whether or not it's in a VMWare OUI) and forward the original one to
the ESX server telling it not to check it either.

This allows keeping a deterministic MAC address which can be useful for
licensed software which might dislike changes.

Signed-off-by: Bastien Orivel <bastien.orivel@diateam.net>

VMX conversion parts rewritten to apply on top of previously merged
support for type='generated|static'

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-23 16:11:39 +01:00
Daniel P. Berrangé
80975c3c84 vmx: support outputing the type attribute for MAC addresses
When support for MAC addresses having a type='static|generated'
attribute was added in:

  commit 454e5961ab
  Author: Bastien Orivel <bastien.orivel@diateam.net>
  Date:   Mon Jul 13 16:28:53 2020 +0200

    Add a type attribute on the mac address element

the VMX -> XML parser was not updated. As a result while we
accept the 'type' attribute on input, we never show it again
on 'output', so we loose information during the roundtrip.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-07-23 16:11:35 +01:00