]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
4 years agosyntax-check: Clean up check for g_auto*
Peter Krempa [Wed, 31 Mar 2021 08:18:54 +0000 (10:18 +0200)]
syntax-check: Clean up check for g_auto*

Remove the old libvirt variants that are no longer in use and include
g_autostringlist.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agosyntax-check: Remove check for proper spelling of 'Red Hat'
Peter Krempa [Wed, 31 Mar 2021 08:14:50 +0000 (10:14 +0200)]
syntax-check: Remove check for proper spelling of 'Red Hat'

Don't single out this one, and also don't waste computational resources
on it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoTranslated using Weblate (Korean)
simmon [Sun, 4 Apr 2021 07:02:01 +0000 (09:02 +0200)]
Translated using Weblate (Korean)

Currently translated at 31.3% (3313 of 10581 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 agolibxl: use API 4.13 to support domUs with more than 4TB
Olaf Hering [Thu, 25 Mar 2021 16:26:12 +0000 (17:26 +0100)]
libxl: use API 4.13 to support domUs with more than 4TB

To support domUs with more than 4TB memory it is required to use
LIBXL_API_VERSION >= 0x040800, which uses uint64_t for certained guest
memory related quantities.

Unfortunately this change is not straight forward. While most of the
code in libxl.h handles the various LIBXL_API_VERSION variants
correctly, the check for valid a LIBXL_API_VERSION at the beginning of
the file was broken between Xen 4.7 and 4.13 - it did not cover for
API changes introduced in Xen 4.7 and 4.8. This was fixed with
xen-project/xen@c3999835df, which for libvirt means in practice either
the libxl API from Xen 4.5 or 4.13+ can be used.

This change uses pkgconfig to decide which API can be safely selected.
Xen provides a pkgconfig file since Xen 4.6, which is also the lowest
version expected by libvirt.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 years agolibxl: add API wrapper for libxl_set_memory_target
Olaf Hering [Thu, 25 Mar 2021 16:26:11 +0000 (17:26 +0100)]
libxl: add API wrapper for libxl_set_memory_target

Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_set_memory_target, which changed the storage size of
parameter "target_memkb" in Xen 4.8.

No functional change intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 years agolibxl: add API wrapper for libxl_send_trigger
Olaf Hering [Thu, 25 Mar 2021 16:26:10 +0000 (17:26 +0100)]
libxl: add API wrapper for libxl_send_trigger

Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_send_trigger, which got a new parameter
"ao_how" in Xen 4.12. libvirt does not use this parameter.

No functional change intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 years agolibxl: add API wrapper for libxl_set_vcpuonline
Olaf Hering [Thu, 25 Mar 2021 16:26:09 +0000 (17:26 +0100)]
libxl: add API wrapper for libxl_set_vcpuonline

Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_set_vcpuonline, which got a new parameter
"ao_how" in Xen 4.12. libvirt does not use this parameter.

No functional change intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 years agolibxl: add API wrapper for libxl_get_free_memory
Olaf Hering [Thu, 25 Mar 2021 16:26:08 +0000 (17:26 +0100)]
libxl: add API wrapper for libxl_get_free_memory

Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_get_free_memory, which changed storage size of parameter
"memkb" in Xen 4.8.

No functional change intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 years agolibxl: add API wrapper for libxl_domain_need_memory
Olaf Hering [Thu, 25 Mar 2021 16:26:07 +0000 (17:26 +0100)]
libxl: add API wrapper for libxl_domain_need_memory

Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_domain_need_memory, which changed the storage size of
"need_memkb" in Xen 4.8. With Xen 4.12 the libxl_domain_config
parameter was changed

No functional change intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 years agolibxl: add API wrapper for libxl_domain_unpause
Olaf Hering [Thu, 25 Mar 2021 16:26:06 +0000 (17:26 +0100)]
libxl: add API wrapper for libxl_domain_unpause

Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_domain_unpause, which got a new parameter
"ao_how" in Xen 4.12. libvirt does not use this parameter.

No functional change intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 years agolibxl: add API wrapper for libxl_domain_pause
Olaf Hering [Thu, 25 Mar 2021 16:26:05 +0000 (17:26 +0100)]
libxl: add API wrapper for libxl_domain_pause

Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_domain_pause, which got a new parameter
"ao_how" in Xen 4.12. libvirt does not use this parameter.

No functional change intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 years agolibxl: add API wrapper for libxl_domain_reboot
Olaf Hering [Thu, 25 Mar 2021 16:26:04 +0000 (17:26 +0100)]
libxl: add API wrapper for libxl_domain_reboot

Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_domain_reboot, which got a new parameter
"ao_how" in Xen 4.12. libvirt does not use this parameter.

No functional change intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 years agolibxl: add API wrapper for libxl_domain_shutdown
Olaf Hering [Thu, 25 Mar 2021 16:26:03 +0000 (17:26 +0100)]
libxl: add API wrapper for libxl_domain_shutdown

Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_domain_shutdown, which got a new parameter
"ao_how" in Xen 4.12. libvirt does not use this parameter.

No functional change intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 years agolibxl: add API wrapper for libxl_retrieve_domain_configuration
Olaf Hering [Thu, 25 Mar 2021 16:26:02 +0000 (17:26 +0100)]
libxl: add API wrapper for libxl_retrieve_domain_configuration

Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_retrieve_domain_configuration, which got a new parameter
"libxl_asyncop_how" in Xen 4.12. libvirt does not use this parameter.

No functional change intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 years agolibxl: add API wrapper for libxl_domain_create_restore
Olaf Hering [Thu, 25 Mar 2021 16:26:01 +0000 (17:26 +0100)]
libxl: add API wrapper for libxl_domain_create_restore

Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_domain_create_restore, which got a new parameter
"send_back_fd" in Xen 4.7. libvirt does not use this parameter.

No functional change intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
4 years agotests: Fix qemuxml2xmltest with audio driver defined in env
Jim Fehlig [Thu, 1 Apr 2021 16:57:36 +0000 (10:57 -0600)]
tests: Fix qemuxml2xmltest with audio driver defined in env

If QEMU_AUDIO_DRV is defined in the build host environment, several tests
in qemuxml2xmltest fail.

$ env | grep -i audio
AUDIODRIVER=pulseaudio
QEMU_AUDIO_DRV=pa
SDL_AUDIODRIVER=pulse

An example test failure with the above environment

907) QEMU XML-2-XML-active video-virtio-gpu-sdl-gl
In 'libvirt/tests/qemuxml2xmloutdata/video-virtio-gpu-sdl-gl.xml':
Offset 1244
Expect [v]
Actual [audio id='1' type='pulseaudio'/>
    <v]

