]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
3 years agoTranslated using Weblate (Korean)
simmon [Tue, 31 Aug 2021 12:42:12 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 46.5% (4820 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 46.4% (4809 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 46.3% (4795 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 46.3% (4794 of 10353 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>
3 years agoTranslated using Weblate (Korean)
jason lee [Tue, 31 Aug 2021 12:42:11 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 46.1% (4781 of 10353 strings)

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

Co-authored-by: jason lee <ppark5237@gmail.com>
Signed-off-by: jason lee <ppark5237@gmail.com>
3 years agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Tue, 31 Aug 2021 12:42:10 +0000 (14:42 +0200)] 
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10353 of 10353 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>
3 years agoUpdate translation files
Weblate [Tue, 31 Aug 2021 12:42:08 +0000 (14:42 +0200)] 
Update translation files

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

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

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
3 years agoTranslated using Weblate (Korean)
simmon [Tue, 31 Aug 2021 12:42:04 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 46.0% (4770 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 46.0% (4766 of 10349 strings)

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

Translated using Weblate (Korean)

Currently translated at 46.0% (4765 of 10349 strings)

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

Translated using Weblate (Korean)

Currently translated at 46.0% (4763 of 10349 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>
3 years agoTranslated using Weblate (Korean)
jason lee [Tue, 31 Aug 2021 12:42:03 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 46.0% (4763 of 10349 strings)

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

Translated using Weblate (Korean)

Currently translated at 45.5% (4719 of 10349 strings)

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

Co-authored-by: jason lee <ppark5237@gmail.com>
Signed-off-by: jason lee <ppark5237@gmail.com>
3 years agoTranslated using Weblate (Sinhala)
Hela Basa [Tue, 31 Aug 2021 12:42:02 +0000 (14:42 +0200)] 
Translated using Weblate (Sinhala)

Currently translated at 0.1% (2 of 10349 strings)

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

Co-authored-by: Hela Basa <r45xveza@pm.me>
Signed-off-by: Hela Basa <r45xveza@pm.me>
3 years agoTranslated using Weblate (Finnish)
Jan Kuparinen [Tue, 31 Aug 2021 12:42:01 +0000 (14:42 +0200)] 
Translated using Weblate (Finnish)

Currently translated at 22.6% (2344 of 10349 strings)

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

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
3 years agoTranslated using Weblate (Korean)
simmon [Tue, 31 Aug 2021 12:42:01 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 45.3% (4689 of 10349 strings)

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

Translated using Weblate (Korean)

Currently translated at 45.3% (4689 of 10349 strings)

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

Translated using Weblate (Korean)

Currently translated at 45.3% (4689 of 10349 strings)

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

Translated using Weblate (Korean)

Currently translated at 45.2% (4681 of 10349 strings)

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

Translated using Weblate (Korean)

Currently translated at 45.2% (4681 of 10349 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>
3 years agoTranslated using Weblate (Finnish)
Ricky Tigg [Tue, 31 Aug 2021 12:41:59 +0000 (14:41 +0200)] 
Translated using Weblate (Finnish)

Currently translated at 22.5% (2338 of 10349 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>
3 years agomeson: avoid bogus warnings from clang and g_autoptr
Daniel P. Berrangé [Tue, 31 Aug 2021 14:05:15 +0000 (15:05 +0100)] 
meson: avoid bogus warnings from clang and g_autoptr

Clang has previously had trouble with G_DEFINE_AUTOPTR_CLEANUP_FUNC
generated code, thinking it was unused. We turn off -Wunused-function
to avoid tripping up on that with CLang.

New Clang has started having trouble with g_autoptr now too. In usage
scenarios where the variable is set, but never again read, it thinks
it is unused not realizing the destructor has useful side effects.
For this we have to skip -Wunused-but-set-variable on CLang.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoPost-release version bump to 7.8.0
Jiri Denemark [Wed, 1 Sep 2021 11:46:34 +0000 (13:46 +0200)] 
Post-release version bump to 7.8.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 years agoRelease of libvirt-7.7.0 v7.7.0
Jiri Denemark [Wed, 1 Sep 2021 11:44:53 +0000 (13:44 +0200)] 
Release of libvirt-7.7.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 years agonews: add FC VMID entry
Pavel Hrdina [Tue, 31 Aug 2021 12:53:17 +0000 (14:53 +0200)] 
news: add FC VMID entry

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agotests: virstoragetest: remove tests without backing type
Ján Tomko [Tue, 31 Aug 2021 09:41:55 +0000 (11:41 +0200)] 
tests: virstoragetest: remove tests without backing type

As of qemu commit:

  commit 497a30dbb065937d67f6c43af6dd78492e1d6f6d
    qemu-img: Require -F with -b backing image

creating images with backing images requires specifying the format.

Remove tests which do not pass the backing format on the command
line.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agorpm: fix typo in post transaction scriptlet name
Daniel P. Berrangé [Tue, 31 Aug 2021 10:55:13 +0000 (11:55 +0100)] 
rpm: fix typo in post transaction scriptlet name

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu, xen: add missing deps on virtlockd/virtlogd sockets
Daniel P. Berrangé [Tue, 31 Aug 2021 09:59:39 +0000 (10:59 +0100)] 
qemu, xen: add missing deps on virtlockd/virtlogd sockets

The QEMU driver uses both virtlogd and virtlockd, while the Xen driver
uses virtlockd. The libvirtd.service unit contains deps on the socket
units for these services, but these deps were missed in the modular
daemons. As a result the virtlockd/virtlogd sockets are not started
when the virtqemud/virtxend daemons are started.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoNEWS: Update with description of changes to lifecycle action handling v7.7.0-rc2
Peter Krempa [Wed, 25 Aug 2021 09:50:08 +0000 (11:50 +0200)] 
NEWS: Update with description of changes to lifecycle action handling

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Mention bug with incorrect format recorded for qcow2+luks overlays
Peter Krempa [Wed, 25 Aug 2021 09:50:07 +0000 (11:50 +0200)] 
NEWS: Mention bug with incorrect format recorded for qcow2+luks overlays

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Move my contributions to correct release
Michal Privoznik [Fri, 27 Aug 2021 14:36:15 +0000 (16:36 +0200)] 
NEWS: Move my contributions to correct release

In previous commit I've documented my contributions for upcoming
7.7.0 release. But unfortunately I've placed the lines into wrong
release (7.6.0).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Document my contributions for the upcoming release
Michal Privoznik [Thu, 26 Aug 2021 15:44:56 +0000 (17:44 +0200)] 
NEWS: Document my contributions for the upcoming release

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Mention new SecurityManager APIs for labeling network devices
Jim Fehlig [Thu, 26 Aug 2021 22:53:36 +0000 (16:53 -0600)] 
NEWS: Mention new SecurityManager APIs for labeling network devices

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Document new '--validate' option for virsh define commands
Kristina Hanicova [Thu, 26 Aug 2021 16:03:40 +0000 (18:03 +0200)] 
NEWS: Document new '--validate' option for virsh define commands

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoqemu: Set label on vhostuser net device when hotplugging
Jim Fehlig [Wed, 28 Jul 2021 00:13:36 +0000 (18:13 -0600)] 
qemu: Set label on vhostuser net device when hotplugging

Attaching a newly created vhostuser port to a VM fails due to an
apparmor denial

internal error: unable to execute QEMU command 'chardev-add': Failed
to bind socket to /run/openvswitch/vhu838c4d29-c9: Permission denied

In the case of a net device type VIR_DOMAIN_NET_TYPE_VHOSTUSER, the
underlying chardev is not labeled in qemuDomainAttachNetDevice prior
to calling qemuMonitorAttachCharDev.

A simple fix would be to call qemuSecuritySetChardevLabel using the
embedded virDomainChrSourceDef in the virDomainNetDef vhostuser data,
but this incurs the risk of incorrectly restoring the label. E.g.
consider the DAC driver behavior with a vhostuser net device, which
uses a socket for the chardev backend. The DAC driver uses XATTRS to
store original labelling information, but XATTRS are not compatible
with sockets. Without the original labelling information, the socket
labels will be restored with root ownership, preventing other
less-privileged processes from connecting to the socket.

This patch avoids overloading chardev labelling with vhostuser net
devices by introducing virSecurityManager{Set,Restore}NetdevLabel,
which is currently only implemented for the apparmor driver. The
new APIs are then used to set and restore labels for the vhostuser
net devices.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosrc: fix generation of default resource partition
Pavel Hrdina [Wed, 25 Aug 2021 11:01:52 +0000 (13:01 +0200)] 
src: fix generation of default resource partition

Now that resource structure can have appid as well we need to adapt code
that creates default resource partition if not provided by user.
Otherwise starting a VM with appid defined would fail with following
error:

    error: unsupported configuration: Resource partition '(null)' must start with '/'

Fixes: 38b5f4faabccf681439d99e5394954c6ef7a5a40
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodocs: formatdomain: fix typo
Ján Tomko [Thu, 26 Aug 2021 14:28:52 +0000 (16:28 +0200)] 
docs: formatdomain: fix typo

combiatnion -> combination

Fixes: 4ffc807214cb80086d57e1d3e7b60959a41d2874
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agopo: Refresh potfile for v7.7.0 v7.7.0-rc1
Jiri Denemark [Thu, 26 Aug 2021 10:10:50 +0000 (12:10 +0200)] 
po: Refresh potfile for v7.7.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 years agotests: Fix typos
Tim Wiederhake [Wed, 25 Aug 2021 12:50:25 +0000 (14:50 +0200)] 
tests: Fix typos

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirscsi: Drop @tmp from virSCSIDeviceListDel
Michal Privoznik [Mon, 23 Aug 2021 10:54:32 +0000 (12:54 +0200)] 
virscsi: Drop @tmp from virSCSIDeviceListDel

Clang on Rawhide started to complain that @tmp variable in
virSCSIDeviceListDel() is set but not used. This is obviously a
false positive because the variable is used to free device stolen
from the list. Anyway, we can do without the variable so in this
specific case let's fix our code to appease Clang.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agotest: Drop unused @cfg from qemu*test
Michal Privoznik [Tue, 24 Aug 2021 07:31:25 +0000 (09:31 +0200)] 
test: Drop unused @cfg from qemu*test

In qemumigrationcookiexmltest and qemustatusxml2xmltest there is
@cfg variable that is unused. It's set via virQEMUDriverGetConfig()
but then never used. Drop it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agovirpci: Clarify lifetime of temporary object
Michal Privoznik [Mon, 23 Aug 2021 10:47:07 +0000 (12:47 +0200)] 
virpci: Clarify lifetime of temporary object

The virPCIDeviceIsBehindSwitchLackingACS() function checks
whether given PCI device is not behind a switch that lacks ACS.
It does so by starting at given device and traversing up, one
parent at time towards the root. The parent device is obtained
via virPCIDeviceGetParent() which allocates new virPCIDevice
structure. For freeing the structure we use g_autoptr() and a
temporary variable @tmp. However, Clang fails to understand our
clever algorithm and complains that the variable is set but never
used. This is obviously a false positive, but using a small trick
we can shut Clang up.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: snapshot: Translate 'volume' disks before attempting offline snapshot manipulation
Peter Krempa [Fri, 2 Jul 2021 14:00:05 +0000 (16:00 +0200)] 
qemu: snapshot: Translate 'volume' disks before attempting offline snapshot manipulation

When the VM is inactive the 'virStorageSource' struct doesn't have the
necessary data pointing to the actual storage. This is a problem for
inactive snapshot operations on VMs which use disk type='volume'.

Add the translation steps for reversion and deletion of snapshots.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1977155
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/202
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: process: Ignore 'RESET' event during startup
Peter Krempa [Tue, 20 Jul 2021 07:28:51 +0000 (09:28 +0200)] 
qemu: process: Ignore 'RESET' event during startup

In cases when we are adding a <transient/> disk with sharing backend
(and thus hotplugging it) we need to re-initialize ACPI tables so that
the VM boots from the correct device.

This has a side-effect of emitting the RESET event and forwarding it to
the clients which is not correct.

Fix this by ignoring RESET events during startup of the VM.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuDomainSetLifecycleAction: Properly update 'onReboot' action in qemu
Peter Krempa [Fri, 20 Aug 2021 13:40:18 +0000 (15:40 +0200)] 
qemuDomainSetLifecycleAction: Properly update 'onReboot' action in qemu

When qemu supports 'set-action' command we can update what happens on
reboot. Additionally we can fully relax the checks as we now properly
update the lifecycle actions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: process: Don't set 'allowReboot' when qemu supports 'set-action'
Peter Krempa [Mon, 23 Aug 2021 14:43:26 +0000 (16:43 +0200)] 
qemu: process: Don't set 'allowReboot' when qemu supports 'set-action'

We don't use the value of the flag when the new handling is in place so
we don't have to initialize it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: command: Always use '-no-shutdown'
Peter Krempa [Thu, 19 Aug 2021 11:50:16 +0000 (13:50 +0200)] 
qemu: command: Always use '-no-shutdown'

The '-no-shutdown' flag prevents qemu from terminating if a shutdown was
requested. Libvirt will handle the termination of the qemu process
anyways and using this consistently will allow greater flexibility for
the virDomainSetLifecycleAction API as well as will allow using
the 'system-reset' QMP command during startup to reinitiate devices
exported to the firmware.

This efectively partially reverts 0e034efaf9b963760516a65413fd9771034357aa

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuProcessLaunch: Setup handling of 'on_reboot' via QMP when starting the process
Peter Krempa [Mon, 23 Aug 2021 14:40:46 +0000 (16:40 +0200)] 
qemuProcessLaunch: Setup handling of 'on_reboot' via QMP when starting the process

Rather than using '-no-reboot' use the QMP command to update the
lifecycle action of 'on_reboot'.

This will be identical to how we set the behaviour during lifetime and
also avoids problems with use of the 'system-reset' QMP command during
bringup of the VM (used to update the firmware table of disks when disks
were hotplugged as part of startup).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuProcessHandleReset: Don't emulate lifecycle actions for RESET event
Peter Krempa [Fri, 20 Aug 2021 14:16:46 +0000 (16:16 +0200)] 
qemuProcessHandleReset: Don't emulate lifecycle actions for RESET event

The RESET event is delivered by qemu only when the guest OS is actually
allowed to reboot ('-no-reboot' or equivalent is not used) and due to
the nature of async handling of the events VM is actually already
executing guest code after the reboot, until our code gets to killing
it.

In general it should have been impossible to reach a state where the
reboot action is 'destroy' but we didn't use '-no-reboot' but due to
various bugs it was.

Due to the fact that this was not a desired operation and additionally
guest code already is executing I think the best option is not to kill
the VM any more (possible data loss?) and rely for the proper fix where
we use the new 'set-action' QMP command to enable an equivalent
behaviour to '-no-reboot' during runtime.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuDomainSetLifecycleAction: Forbid live update of 'on_reboot'
Peter Krempa [Fri, 20 Aug 2021 14:46:25 +0000 (16:46 +0200)] 
qemuDomainSetLifecycleAction: Forbid live update of 'on_reboot'

Without the ability to tell qemu to change the behaviour on reboot of
the guest it's fundamentally unsafe to change the action as the guest
would be able to execute instructions after the reboot before libvirt
terminates it due to the async nature of QMP events.

Stricten the code for now until we implement support for 'set-action'
QMP command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: domain: Remove qemuDomainIsUsingNoShutdown
Peter Krempa [Mon, 23 Aug 2021 13:01:43 +0000 (15:01 +0200)] 
qemu: domain: Remove qemuDomainIsUsingNoShutdown

Directly use 'priv->allowReboot' as we now document what the behaiour is
to avoid another lookup.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: migration: Don't transfer 'allowReboot' flag
Peter Krempa [Fri, 20 Aug 2021 14:11:05 +0000 (16:11 +0200)] 
qemu: migration: Don't transfer 'allowReboot' flag

The original idea was to ensure that the destination has the same
original state of the '-no-reboot' flag to ensure identical behaviour of
the 'vidDomainModifyLifecycleAction' API.

With newer qemu's we'll be able to modify the behaviour using the
monitor so old daemons won't be able to keep up anyways.

Remove this feature as it's not very useful and will be replaced by a
proper solution.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuDomainObjPrivate: Annotate 'allowReboot' field
Peter Krempa [Thu, 19 Aug 2021 12:54:18 +0000 (14:54 +0200)] 
qemuDomainObjPrivate: Annotate 'allowReboot' field

Save further readers the headache of determining what it actually does
and note that it's not used with qemu version supporting the
'set-action' command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuxml2argvtest: Add 'LATEST' version of 'misc-no-reboot' test case
Peter Krempa [Mon, 23 Aug 2021 15:09:30 +0000 (17:09 +0200)] 
qemuxml2argvtest: Add 'LATEST' version of 'misc-no-reboot' test case

Upcoming patches will modify how '-no-reboot' is handled when qemu
supports the 'set-action' QMP command. Add a test for it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuDomainAttachWatchdog: Use 'set-action' instead of 'watchdog-set-action' if supported
Peter Krempa [Fri, 20 Aug 2021 12:54:37 +0000 (14:54 +0200)] 
qemuDomainAttachWatchdog: Use 'set-action' instead of 'watchdog-set-action' if supported

If current qemu supports 'set-action' use it instead of the single-use
command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: monitor: Implement monitor code for 'set-action' command
Peter Krempa [Fri, 20 Aug 2021 12:39:27 +0000 (14:39 +0200)] 
qemu: monitor: Implement monitor code for 'set-action' command

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: capablities: Detect presence of 'set-action' as QEMU_CAPS_SET_ACTION
Peter Krempa [Fri, 20 Aug 2021 10:56:08 +0000 (12:56 +0200)] 
qemu: capablities: Detect presence of 'set-action' as QEMU_CAPS_SET_ACTION

The 'set-action' QMP command allows modifying the behaviour when the
guest resets.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Honor 'restart' action for 'on_poweroff'
Peter Krempa [Thu, 19 Aug 2021 12:44:51 +0000 (14:44 +0200)] 
qemu: Honor 'restart' action for 'on_poweroff'

We simply terminate qemu instead of issuing a reset as the semantics of
the setting dictate.

Fix it by handling it identically to 'fake reboot'.

We need to forbid the combination of 'onReboot' -> 'destroy' and
'onPoweroff' -> reboot though as the handling would be hairy and it
honetly makes no sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Reject 'preserve' action for 'on_reboot'/'on_poweroff'/'on_crash'
Peter Krempa [Mon, 23 Aug 2021 14:49:11 +0000 (16:49 +0200)] 
qemu: Reject 'preserve' action for 'on_reboot'/'on_poweroff'/'on_crash'

The qemu driver didn't ever implement any meaningful handling for the
'preserve' action.

Forbid the flag in the qemu def validator and update the documentation
to be factual.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: driver: Validate lifecycle actions in 'qemuDomainSetLifecycleAction'
Peter Krempa [Tue, 24 Aug 2021 11:44:00 +0000 (13:44 +0200)] 
qemu: driver: Validate lifecycle actions in 'qemuDomainSetLifecycleAction'

Some actions are not supported by qemu. Use the recently added
'qemuValidateLifecycleAction' helper to ensure that the API does the
same validation as we do on startup in the validation callbacks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: Reject 'rename-restart' action for 'on_reboot'/'on_poweroff'/'on_crash'
Peter Krempa [Thu, 19 Aug 2021 14:23:02 +0000 (16:23 +0200)] 
qemu: Reject 'rename-restart' action for 'on_reboot'/'on_poweroff'/'on_crash'

The qemu driver didn't ever implement any meaningful handling for the
'rename-restart' action.

At this point the following handling would take place:

'on_reboot' set to 'rename-restart' is ignored on guest-initiated
reboots, the guest simply reboots.

For on_poweroff set to 'rename-restart' the following happens:

guest initiated shutdown -> 'destroy'
libvirt initiated shutdown -> 'reboot'

In addition when 'on_reboot' is 'destroy' in addition to 'on_poweroff'
being 'rename-restart' the guest is able to execute instructions after
issuing a reset before libvirt terminates it. This will be addressed
separately later.

Forbid the flag in the qemu def validator and update the documentation
to be factual.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: validate: Reformat header and purge unused includes
Peter Krempa [Tue, 24 Aug 2021 07:26:35 +0000 (09:26 +0200)] 
qemu: validate: Reformat header and purge unused includes

Use the new style header formatting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: driver: Use 'qemuDomainSaveStatus' for saving status XML
Peter Krempa [Fri, 20 Aug 2021 13:26:47 +0000 (15:26 +0200)] 
qemu: driver: Use 'qemuDomainSaveStatus' for saving status XML

We've got multiple random open-coded versions. Switch to the helper
function which doesn't report errors as they'd be mostly wrong as the
operation was indeed successful.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuDomainSetLifecycleAction: Add a note about argument range-check
Peter Krempa [Fri, 20 Aug 2021 13:17:00 +0000 (15:17 +0200)] 
qemuDomainSetLifecycleAction: Add a note about argument range-check

The public API wrapper range-checks the arguments. Save the next reader
the hassle of looking it up.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuMonitorJSONSetWatchdogAction: Use automatic memory clearing
Peter Krempa [Fri, 20 Aug 2021 12:09:14 +0000 (14:09 +0200)] 
qemuMonitorJSONSetWatchdogAction: Use automatic memory clearing

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuxml2argvtest: Add LATEST version of 'cpu-host-model'
Peter Krempa [Wed, 18 Aug 2021 12:30:10 +0000 (14:30 +0200)] 
qemuxml2argvtest: Add LATEST version of 'cpu-host-model'

This one will be slightly unstable given that CPU features are being
modified frequently in qemu especially when used with a modern cpu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemucapabilitiesdata: Update qemu caps dump for 6.1.0 release
Peter Krempa [Wed, 18 Aug 2021 09:31:48 +0000 (11:31 +0200)] 
qemucapabilitiesdata: Update qemu caps dump for 6.1.0 release

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Add 'cpu-host-model' cases for all x86-64 real qemu caps versions
Peter Krempa [Wed, 18 Aug 2021 12:28:23 +0000 (14:28 +0200)] 
qemuxml2argvtest: Add 'cpu-host-model' cases for all x86-64 real qemu caps versions

The host model expansion depends on the capability data, so in this case
it makes sense to have specific invocations of the test for all qemu
versions we have.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Slightly modernize "cpu-host-model" case
Peter Krempa [Wed, 18 Aug 2021 12:21:45 +0000 (14:21 +0200)] 
qemuxml2argvtest: Slightly modernize "cpu-host-model" case

Switch to q35 in anticipation of using DO_TEST_CAPS* in further patches.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Unify 'cpu-tsc-frequency' and 'cpu-tsc-high-frequency' case
Peter Krempa [Wed, 18 Aug 2021 12:02:36 +0000 (14:02 +0200)] 
qemuxml2argvtest: Unify 'cpu-tsc-frequency' and 'cpu-tsc-high-frequency' case

Use the larger number in the original test to avoid having two files.

Additionally this avoids use of 'host-model' with DO_TEST_CAPS_LATEST in
cases when it isn't necessary for the purpose of the test as the CPU
model tends to change.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvdata: Don't use 'host-model' cpu in 'hugepages-memaccess3'
Peter Krempa [Wed, 18 Aug 2021 11:45:30 +0000 (13:45 +0200)] 
qemuxml2argvdata: Don't use 'host-model' cpu in 'hugepages-memaccess3'

The test case doesn't really test anything about the specific CPU. Using
a host-model cpu with DO_TEST_CAPS_LATEST results in commandline changes
every time qemu updates the cpu definiton.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: add support for '--validate' option in define storage pool
Kristina Hanicova [Tue, 24 Aug 2021 14:51:11 +0000 (16:51 +0200)] 
virsh: add support for '--validate' option in define storage pool

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agostorage_driver & test_driver: allow VIR_STORAGE_POOL_DEFINE_VALIDATE flag
Kristina Hanicova [Tue, 24 Aug 2021 14:51:10 +0000 (16:51 +0200)] 
storage_driver & test_driver: allow VIR_STORAGE_POOL_DEFINE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agostorage_conf: add validation against schema in pool define
Kristina Hanicova [Tue, 24 Aug 2021 14:51:09 +0000 (16:51 +0200)] 
storage_conf: add validation against schema in pool define

We need to validate the XML against schema if option '--validate'
was passed to the virsh command. This patch also includes
propagation of flags into the virStoragePoolDefParse() function.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoapi: add virStoragePoolDefineFlags
Kristina Hanicova [Tue, 24 Aug 2021 14:51:08 +0000 (16:51 +0200)] 
api: add virStoragePoolDefineFlags

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agolxcxml2xmltest: Substitute 'inactive' variable with 'active'
Kristina Hanicova [Wed, 21 Jul 2021 08:25:22 +0000 (10:25 +0200)] 
lxcxml2xmltest: Substitute 'inactive' variable with 'active'

I removed negation from the name of a variable to make the code
more readable.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoAPI: discourage usage of non-ListAll APIs
Ján Tomko [Sun, 4 Oct 2020 22:20:27 +0000 (00:20 +0200)] 
API: discourage usage of non-ListAll APIs

They require the caller to provide the maximum number
of array elements upfront, leading to either incomplete
results or violations of the zero-one-infinity rule.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoqemu: simplify machine-type check for implicit floppy controller
Ján Tomko [Fri, 7 May 2021 20:12:43 +0000 (22:12 +0200)] 
qemu: simplify machine-type check for implicit floppy controller

Q35 machine types 2.3 and older had an integrated floppy controller.

Support for these machine types was removed by QEMU commit

  commit 86165b499edf8b03bb2d0e926d116c2f12a95bfe
      q35: Remove old machine versions
  git describe: v2.5.0-1530-g86165b499e contains: v2.6.0-rc0~76^2~4

In libvirt, we have bumped the minimum QEMU version to 2.11:

  commit b4cbdbe90bbf85eaf687f532d5a52a11e664b781
    qemu: Formally deprecate support for qemu < 2.11
  git describe: v7.3.0-13-gb4cbdbe90b contains: v7.4.0-rc1~300

Since this QEMU version only supports Q35 machine versions 2.4+,
remove the code dealing with older ones.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoqemu: check unlink hint from virQEMUFileOpenAs()
Simon Rowe [Mon, 23 Aug 2021 15:40:48 +0000 (15:40 +0000)] 
qemu: check unlink hint from virQEMUFileOpenAs()

Signed-off-by: Simon Rowe <simon.rowe@nutanix.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoiohelper: skip lseek() and ftruncate() on block devices
Simon Rowe [Mon, 23 Aug 2021 15:40:47 +0000 (15:40 +0000)] 
iohelper: skip lseek() and ftruncate() on block devices

Signed-off-by: Simon Rowe <simon.rowe@nutanix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirsh: add support for '--validate' option in define network
Kristina Hanicova [Mon, 23 Aug 2021 16:50:14 +0000 (18:50 +0200)] 
virsh: add support for '--validate' option in define network

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonetwork: allow VIR_NETWORK_DEFINE_VALIDATE flag
Kristina Hanicova [Mon, 23 Aug 2021 16:50:13 +0000 (18:50 +0200)] 
network: allow VIR_NETWORK_DEFINE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosrc & network_conf: add validation against schema in define
Kristina Hanicova [Mon, 23 Aug 2021 16:50:12 +0000 (18:50 +0200)] 
src & network_conf: add validation against schema in define

This patch also includes propagation of flags into the
virNetworkDefParse().

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoapi: add virNetworkDefineFlags
Kristina Hanicova [Mon, 23 Aug 2021 16:50:11 +0000 (18:50 +0200)] 
api: add virNetworkDefineFlags

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosrc: add driver support for networkDefineXMLFlags()
Kristina Hanicova [Mon, 23 Aug 2021 16:50:10 +0000 (18:50 +0200)] 
src: add driver support for networkDefineXMLFlags()

I have added new driver functions which define network with given
flags. I have also replaced definitions of the functions without
flags with function calls to the new ones.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovbox_network: add flags to vboxNetworkDefineCreateXML()
Kristina Hanicova [Mon, 23 Aug 2021 16:50:09 +0000 (18:50 +0200)] 
vbox_network: add flags to vboxNetworkDefineCreateXML()

I need to propagate flags for the next commit.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoapi: add public virNetworkDefineXMLFlags() and remote protocol
Kristina Hanicova [Mon, 23 Aug 2021 16:50:08 +0000 (18:50 +0200)] 
api: add public virNetworkDefineXMLFlags() and remote protocol

This new API allows to define network with given flags.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: capabilities: remove pointless labels
Ján Tomko [Mon, 23 Aug 2021 14:35:02 +0000 (16:35 +0200)] 
qemu: capabilities: remove pointless labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
3 years agoqemu: capabilities: use g_auto
Ján Tomko [Mon, 23 Aug 2021 14:20:18 +0000 (16:20 +0200)] 
qemu: capabilities: use g_auto

Where easily possible, declare variables with g_auto to reduce
the amount of calls in cleanup sections.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
3 years agoqemu: refactor virQEMUCapsNewCopy
Ján Tomko [Mon, 23 Aug 2021 14:34:59 +0000 (16:34 +0200)] 
qemu: refactor virQEMUCapsNewCopy

Use g_auto and remove pointless labels.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
3 years agoqemu: refactor virQEMUCapsInit
Ján Tomko [Mon, 23 Aug 2021 14:23:47 +0000 (16:23 +0200)] 
qemu: refactor virQEMUCapsInit

Use g_auto and remove pointless labels.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
3 years agoqemu: refactor virQEMUCapsLoadFile
Ján Tomko [Mon, 23 Aug 2021 14:22:17 +0000 (16:22 +0200)] 
qemu: refactor virQEMUCapsLoadFile

Use g_auto and remove pointless labels.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
3 years agoqemu: refactor virQEMUCapsNewForBinaryInternal
Ján Tomko [Mon, 23 Aug 2021 14:21:18 +0000 (16:21 +0200)] 
qemu: refactor virQEMUCapsNewForBinaryInternal

Use g_auto and remove pointless labels.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
3 years agoconf: snapshot/checkpoint: Rewrite 'AlignDisk' logic to appease clang
Peter Krempa [Mon, 23 Aug 2021 12:14:55 +0000 (14:14 +0200)] 
conf: snapshot/checkpoint: Rewrite 'AlignDisk' logic to appease clang

New clang has a false-positive about value of 'olddisks' being unused
after being set. This is clearly wrong because we want to use
'g_autofree' to clear it later.

While I'm against modifying good code for the sake of bad static
analysis in this case it's not obvious that we depend on the lifetime of
'olddisks' being needed until the end of the function as we store
pointers into it into the hash table and later copy them out.

Rewrite the code by assigning to 'olddisks' earlier and then using
'olddisks' in the loop, so it's clear where the lifetime of the objects
ends, and this should also silence the warning.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovbox_network: fix possible memory leak in vboxNetworkDefineCreateXML()
Kristina Hanicova [Mon, 23 Aug 2021 14:33:41 +0000 (16:33 +0200)] 
vbox_network: fix possible memory leak in vboxNetworkDefineCreateXML()

virNetworkDef was not freed if the function failed in the first
two ifs, causing a possible memory leak.

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>
3 years agovirsh-snapshot: Don't leak @then in cmdSnapshotList()
Michal Privoznik [Mon, 23 Aug 2021 12:08:10 +0000 (14:08 +0200)] 
virsh-snapshot: Don't leak @then in cmdSnapshotList()

The variable is used inside a loop in which it's allocated in
each iteration. Bring it inside the loop so that g_autoptr()
kicks in each iteration.

Fixes: 3caa28dc50df7ec215713075d669b20bef6473a2
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: qemuxml2*test: switch to virTestRunLog
Ján Tomko [Fri, 20 Aug 2021 14:34:26 +0000 (16:34 +0200)] 
tests: qemuxml2*test: switch to virTestRunLog

This essentially reverts:
commit ca5c8e1dc7801854d856cfc62f2054ae753a40c3
    qemuxml2argvtest: Avoid conditions in test macro

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: cputests: introduce and use virTestRunLog
Ján Tomko [Fri, 20 Aug 2021 14:29:45 +0000 (16:29 +0200)] 
tests: cputests: introduce and use virTestRunLog

A helper that resets the log before each test and prints
it on failure.

It also takes the return variable as an argument,
so it can be used to eliminate number of branches
the compiler has to consider in the main function.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: cputest: remove unnecessary labels
Ján Tomko [Fri, 20 Aug 2021 14:12:04 +0000 (16:12 +0200)] 
tests: cputest: remove unnecessary labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: cputest: use g_autofree
Ján Tomko [Fri, 20 Aug 2021 14:05:08 +0000 (16:05 +0200)] 
tests: cputest: use g_autofree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: cputest: use g_auto for virCPUDef
Ján Tomko [Fri, 20 Aug 2021 14:00:31 +0000 (16:00 +0200)] 
tests: cputest: use g_auto for virCPUDef

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: cputest: use g_auto for virCPUData
Ján Tomko [Fri, 20 Aug 2021 13:57:56 +0000 (15:57 +0200)] 
tests: cputest: use g_auto for virCPUData

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: cputest: use g_auto for virQEMUCaps
Ján Tomko [Fri, 20 Aug 2021 13:53:48 +0000 (15:53 +0200)] 
tests: cputest: use g_auto for virQEMUCaps

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: use g_auto in cpuTestMakeQEMUCaps
Ján Tomko [Thu, 19 Aug 2021 14:32:35 +0000 (16:32 +0200)] 
tests: use g_auto in cpuTestMakeQEMUCaps

Refactor to use automatic cleanup and remove the goto's.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: monitor: define cleanup function for qemuMonitorCPUModelInfo
Ján Tomko [Thu, 19 Aug 2021 14:32:19 +0000 (16:32 +0200)] 
qemu: monitor: define cleanup function for qemuMonitorCPUModelInfo

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agorpm: Enable numactl on s390x
Michal Privoznik [Thu, 19 Aug 2021 14:24:43 +0000 (16:24 +0200)] 
rpm: Enable numactl on s390x

While s390x doesn't have NUMA nodes it has libnuma which is still
helpful as it parses sysfs for us and kernel emulates NUMA#0.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agovirhostmem: Handle numactl-less build in hugepages allocation/reporting
Michal Privoznik [Thu, 19 Aug 2021 13:54:31 +0000 (15:54 +0200)] 
virhostmem: Handle numactl-less build in hugepages allocation/reporting

When using 'virsh freepages' or 'virsh allocpages' then
virHostMemGetFreePages() or virHostMemAllocPages() is called,
respectively. But the following may happen: libvirt was built
without numactl support and thus a fake NUMA node was constructed
for capabilities, which means that startCell is going to be 0.
But we can't blindly pass startCell = 0 to virNumaGetPageInfo()
nor virNumaSetPagePoolSize() because they would operate over node
specific path (/sys/devices/system/node/nodeX) rather than NUMA
agnostic path (/sys/kernel/mm/hugepages/) and we are not
guaranteed that the former exists (kernel might have been built
without NUMA support).

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

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agovirhostmem: Let caller pass max NUMA node to virHostMemAllocPages
Michal Privoznik [Thu, 19 Aug 2021 13:55:19 +0000 (15:55 +0200)] 
virhostmem: Let caller pass max NUMA node to virHostMemAllocPages

In all three cases (LXC, QEMU and VBox drivers) the caller has
access to host capabilities and thus know the maximum NUMA node.
This means, that virHostMemAllocPages() doesn't have to query
it. Querying may fail if libvirt was compiled without numactl
support.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agovirhostmem: Let caller pass max NUMA node to virHostMemGetFreePages
Michal Privoznik [Thu, 19 Aug 2021 13:53:39 +0000 (15:53 +0200)] 
virhostmem: Let caller pass max NUMA node to virHostMemGetFreePages

In all three cases (LXC, QEMU and VBox drivers) the caller has
access to host capabilities and thus know the maximum NUMA node.
This means, that virHostMemGetFreePages() doesn't have to query
it. Querying may fail if libvirt was compiled without numactl
support.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoconf: Introduce virCapabilitiesHostNUMAGetMaxNode()
Michal Privoznik [Thu, 19 Aug 2021 13:21:41 +0000 (15:21 +0200)] 
conf: Introduce virCapabilitiesHostNUMAGetMaxNode()

This is just a small helper that will be used later.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agotests: virnetdev*: remove unnecessary labels
Ján Tomko [Fri, 20 Aug 2021 13:11:52 +0000 (15:11 +0200)] 
tests: virnetdev*: remove unnecessary labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>