]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
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 v7.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 v7.2.0-rc2
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 v7.2.0-rc1
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>
4 years agoutil: Try to get limits from /proc
Andrea Bolognani [Thu, 4 Mar 2021 10:37:36 +0000 (11:37 +0100)] 
util: Try to get limits from /proc

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

This is useful in containerized environments.

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

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

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

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

Specifically

  E111 indentation is not a multiple of four

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

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

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

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

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

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

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

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

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

Currently translated at 29.9% (3158 of 10545 strings)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Extract the code to it's own function.

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

Extract the code to it's own function.

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

Extract the code to it's own function.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>