Scrub QEMU_AUDIO_DRV from the environment before executing the tests in
qemuxml2xmltest. SDL_AUDIODRIVER also needs scrubbed since it will be
examined if QEMU_AUDIO_DRV=sdl.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu: implement setting of rotation rate for SCSI/IDE disks
Daniel P. Berrangé [Wed, 31 Mar 2021 09:17:07 +0000 (10:17 +0100)]
qemu: implement setting of rotation rate for SCSI/IDE disks

This is available in QEMU with "ide-hd" and "scsi-hd" device
types. It was originally mistakenly added to the "scsi-block"
device type too, but later removed. This doesn't affect libvirt
since we restrict usage to device=disk.

When this property is not set then QEMU's default behaviour
is to not report any rotation rate information, which
causes most guest OS to assume rotational storage.

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

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoconf: add support for disk "rotation_rate" property
Daniel P. Berrangé [Wed, 31 Mar 2021 09:14:12 +0000 (10:14 +0100)]
conf: add support for disk "rotation_rate" property

This lets the app expose the virtual SCSI or IDE disks as solid state
devices by setting a rate of '1', or rotational media by setting a
rate between 1025 and 65534.

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

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agorun: fix flake8 violations
Daniel P. Berrangé [Thu, 1 Apr 2021 14:10:33 +0000 (15:10 +0100)]
run: fix flake8 violations

Two blank lines are needed either side of functions.

Comments must have a single space character immediately after
the "#".

The unused exception variable can be removed.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agomeson: Don't check whether /usr/local/bin/grep is GNU grep
Andrea Bolognani [Thu, 1 Apr 2021 12:11:09 +0000 (14:11 +0200)]
meson: Don't check whether /usr/local/bin/grep is GNU grep

Since /usr/local is where ports live, it's reasonable to assume
that a grep binary found in there will have been installed via
ports and will thus be GNU grep.

Suggested-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agomeson: Look for GNU tools on macOS too
Andrea Bolognani [Wed, 24 Mar 2021 10:33:15 +0000 (11:33 +0100)]
meson: Look for GNU tools on macOS too

macOS is similar to FreeBSD in that it ships non-GNU versions
of several utilities that we need in the base system.

macOS actually includes GNU make already, but unfortunately due
to licensing reasons the tool is permanently stuck in 2006, so
even in that case users are better off installing a recent
version from Homebrew along with the dozens of other libvirt
dependencies that already need to be obtained that way.

Note that, unlike FreeBSD ports, Homebrew is fully consistent
in adding the 'g' prefix to the name of the GNU tools, so we
can detect GNU grep without additional hacks.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agomeson: Check GNU sed's availability
Andrea Bolognani [Wed, 24 Mar 2021 09:10:20 +0000 (10:10 +0100)]
meson: Check GNU sed's availability

As explained in the comment in build-aux/Makefile.in, the
version of sed included in the FreeBSD base system is not GNU
sed, which our syntax-check rules expect; as a result, many
checks will fail with

  gmake: gsed: No such file or directory
  /bin/sh: gsed: not found

Similarly to what we're already doing with GNU make and GNU
grep, look for GNU sed during the configuration step and fail
early if it's not available.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agomeson: Reorganize looking for programs
Andrea Bolognani [Wed, 24 Mar 2021 08:36:19 +0000 (09:36 +0100)]
meson: Reorganize looking for programs

While this change doesn't look like it would improve things and
actually introduces a tiny bit of duplication, it's necessary in
order to prepares the stage for further changes.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agomeson: Print custom message when GNU grep is not installed
Andrea Bolognani [Wed, 24 Mar 2021 08:45:29 +0000 (09:45 +0100)]
meson: Print custom message when GNU grep is not installed

Currently, if GNU grep is not installed on a FreeBSD system the
configuration step will fail with

  Program grep found: YES (/usr/bin/grep)
  Program /usr/local/bin/grep found: NO

  ERROR: Program '/usr/local/bin/grep' not found

which is confusing and not very useful; after this change, the
message will be

  Program grep found: YES (/usr/bin/grep)
  Program /usr/local/bin/grep found: NO

  ERROR: Problem encountered: GNU grep not found

instead, which should do a better job helping the user figure
out that they need to install GNU grep from ports to proceed.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoci: Call meson consistently
Andrea Bolognani [Wed, 24 Mar 2021 13:35:58 +0000 (14:35 +0100)]
ci: Call meson consistently

We should always pass --werror and display the contents of the
log file in case of failure.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoci: Don't use --prefix with meson for Cirrus CI builds
Andrea Bolognani [Fri, 26 Mar 2021 09:44:39 +0000 (10:44 +0100)]
ci: Don't use --prefix with meson for Cirrus CI builds

It's no longer used.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoTranslated using Weblate (Korean)
simmon [Tue, 30 Mar 2021 07:01:58 +0000 (09:01 +0200)]
Translated using Weblate (Korean)

Currently translated at 30.5% (3236 of 10581 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 agoXML <source bridge='VMnet0'/> update in <interface type='bridge'/>
Kristina Hanicova [Wed, 24 Mar 2021 16:47:44 +0000 (17:47 +0100)]
XML <source bridge='VMnet0'/> update in <interface type='bridge'/>

Previously, we accepted empty bridge name, because some old versions of
VMWare Workstation did not put it into the config. But this doesn't make
much sense - to have an interface type bridge with no name. We
circumvented this problem by generating an empty name but that is
equally wrong.

Therefore, fill in missing bridge names (according to the documentation
[1] the default bridge name is VMnet0) and error out if bridge name is
missing.

This partially reverts f246cdb5aca13ac9409b2ad43087e3078615ffcb

1: https://docs.vmware.com/en/VMware-Workstation-Player-for-Linux/16.0/com.vmware.player.linux.using.doc/GUID-BAFA66C3-81F0-4FCA-84C4-D9F7D258A60A.html

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
4 years agodocs: formatnetworkport: Fix typos
Han Han [Thu, 1 Apr 2021 03:55:42 +0000 (11:55 +0800)]
docs: formatnetworkport: Fix typos

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agobuild: teach run script how to temporarily stop systemd units
Daniel P. Berrangé [Thu, 18 Mar 2021 18:22:32 +0000 (18:22 +0000)]
build: teach run script how to temporarily stop systemd units

When testing locally built daemons on a systemd host there can be quite
a few systemd units that need temporarily stopping, and ideally
restarting after the test is complete. This becomes a massive burden
when modular daemons are running and you want to test libvirtd, as a
huge number of units need stopping.

The run script can facilitate this usage by looking at what units are
running and automatically stopping any that are known to conflict with
the daemon that is about to be run. This is only done when running as
root, since non-root libvirtd does not (currently) use systemd.

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agobuild: convert the run script to use Python
Daniel P. Berrangé [Thu, 18 Mar 2021 17:51:49 +0000 (17:51 +0000)]
build: convert the run script to use Python

This fits with the goal of eliminating non-Python scripting languages,
and makes forthcoming changes far easier.

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoPost-release version bump to 7.3.0
Jiri Denemark [Thu, 1 Apr 2021 10:21:23 +0000 (12:21 +0200)]
Post-release version bump to 7.3.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoRelease of libvirt-7.2.0
Jiri Denemark [Thu, 1 Apr 2021 10:17:47 +0000 (12:17 +0200)]
Release of libvirt-7.2.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 years agodocs: Fix broken link in migrationinternals
Han Han [Thu, 25 Mar 2021 08:57:27 +0000 (16:57 +0800)]
docs: Fix broken link in migrationinternals

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
4 years agoNEWS: Fix typo swtmp -> swtpm
Andrea Bolognani [Wed, 31 Mar 2021 17:13:57 +0000 (19:13 +0200)]
NEWS: Fix typo swtmp -> swtpm

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
4 years agonews: Update for upcoming release
Michal Privoznik [Wed, 31 Mar 2021 14:08:47 +0000 (16:08 +0200)]
news: Update for upcoming release

Mention some of the stuff we dealt with in this release.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agoNEWS: Mention fix for exec-restart of virtlo(g|ck)d and 'object_add' improvements
Peter Krempa [Tue, 30 Mar 2021 08:28:35 +0000 (10:28 +0200)]
NEWS: Mention fix for exec-restart of virtlo(g|ck)d and 'object_add' improvements

Mention that libvirt-7.2 will be needed to do stuff that executes
'object-add'/'object-del' QMP commands with the upcoming qemu-6.0 and
that exec-restart of virtlockd and virtlogd was fixed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agoconf: remove duplicated firmware type attribute
Daniel P. Berrangé [Mon, 29 Mar 2021 18:00:05 +0000 (19:00 +0100)]
conf: remove duplicated firmware type attribute

The

  <os firmware='efi'>
    <firmware type='efi'>
      <feature enabled='no' name='enrolled-keys'/>
    </firmware>
  </os>

repeats the firmware attribute twice. This has no functional benefit, as
evidenced by fact that we use a single struct field to store both
attributes, while needlessly introducing an error scenario. The XML can
just be simplified to:

  <os firmware='efi'>
    <firmware>
      <feature enabled='no' name='enrolled-keys'/>
    </firmware>
  </os>

which also means that we don't need to emit the empty element
<firmware type='efi'/> for all existing configs too.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu_driver: Acquire MODIFY job in qemuDomainStartDirtyRateCalc()
Michal Privoznik [Mon, 29 Mar 2021 11:53:50 +0000 (13:53 +0200)]
qemu_driver: Acquire MODIFY job in qemuDomainStartDirtyRateCalc()

This API talks to QEMU and changes its internal state. Therefore,
it should acquire QEMU_JOB_MODIFY instead of QEMU_JOB_QUERY.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoremote: don't allow dirty rate API with read permission
Daniel P. Berrangé [Mon, 29 Mar 2021 10:27:42 +0000 (11:27 +0100)]
remote: don't allow dirty rate API with read permission

This API interacts with the hypervisor and makes changes to its
behaviour, so must be protected by the write permission.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Sat, 27 Mar 2021 14:02:05 +0000 (15:02 +0100)]
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10581 of 10581 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 [Sat, 27 Mar 2021 14:02:03 +0000 (15:02 +0100)]
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 agoTranslated using Weblate (Finnish)
Ricky Tigg [Sat, 27 Mar 2021 14:01:59 +0000 (15:01 +0100)]
Translated using Weblate (Finnish)

Currently translated at 20.4% (2161 of 10545 strings)

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

Translated using Weblate (Finnish)

Currently translated at 20.2% (2140 of 10545 strings)

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

Translated using Weblate (Finnish)

Currently translated at 19.9% (2100 of 10545 strings)

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

Translated using Weblate (Finnish)

Currently translated at 19.1% (2020 of 10545 strings)

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

Translated using Weblate (Finnish)

Currently translated at 19.0% (2011 of 10545 strings)

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

Translated using Weblate (Finnish)

Currently translated at 19.0% (2011 of 10545 strings)

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

Co-authored-by: Ricky Tigg <ricky.tigg@gmail.com>
Signed-off-by: Ricky Tigg <ricky.tigg@gmail.com>
4 years agoTranslated using Weblate (Korean)
simmon [Sat, 27 Mar 2021 14:01:58 +0000 (15:01 +0100)]
Translated using Weblate (Korean)

Currently translated at 30.7% (3238 of 10545 strings)

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

Translated using Weblate (Korean)

Currently translated at 30.7% (3238 of 10545 strings)

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

Translated using Weblate (Korean)

Currently translated at 30.6% (3229 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 agopo: Refresh potfile for v7.2.0
Jiri Denemark [Fri, 26 Mar 2021 11:59:30 +0000 (12:59 +0100)]
po: Refresh potfile for v7.2.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoqemuProcessUpdateGuestCPU: Check host cpu for forbidden features
Tim Wiederhake [Tue, 23 Mar 2021 10:01:55 +0000 (11:01 +0100)]
qemuProcessUpdateGuestCPU: Check host cpu for forbidden features

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

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com
4 years agocpu: Introduce virCPUCheckForbiddenFeatures
Tim Wiederhake [Tue, 23 Mar 2021 10:01:54 +0000 (11:01 +0100)]
cpu: Introduce virCPUCheckForbiddenFeatures

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com
4 years agovirCPUDefFindFeature: Make first argument const ptr
Tim Wiederhake [Tue, 23 Mar 2021 10:01:53 +0000 (11:01 +0100)]
virCPUDefFindFeature: Make first argument const ptr

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com
4 years agonode_device_udev: Serialize access to pci_get_strings)_
wangjian [Fri, 26 Mar 2021 03:21:16 +0000 (11:21 +0800)]
node_device_udev: Serialize access to pci_get_strings)_

Since the functions provided by libpciaccess are not thread-safe,
when the udev-event and nodedev-init threads of libvirt call the
pci_get_strings function provided by libpaciaccess at the same
time the following can happen:

nodedev-init thread:
nodeStateInitializeEnumerate ->
  udevEnumerateDevices->
    udevProcessDeviceListEntry ->
      udevAddOneDevice ->
        udevGetDeviceDetails->
          udevProcessPCI ->
            udevTranslatePCIIds ->
              pci_get_strings -> (libpciaccess)
                find_device_name ->
                  populate_vendor ->
                    d = realloc( vend->devices, (vend->num_devices + 1), * sizeof( struct pci_device_leaf ) );
                    vend->num_devices++;

udev-event thread:
udevEventHandleThread ->
  udevHandleOneDevice ->
    udevAddOneDevice->
      udevGetDeviceDetails->
        udevProcessPCI ->
          udevTranslatePCIIds ->
            pci_get_strings -> (libpciaccess)
              find_device_name ->
                populate_vendor ->
                  d = realloc( vend->devices, (vend->num_devices + 1), * sizeof( struct pci_device_leaf ) );
                  vend->num_devices++;

Signed-off-by: WangJian <wangjian161@huawei.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agolib: Undo some g_steal_pointer() changes
Michal Privoznik [Wed, 24 Mar 2021 16:33:14 +0000 (17:33 +0100)]
lib: Undo some g_steal_pointer() changes

Recently, a few commits back I've switched bunch of code to
g_steal_pointer() using coccinelle. Problem was that the semantic
patch used was slightly off:

  @@
  expression a, b;
  @@

  + b = g_steal_pointer(&a);
  - b = a;
    ... when != a
  - a = NULL;

Problem is that, "... when != a" is supposed to jump over those
lines, which don't contain expression a. My idea was to replace
the following pattern too:

  ptrX = ptrY;
  if (something(ptrZ) < 0) goto error;
  ptrY = NULL;

But what I missed is that the following pattern is also matched
and replaced:

  ptrX = ptrY;
  if (something(ptrX) < 0) goto error;
  ptrY = NULL;

This is not necessarily correct - as demonstrated by our hotplug
code. The real problem is ambiguous memory ownership transfer
(functions which add device to domain def take ownership only on
success), but to not tackle the real issue let's revert those
parts.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirnetsocket: Revert part of g_steal_pointer() rewrite
Michal Privoznik [Wed, 24 Mar 2021 15:49:39 +0000 (16:49 +0100)]
virnetsocket: Revert part of g_steal_pointer() rewrite

Turns out, the way that glib implements g_steal_pointer() is not
compatible with function callbacks. And that's what my recent
patch did in virNetSocketEventFree(). Revert that part.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoci: Refresh information
Andrea Bolognani [Tue, 23 Mar 2021 14:33:33 +0000 (15:33 +0100)]
ci: Refresh information

Notable changes:

  * HAL is no longer installed on FreeBSD;

  * the native version of libwsman is no longer installed in
    containers intended for cross-compilation;

  * Meson 0.55 rather than 0.54 is requested when installing
    it from PyPI;

  * GNU sed and GNU grep are installed explicitly everywhere.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agovz: Add case for VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER
Michal Privoznik [Thu, 25 Mar 2021 11:12:13 +0000 (12:12 +0100)]
vz: Add case for VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER

In one of my recent patches I've introduced new connection
feature VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER.
However, I forgot to add corresponding case into a switch in
vzConnectSupportsFeature().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
4 years agolib: Fix calling of virNetworkUpdate() driver callback
Michal Privoznik [Tue, 16 Mar 2021 09:33:26 +0000 (10:33 +0100)]
lib: Fix calling of virNetworkUpdate() driver callback

The order in which virNetworkUpdate() accepts @section and
@command arguments is not the same as in which it passes them
onto networkUpdate() callback. Until recently, it did not really
matter, because calling the API on client side meant arguments
were encoded in reversed order (compared to the public API), but
then on the server it was fixed again - because the server
decoded RPC (still swapped), called public API (still swapped)
and in turn called the network driver callback (with reversing
the order - so magically fixing the order).

Long story short, if the public API is called even number of
times those swaps cancel each other out. The problem is when the
API is called an odd numbed of times - which happens with split
daemons and the right URI. There's one call in the client (e.g.
virsh net-update), the other in a hypervisor daemon (say
virtqemud) which ends up calling the API in the virnetworkd.

The fix is obvious - fix the order in which arguments are passed
to the callback.

But, to maintain compatibility with older, yet unfixed, daemons
new connection feature is introduced. The feature is detected
just before calling the callback and allows client to pass
arguments in correct order (talking to fixed daemon) or in
reversed order (talking to older daemon).

Unfortunately, older client talking to newer daemon can't be
fixed. Let's hope that it's less frequent scenario.

Fixes: 574b9bc66b6b10cc4cf50f299c3f0ff55f2cbefb
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1870552
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agonetwork: Implement virConnectSupportsFeature()
Michal Privoznik [Tue, 16 Mar 2021 09:32:59 +0000 (10:32 +0100)]
network: Implement virConnectSupportsFeature()

So far, it was not needed, but shortly a client will want to know
whether virNetworkUpdate() API is fixed or not. See next commits
for more info.

Side note, this driver's implementation is called only when using
sub-driver's connection, i.e. "network:///system". For any other
URI the corresponding hypervisor's driver callback is called.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agoqemu: increase locked memory limit when a vDPA device is present
Laine Stump [Tue, 23 Mar 2021 18:39:37 +0000 (14:39 -0400)]
qemu: increase locked memory limit when a vDPA device is present

Just like VFIO devices, vDPA devices may need to have all guest memory
pages locked/pinned in order to operate properly. In the case of VFIO
devices (including mdev and NVME, which also use VFIO) libvirt
automatically increases the locked memory limit when one of those
devices is present. This patch modifies that code to also increase the
limit if there are any vDPA devices present.

Resolves: https://bugzilla.redhat.com/1939776
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu: account for mdev devices in getPPC64MemLockLimitBytes()
Laine Stump [Tue, 23 Mar 2021 18:28:04 +0000 (14:28 -0400)]
qemu: account for mdev devices in getPPC64MemLockLimitBytes()

This function is a specialized version of
qemuDomainGetMemLockLimitBytes() for PPC64. Simplifying it in the same
manner as the previous patch has the nice side effect of accounting
for the possibility of an mdev device

(I don't know if mdev devices are supported on PPC, but even if not
then a) the additional check for mdev devices gained by using
qemuDomainNeedsVFIO() in place of open coding will be an effective
NOP, and b) if mdev devices are supported on PPC64 in the future, this
function will be prepared for it).

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu: simplify qemuDomainGetMemLockLimitBytes()
Laine Stump [Tue, 23 Mar 2021 17:13:33 +0000 (13:13 -0400)]
qemu: simplify qemuDomainGetMemLockLimitBytes()

This function goes through a loop checking if each hostdev is a VFIO
or mdev device, and then later it calls virDomainDefHasNVMEDisk(). The
function qemuDomainNeedsVFIO() does exactly the same thing, so let's
just call that instead.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoconf: new function virDomainDefHasVDPANet()
Laine Stump [Mon, 22 Mar 2021 22:05:00 +0000 (18:05 -0400)]
conf: new function virDomainDefHasVDPANet()

This function returns true if the domain has any interfaces that are
type='vdpa'.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agolib: Use g_steal_pointer() more
Michal Privoznik [Wed, 24 Mar 2021 09:32:58 +0000 (10:32 +0100)]
lib: Use g_steal_pointer() more

Generated by the following spatch:

  @@
  expression a, b;
  @@

  + b = g_steal_pointer(&a);
  - b = a;
    ... when != a
  - a = NULL;

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoesx: Fix @doms pointer steal in esxConnectListAllDomains()
Michal Privoznik [Wed, 24 Mar 2021 09:33:45 +0000 (10:33 +0100)]
esx: Fix @doms pointer steal in esxConnectListAllDomains()

The ESX implementation of virConnectListAllDomains() follows
pretty much implementations in other drivers: it has local array
of virDomainPtr-s which (if requested by caller) is filled by
actual domains or not (if the caller is interested only in the
count of domains).

Anyway, in case of the former, the passed @domains argument is
set to the local array, which is then set to NULL to prevent it
from freeing under cleanup label. Pretty standard pattern.
Except, the local array is set to NULL always. Even if the local
array is not stolen. Fortunately, this doesn't lead to a memory
leak, because if caller is not interested in the array, none is
allocated. But it doesn't set good example and also breaks my
spatch rules.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4 years agoVirtuozzo URL has been changed
Yaroslav Kargin [Wed, 24 Mar 2021 11:24:55 +0000 (14:24 +0300)]
Virtuozzo URL has been changed

Signed-off-by: Yaroslav Kargin <ykargin@virtuozzo.com>
4 years agoutil: don't log error if SRIOV PF has no associated netdev
Laine Stump [Wed, 24 Feb 2021 03:19:56 +0000 (22:19 -0500)]
util: don't log error if SRIOV PF has no associated netdev

Some SRIOV PFs don't have a netdev associated with them (the spec
apparently doesn't require it). In most cases when libvirt is dealing
with an SRIOV VF, that VF must have a PF, and the PF *must* have an
associated netdev (the only way to set the MAC address of a VF is by
sending a netlink message to the netdev of that VF's PF). But there
are times when we don't need for the PF to have a netdev; in
particular, when we're just getting the Switchdev Features for a VF,
we don't need the PF netdev - the netdev of the VF (apparently) works
just as well.

Commit 6452e2f5 (libvirt 5.1.0) *kind of* made libvirt work around PFs
with no netdevs in this case - if virNetDevGetPhysicalFunction
returned an error when setting up to retrieve Switchdev feature info,
it would ignore the error, and then check if the PF netdev name was
NULL and, if so it would reset the error object and continue on rather
than returning early with a failure. The problem is that by the time
this special handling occured, the error message about missing netdev
had already been logged, which was harmless to proper operation, but
confused the user.

Fortunately there are only 2 users of virNetDevGetPhysicalFunction, so
it is easy to redefine it's API to state that a missing netdev name is
*not* an error - in that case it will still return success, but the
caller must be prepared for the PF netdev name to be NULL. After
making this change, we can modify the two callers to behave properly
with the new semantics (for one of the callers it *is* still an error,
so the error message is moved there, but for the other it is okay to
continue), and our spurious error messages are a thing of the past.

Resolves: https://bugzilla.redhat.com/1924616
Fixes: 6452e2f5e1837bd753ee465e6607ed3c4f62b815
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agodocs: kbase: Fix broken references in locking-sanlock
Erik Skultety [Mon, 15 Mar 2021 17:24:02 +0000 (18:24 +0100)]
docs: kbase: Fix broken references in locking-sanlock

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agodocs: auth: Fix a couple of stylistic issues
Erik Skultety [Fri, 12 Mar 2021 11:07:27 +0000 (12:07 +0100)]
docs: auth: Fix a couple of stylistic issues

These were the result of the conversion to RST by commit
97f21a82b279d54743d28c989c03f18e077781ac.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agodocs: html.in: Drop the architecture page
Erik Skultety [Fri, 12 Mar 2021 07:34:15 +0000 (08:34 +0100)]
docs: html.in: Drop the architecture page

The page isn't linked from anywhere and the contents is dated.
Images related to the page are also dropped.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoqemu: don't raise error upon interface update without <frames/> for <rx/> in coalesce
Kristina Hanicova [Wed, 10 Mar 2021 17:01:17 +0000 (18:01 +0100)]
qemu: don't raise error upon interface update without <frames/> for <rx/> in coalesce

With this, incomplete XML without <frames/> for <rx/> in coalesce
won't raise error as before. It will leave the coalesce parameter
empty, thanks to passing it as a parameter and return an integer
to indicate error state - previously it returned pointer (or NULL
for both error and incomplete XML).
I also added a test case to test this functionality in the
qemuxml2xmltest.

The code went through some refactoring:
* change of a condition
* addition of a parameter
* change of order, that allowed removal of VIR_FREE
* removal of redundant labels and variables

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1535930
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
4 years agodomain_cgroup.c: update domain after setting blkio.weight
Daniel Henrique Barboza [Mon, 22 Mar 2021 19:28:59 +0000 (16:28 -0300)]
domain_cgroup.c: update domain after setting blkio.weight

Commit ac87d3520ad5 consolidated common cgroup code between the QEMU and
lxc drivers in domain_cgroup.c. In this process, in
virDomainCgroupSetupDomainBlkioParameters(), a call to
virCgroupGetBlkioWeight() went missing.

The result is that 'virsh blkiotune' is setting the blkio.weight for the
guest in the host cgroup, but not on the domain XML, because
virCgroupGetBlkioWeight() is also used to write the blkio.weight value
in the domain object.

Fix it by adding the virCgroupGetBlkioWeight() call in the
virDomainCgroupSetupDomainBlkioParameters() helper.

Fixes: ac87d3520ad542d558854a72b0ae0a81fddc6747
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1941407
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agovirDomainCheckpointRedefinePrep: Assign default bitmap names when domain XML is missing
Peter Krempa [Mon, 22 Mar 2021 13:44:55 +0000 (14:44 +0100)]
virDomainCheckpointRedefinePrep: Assign default bitmap names when domain XML is missing

Previously we'd assign the default checkpoint bitmap names in
virDomainCheckpointAlignDisks. In cases when the checkpoint is redefined
without a domain XML virDomainCheckpointAlignDisks is not called.

Add an explicit call to virDomainCheckpointDefAssignBitmapNames to
restore functionality.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemuCheckpointDiscardBitmaps: Refuse to delete checkpoint with NULL bitmap name
Peter Krempa [Mon, 22 Mar 2021 13:43:17 +0000 (14:43 +0100)]
qemuCheckpointDiscardBitmaps: Refuse to delete checkpoint with NULL bitmap name

When a checkpoint is redefined without providing the domain XML, we
might end up with a definition where the per-disk bitmap name is not
set. Trying to delete such checkpoint would lead to a crash.

Refuse such deletion.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1941600
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemu: capabilities: Enable detection of QEMU_CAPS_OBJECT_QAPIFIED
Peter Krempa [Fri, 12 Mar 2021 15:28:11 +0000 (16:28 +0100)]
qemu: capabilities: Enable detection of QEMU_CAPS_OBJECT_QAPIFIED

Base the detection on the presence of the 'secret' qom-type entry, which
isn't conditionally compiled in qemu.

All caps-based test now switch to using JSON for -object.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemuxml2argvtest: Pin examples of -object usage to qemu-5.2 caps
Peter Krempa [Fri, 12 Mar 2021 16:56:49 +0000 (17:56 +0100)]
qemuxml2argvtest: Pin examples of -object usage to qemu-5.2 caps

Add a selection of tests making exapmple use of -object prior to change
to the JSON format for -object.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemuxml2argvtest: Add DO_CAPS_LATEST variant of 'numatune-memnode'
Peter Krempa [Fri, 12 Mar 2021 16:42:14 +0000 (17:42 +0100)]
qemuxml2argvtest: Add DO_CAPS_LATEST variant of 'numatune-memnode'

The test has interesting config of the memory backend object. Preserve
the 5.2 output too since it's prior to JSONification.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
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>