]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
3 years agovirshDomainGetVcpuBitmap: Refactor cleanup
Peter Krempa [Wed, 15 Sep 2021 13:13:24 +0000 (15:13 +0200)] 
virshDomainGetVcpuBitmap: Refactor cleanup

Rename the temp variable that is being returned and use automatic
pointer clearing for it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
3 years agovirshDomainGetVcpuBitmap: Return bitmap when taking the fallback path
Peter Krempa [Wed, 15 Sep 2021 13:09:00 +0000 (15:09 +0200)] 
virshDomainGetVcpuBitmap: Return bitmap when taking the fallback path

In case the specific VCPU states are not present in the XML we were
taking a fallback code path just noting that all cpus of the VM are
enabled.

This was broken by a mistake in a recent refactor where a 'goto cleanup'
was mistakenly replaced by a 'return NULL'. This broke reporting of cpus
and also caused a memory leak.

Return the fallback cpu map.

Fixes: bd1f40fe7d4
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2004429
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
3 years agoqemu: validate: Allow 'preserve' action for on_crash lifecycle action
Peter Krempa [Wed, 15 Sep 2021 11:11:40 +0000 (13:11 +0200)] 
qemu: validate: Allow 'preserve' action for on_crash lifecycle action

In fact keeping the VM around for debugging is a desirable configuration
and actually the implementation has no code as we keep the VM around.

Remove the validation and add a note that it's actually used.

Fixes: b1b85a475fb251b9068b75f629479f5c452f1b43
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
3 years agoqemuxml2argvdata: Remove unused '.err' files
Peter Krempa [Tue, 14 Sep 2021 08:09:45 +0000 (10:09 +0200)] 
qemuxml2argvdata: Remove unused '.err' files

These are no longer referenced by any existing test as of:

os-firmware-invalid-type -> a9b1375d7d2f7d240dce09c5f8b62e568e386051
tseg-explicit-size -> 604990a1758bfdc302f3c576c5766c0763912dfd

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemu_tpm: Start swtpm(8) daemon with --terminate switch
Nick Chevsky [Mon, 13 Sep 2021 06:16:18 +0000 (01:16 -0500)] 
qemu_tpm: Start swtpm(8) daemon with --terminate switch

Launch swtpm(8) with the --terminate switch, which guarantees that
the daemon will shut itself down when QEMU dies (current behavior).
We had so far been getting this "for free" (i.e. without --terminate)
due to a defect in upstream's connection handling logic [1], on which
libvirt should not rely since it will eventually be fixed. Adding
--terminate preserves and guarantees the current behavior.

[1] https://github.com/stefanberger/swtpm/pull/509

Signed-off-by: Nick Chevsky <nchevsky@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agonode_device_conf: Don't prealloc @vfs in virNodeDeviceGetPCISRIOVCaps()
Michal Privoznik [Sun, 12 Sep 2021 06:28:48 +0000 (08:28 +0200)] 
node_device_conf: Don't prealloc @vfs in virNodeDeviceGetPCISRIOVCaps()

The array of virtual functions @vfs in
virNodeDeviceGetPCISRIOVCaps() is allocated twice: the first time
during its declaration and the second time inside
virPCIGetVirtualFunctions() which leads to a memleak:

==16691== 1,128 bytes in 47 blocks are definitely lost in loss record 1,771 of 1,803
==16691==    at 0x4844CC1: calloc (vg_replace_malloc.c:1117)
==16691==    by 0x4E50070: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.6800.3)
==16691==    by 0x4A7B034: virNodeDeviceGetPCISRIOVCaps (node_device_conf.c:2649)
==16691==    by 0x4A7B5E2: virNodeDeviceGetPCIDynamicCaps (node_device_conf.c:2762)
==16691==    by 0xA7F6E18: udevProcessPCI (node_device_udev.c:418)

Fixes: c97518d9b833a607f29b9bb02e3fbe74c011c088
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: Format @variable properly
Michal Privoznik [Fri, 10 Sep 2021 12:55:02 +0000 (14:55 +0200)] 
docs: Format @variable properly

When documenting our public API in some places we use '@' to
refer to the variable. For instance:

 * This API tries to set guest time to the given value. The time
 * to set (@seconds and @nseconds) should be in seconds relative
 * to the Epoch of 1970-01-01 00:00:00 in UTC.

However, when generating HTML documentation these tokens are
copied verbatim. What we can do is drop the '@' character and
wrap the variable in <code/> so that it is formatted properly.

Due to the way we 'parse' docs a token might actually be slightly
more than just '@variable'. For instance in the example above we
will have the following tokens: '(@seconds' and '@nseconds)'.
Thus we need to handle possible substring before and after
variable.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: add nodedev-info
Jonathon Jongsma [Wed, 2 Jun 2021 20:27:41 +0000 (15:27 -0500)] 
virsh: add nodedev-info

This is currently the only way to view the 'autostart' property for a
node device in virsh.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agonodedev: Implement virNodeDeviceIsPersistent()/IsActive()
Jonathon Jongsma [Thu, 3 Jun 2021 18:28:39 +0000 (13:28 -0500)] 
nodedev: Implement virNodeDeviceIsPersistent()/IsActive()

Implement these new API functions in the nodedev driver.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoapi: add virNodeDeviceIsPersistent()/IsActive()
Jonathon Jongsma [Thu, 3 Jun 2021 18:21:00 +0000 (13:21 -0500)] 
api: add virNodeDeviceIsPersistent()/IsActive()

These two public APIs are implemented for almost all other objects that
have a concept of persistent definition and activatability. Now that we
have node devices (mdevs) that can be defined and inactive, it will be
useful to query the persistent/active state of node devices as well.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agovirsh: add nodedev-autostart
Jonathon Jongsma [Thu, 27 May 2021 21:20:13 +0000 (16:20 -0500)] 
virsh: add nodedev-autostart

Add ability to set node devices to autostart on boot or parent device
availability.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agonodedev: Add tests for mdevctl autostart command
Jonathon Jongsma [Thu, 27 May 2021 21:06:19 +0000 (16:06 -0500)] 
nodedev: Add tests for mdevctl autostart command

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agonodedev: implement virNodeDevice(Get|Set)Autostart()
Jonathon Jongsma [Wed, 26 May 2021 20:09:29 +0000 (15:09 -0500)] 
nodedev: implement virNodeDevice(Get|Set)Autostart()

Implement autostart functionality for mediated devices.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoapi: add virNodeDevice(Get|Set)Autostart()
Jonathon Jongsma [Wed, 26 May 2021 14:06:12 +0000 (09:06 -0500)] 
api: add virNodeDevice(Get|Set)Autostart()

This will allow persistent mediated devices to be configured to be
restarted automatically when the host reboots.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agolibxl: Don't autostart domains on driver reload
Jim Fehlig [Tue, 14 Sep 2021 17:11:11 +0000 (11:11 -0600)] 
libxl: Don't autostart domains on driver reload

When libxlAutostartDomain was introduced with commit fb92307f0d, one hunk
mistakenly added a call site in libxlStateReload. Domains should not be
autostarted when reloading the driver, so remove the offending hunk.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agolibxl: Fix driver reload
Jim Fehlig [Mon, 13 Sep 2021 22:04:41 +0000 (16:04 -0600)] 
libxl: Fix driver reload

On reload, the libxl driver calls virDomainObjListLoadAllConfigs to load
all configs from /etc/libvirt/libxl/ but incorrectly passes 'true' for
the liveStatus parameter, resulting in error messages such as

libvirtd[21053]: XML error: unexpected root element <domain>, expecting <domstatus>
libvirtd[21053]: Failed to load config for domain 'sles15sp3'

Fix by not requesting live status when re-reading the persistent VM config
files.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agolibxl: Improve reporting of die_id in capabilities
Jim Fehlig [Fri, 10 Sep 2021 20:34:09 +0000 (14:34 -0600)] 
libxl: Improve reporting of die_id in capabilities

On Xen, libvirt runs in a VM (typically dom0) and does not have an accurate
picture of numa and cpu topology of the underlying physical machine using
the "usual" mechanisms. numa info and cpu toplogy are retrieved from libxl
and used to populate the libvirt conterparts. Commit 7b79ee2f78b introduced
support for reporting die_id in capabilities, but did not account for
special handling of numa and cpu topology in libxl.

Currently, Xen does not report die_id in the libxl_cputopology structure.
In the meantime, set die_id to 0, which was suggested by the Xen developers
and is slightly better than random garbage such as

<cpu id='1' socket_id='0' die_id='-1073069552' core_id='0' siblings='0-1'/>

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoci: Regenerate configuration from manifest
Andrea Bolognani [Fri, 10 Sep 2021 14:54:44 +0000 (16:54 +0200)] 
ci: Regenerate configuration from manifest

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoci: Add Debian 11 builds
Andrea Bolognani [Fri, 10 Sep 2021 14:48:25 +0000 (16:48 +0200)] 
ci: Add Debian 11 builds

The armv7l and ppc64le cross-builds as well as the Clang build
are adopted from Debian 10, while the mips64el build is adopted
from Debian sid. As always, the way jobs are distributed across
Debian versions is fairly arbitrary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoci: Avoid use of magic constants
Andrea Bolognani [Fri, 10 Sep 2021 13:35:49 +0000 (15:35 +0200)] 
ci: Avoid use of magic constants

The value 3 is the length of the "ci-" prefix, which is present
in the items returned by get_registry_images() but not in those
returned by get_dockerfiles().

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Beraldo Leal <bleal@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoci: Restore information about Coverity integration
Andrea Bolognani [Fri, 10 Sep 2021 13:27:44 +0000 (15:27 +0200)] 
ci: Restore information about Coverity integration

These were removed along with the outdated information on how
to regenerate the Dockerfiles contained in the repository, but
this part is still relevant.

Reverts: 30856d2865122f82ec25c258c7cd2cceb52aa7a5 (partially)
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodocs: Fix dimm example
Michal Privoznik [Sun, 12 Sep 2021 07:30:29 +0000 (09:30 +0200)] 
docs: Fix dimm example

In the example for <memory model='dimm'/> we show how to
configure hugepages as backend. In the example we show 4MiB
hugepages which are non-standard and thus at the first glance may
mislead users thinking that a regular sized pages (4K) will be
used. Use 2MiB as the value instead.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agosrc: network_conf: propagate only bool to virNetworkDefParseString()
Kristina Hanicova [Fri, 10 Sep 2021 14:48:22 +0000 (16:48 +0200)] 
src: network_conf: propagate only bool to virNetworkDefParseString()

We don't need to propagate all public flags, only the information
about the presence of the validation one, which can differ from
function to function. This patch makes it easier and more
readable in case of a future additions of validation flags.
This change was suggested by Daniel.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuDomainChangeDiskLive: Modify 'startupPolicy' before changing source
Peter Krempa [Fri, 10 Sep 2021 13:33:17 +0000 (15:33 +0200)] 
qemuDomainChangeDiskLive: Modify 'startupPolicy' before changing source

We don't support all startup policies with all source types so to
correctly allow switching from a 'file' based cdrom with 'optional'
startup policy to a 'block' based one which doesn't support optional we
must update the startup policy field first. Obviously we need to have
fallback if the update fails.

Reported-by: Vojtech Juranek <vjuranek@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuProcessQMPInit: Use long options for '-qmp' when probing qemu.
Peter Krempa [Fri, 10 Sep 2021 12:16:50 +0000 (14:16 +0200)] 
qemuProcessQMPInit: Use long options for '-qmp' when probing qemu.

'-qmp' in this case behaves the same as '-chardev' so it should have
been converted the same way as others were in 43c9c0859f2d53321 since
short options are deprecated.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoci: remove obsolete logic for refreshing containers/cirrus
Daniel P. Berrangé [Thu, 9 Sep 2021 13:20:44 +0000 (14:20 +0100)] 
ci: remove obsolete logic for refreshing containers/cirrus

We now use lcitool's manifest feature to generate files. The logic
for checking for stale containers in the registry, however, is still
relevant so that is propagated to a standalone command.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoci: remove obsolete refresh documentation
Daniel P. Berrangé [Thu, 9 Sep 2021 13:20:11 +0000 (14:20 +0100)] 
ci: remove obsolete refresh documentation

We now use lcitool's manifest feature to generate files.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoci: re-generate containers/gitlab config from manifest
Daniel P. Berrangé [Thu, 9 Sep 2021 13:49:01 +0000 (14:49 +0100)] 
ci: re-generate containers/gitlab config from manifest

This uses the command "lcitool manifest ci/manifest.yml" to re-generate
all existing dockerfiles and gitlab CI config.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agogitlab: define a manifest file to express the CI config
Daniel P. Berrangé [Wed, 25 Nov 2020 12:05:41 +0000 (12:05 +0000)] 
gitlab: define a manifest file to express the CI config

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agogitlab: fold sanitizer jobs into regular ubuntu jobs
Daniel P. Berrangé [Thu, 9 Sep 2021 13:47:48 +0000 (14:47 +0100)] 
gitlab: fold sanitizer jobs into regular ubuntu jobs

The sanitizer jobs run in ubuntu 20.04 containers and thus overlap with
testing already done for the regular ubuntu 20.04 build job. Fold the
sanitizer run for GCC into the regular build job and add a second
ubuntu 20.04 build job for CLang sanitizers.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agogitlab: refresh containers / cirrus files with latest content
Daniel P. Berrangé [Mon, 19 Jul 2021 12:36:51 +0000 (13:36 +0100)] 
gitlab: refresh containers / cirrus files with latest content

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agogitlab: move codestyle job to the sanity_checks stage
Daniel P. Berrangé [Wed, 12 May 2021 17:27:56 +0000 (18:27 +0100)] 
gitlab: move codestyle job to the sanity_checks stage

It was in the build stage previously to let it run in parallel with
other build jobs, but with the "needs" clause this is not required.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agolibvirt-domain.c: Fix typo in virDomainAttachDevice doc
Michal Privoznik [Fri, 10 Sep 2021 08:58:55 +0000 (10:58 +0200)] 
libvirt-domain.c: Fix typo in virDomainAttachDevice doc

In the documentation to virDomainAttachDevice() we refer to a
non-existent virDomainUpdateDeviceFlag() function. The correct
name is virDomainUpdateDeviceFlags().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: remove pointless labels
Ján Tomko [Sat, 4 Sep 2021 20:41:46 +0000 (22:41 +0200)] 
tests: remove pointless labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: vir: remove pointless labels
Ján Tomko [Sat, 4 Sep 2021 20:41:36 +0000 (22:41 +0200)] 
tests: vir: remove pointless labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: vshtabletest: remove pointless labels
Ján Tomko [Sat, 4 Sep 2021 20:40:50 +0000 (22:40 +0200)] 
tests: vshtabletest: remove pointless labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: nwfilter: remove pointless labels
Ján Tomko [Sat, 4 Sep 2021 20:40:20 +0000 (22:40 +0200)] 
tests: nwfilter: remove pointless labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: libxl: remove pointless labels
Ján Tomko [Sat, 4 Sep 2021 20:39:45 +0000 (22:39 +0200)] 
tests: libxl: remove pointless labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: vmx: remove pointless labels
Ján Tomko [Sat, 4 Sep 2021 20:39:27 +0000 (22:39 +0200)] 
tests: vmx: remove pointless labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: qemu: remove pointless labels
Ján Tomko [Sat, 4 Sep 2021 20:38:39 +0000 (22:38 +0200)] 
tests: qemu: remove pointless labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: use g_auto instead of virDomainFree
Ján Tomko [Sat, 4 Sep 2021 19:50:02 +0000 (21:50 +0200)] 
tests: use g_auto instead of virDomainFree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: use g_auto instead of vshTableFree
Ján Tomko [Sat, 4 Sep 2021 18:57:24 +0000 (20:57 +0200)] 
tests: use g_auto instead of vshTableFree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: use VIR_AUTOCLOSE
Ján Tomko [Sat, 4 Sep 2021 18:45:22 +0000 (20:45 +0200)] 
tests: use VIR_AUTOCLOSE

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: use g_auto instead of VIR_FORCE_FCLOSE
Ján Tomko [Sat, 4 Sep 2021 18:15:29 +0000 (20:15 +0200)] 
tests: use g_auto instead of VIR_FORCE_FCLOSE

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: use g_auto for virCPUDataFree
Ján Tomko [Fri, 3 Sep 2021 20:59:14 +0000 (22:59 +0200)] 
tests: use g_auto for virCPUDataFree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: use g_autoptr instead of virJSONValueFree
Ján Tomko [Fri, 3 Sep 2021 20:45:48 +0000 (22:45 +0200)] 
tests: use g_autoptr instead of virJSONValueFree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: use g_autofree
Ján Tomko [Sat, 4 Sep 2021 20:37:44 +0000 (22:37 +0200)] 
tests: use g_autofree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: vir: use g_autofree
Ján Tomko [Sat, 4 Sep 2021 20:37:31 +0000 (22:37 +0200)] 
tests: vir: use g_autofree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: vmx: use g_autofree
Ján Tomko [Sat, 4 Sep 2021 20:37:06 +0000 (22:37 +0200)] 
tests: vmx: use g_autofree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: nwfilter: use g_autofree
Ján Tomko [Sat, 4 Sep 2021 20:36:29 +0000 (22:36 +0200)] 
tests: nwfilter: use g_autofree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: libxl: use g_autofree
Ján Tomko [Sat, 4 Sep 2021 20:36:12 +0000 (22:36 +0200)] 
tests: libxl: use g_autofree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: network: use g_autofree
Ján Tomko [Sat, 4 Sep 2021 20:35:15 +0000 (22:35 +0200)] 
tests: network: use g_autofree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: qemu: use g_autofree
Ján Tomko [Sat, 4 Sep 2021 20:33:55 +0000 (22:33 +0200)] 
tests: qemu: use g_autofree

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: use g_autoptr instead of virObjectUnref
Ján Tomko [Fri, 20 Aug 2021 13:53:53 +0000 (15:53 +0200)] 
tests: use g_autoptr instead of virObjectUnref

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agoconf: add cleanup func for virMacMap
Ján Tomko [Sat, 4 Sep 2021 20:28:04 +0000 (22:28 +0200)] 
conf: add cleanup func for virMacMap

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agoconf: add cleanup func for virNetworkXMLOption
Ján Tomko [Sat, 4 Sep 2021 20:27:47 +0000 (22:27 +0200)] 
conf: add cleanup func for virNetworkXMLOption

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agotests: virnetdaemontest: split variable declarations
Ján Tomko [Fri, 3 Sep 2021 19:34:23 +0000 (21:34 +0200)] 
tests: virnetdaemontest: split variable declarations

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agodocs: virtiofs: remove extra slash
Ján Tomko [Thu, 9 Sep 2021 15:53:18 +0000 (17:53 +0200)] 
docs: virtiofs: remove extra slash

Reported-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: virtiofs: provide more context for elements
Ján Tomko [Thu, 9 Sep 2021 15:52:38 +0000 (17:52 +0200)] 
docs: virtiofs: provide more context for elements

Suggested-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: virtiofs: use the preferred virtiofs spelling
Stefan Hajnoczi [Thu, 9 Sep 2021 14:58:29 +0000 (15:58 +0100)] 
docs: virtiofs: use the preferred virtiofs spelling

The virtiofs project started off using "virtio-fs" but later switched to
the "virtiofs" spelling because it matches the spelling of the mount -t
virtiofs command-line. Update the kbase article with the new spelling so
it matches the virtiofs website.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agodocs: virtiofs: move legacy docs to the bottom
Stefan Hajnoczi [Thu, 9 Sep 2021 14:58:28 +0000 (15:58 +0100)] 
docs: virtiofs: move legacy docs to the bottom

A number of legacy issues make the virtiofs kbase article hard to
understand. Most users don't need to configure NUMA or a memory backend
other than memfd. Move that information to the bottom of the article so
the recommended syntax is most prominent.

Suggested-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: stop probing for '-device sga' support
Daniel P. Berrangé [Wed, 8 Sep 2021 17:15:32 +0000 (18:15 +0100)] 
qemu: stop probing for '-device sga' support

Since we no longer use '-device sga' we can stop probing for this device
in our capabilities code.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu: switch to use -M graphics=off instead of -device sga
Daniel P. Berrangé [Wed, 8 Sep 2021 17:12:58 +0000 (18:12 +0100)] 
qemu: switch to use -M graphics=off instead of -device sga

SeaBIOS >= 1.11 has built-in support for outputting to the serial
console when QEMU sets -M graphics=off. Our minimum QEMU version
is 2.11.0, which bundled SeaBIOS 1.11. Thus we have no need to
use '-device sga' anymore.

This change results in a slight layout difference for option ROMs
in memory, however, it does not affect the migration data stream
format on the wire and once migration is complete the target QEMU
memory layout for ROMs matches the source QEMU once again.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu: tweak error message to be more general purpose
Daniel P. Berrangé [Wed, 8 Sep 2021 16:50:10 +0000 (17:50 +0100)] 
qemu: tweak error message to be more general purpose

The BIOS serial console output is currently implemented using the QEMU
'sga' device, but this is going to change in future patches, so the
error message ought to be more generically phrased.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu: prevent use of <bios useserial='yes'> on non-x86 arches
Daniel P. Berrangé [Wed, 8 Sep 2021 16:47:40 +0000 (17:47 +0100)] 
qemu: prevent use of <bios useserial='yes'> on non-x86 arches

The <bios useserial='yes'> config results in use of the '-device sga'
QEMU options. This in turn causes QEMU go load the sgabios.bin option
ROM, which contains x86 machine code. This cannot work on non-x86
arches, thus we should block the bad config.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoTranslated using Weblate (Korean)
jason lee [Thu, 9 Sep 2021 08:29:41 +0000 (10:29 +0200)] 
Translated using Weblate (Korean)

Currently translated at 49.4% (5118 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 (Swedish)
Göran Uddeborg [Thu, 9 Sep 2021 08:29:40 +0000 (10:29 +0200)] 
Translated using Weblate (Swedish)

Currently translated at 27.7% (2873 of 10353 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
3 years agoTranslated using Weblate (Korean)
simmon [Thu, 9 Sep 2021 08:29:40 +0000 (10:29 +0200)] 
Translated using Weblate (Korean)

Currently translated at 49.3% (5110 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 48.6% (5038 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 48.3% (5008 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 48.3% (5003 of 10353 strings)

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

Translated using Weblate (Korean)

Currently translated at 47.9% (4968 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 agoch_driver: Handle validation failure correctly
William Douglas [Wed, 8 Sep 2021 18:01:23 +0000 (11:01 -0700)] 
ch_driver: Handle validation failure correctly

When validation like deviceValidateCallback fails, the vm will not be
set and so the call to virDomainObjListRemove will be passed a NULL
pointer causing a segfault. To prevent this add a check that the vm is
defined before calling out to virDomainObjListRemove.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agoch_driver: Add handler for console API
William Douglas [Wed, 8 Sep 2021 18:01:22 +0000 (11:01 -0700)] 
ch_driver: Add handler for console API

Enable the handler function to find and open the console character
device that will be used by the console API.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agoch_domain: Allow controller and chr devices
William Douglas [Wed, 8 Sep 2021 18:01:21 +0000 (11:01 -0700)] 
ch_domain: Allow controller and chr devices

With the console and serial device handling fully functional, allow
the required device types to be specified in the domain
configuration.

The configuration only supports a single serial or console device.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agoch_process: Handle enabled console devices
William Douglas [Wed, 8 Sep 2021 18:01:20 +0000 (11:01 -0700)] 
ch_process: Handle enabled console devices

Add functionality to allow libvirt console to connect to the
cloud-hypervisor created PTY associated with a VM by updating the
domain with console path information. This has to be run after the VM
is created by cloud-hypervisor.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agoch_monitor: Add pty json builder function
William Douglas [Wed, 8 Sep 2021 18:01:19 +0000 (11:01 -0700)] 
ch_monitor: Add pty json builder function

Add function to build the the json structure to configure a PTY in
cloud-hypervisor.

The devices themselves still aren't allowed in configurations yet
though.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agoch_monitor: Make virCHMonitorGet function static
William Douglas [Wed, 8 Sep 2021 18:01:16 +0000 (11:01 -0700)] 
ch_monitor: Make virCHMonitorGet function static

The virCHMonitorGet function isn't going to be used outside of the
monitor, so remove the initial declaration and define the function
to be static.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agoch_monitor: Use virCHMonitorGet to access cloud-hypervisor API
William Douglas [Wed, 8 Sep 2021 18:01:18 +0000 (11:01 -0700)] 
ch_monitor: Use virCHMonitorGet to access cloud-hypervisor API

Now that virCHMonitorGet is capable of handling data returned by the
cloud-hypervisor API, make use of this via virCHMonitorGetInfo to call
into the vm.info endpoint.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agoch_monitor: Update virCHMonitorGet to handle accept a response
William Douglas [Wed, 8 Sep 2021 18:01:17 +0000 (11:01 -0700)] 
ch_monitor: Update virCHMonitorGet to handle accept a response

The virCHMonitorGet function needed to be able to return data from the
hypervisor. This functionality is needed in order for the driver to
support PTY enablement and getting details about the VM state.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agoch_domain: Add virChrdevs for console support
William Douglas [Wed, 8 Sep 2021 18:01:15 +0000 (11:01 -0700)] 
ch_domain: Add virChrdevs for console support

Add and initialize a virChrdevs to the _virCHDomainObjPrivate
structure in order to eventually track the consoles in use by a domain.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agovirstoragetest: Reinstate testing of images without 'backing_fmt'
Peter Krempa [Wed, 8 Sep 2021 15:57:30 +0000 (17:57 +0200)] 
virstoragetest: Reinstate testing of images without 'backing_fmt'

There are important security implications when we'd misprobe those
images. This commit reinstates the tests removed by commit 979d1ba3ae13
since 'qemu-img' refused to format them.

With the new testing approach with stored images we won't run into that
problem.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Remove pointless goto from mymain
Peter Krempa [Thu, 9 Sep 2021 07:53:30 +0000 (09:53 +0200)] 
virstoragetest: Remove pointless goto from mymain

Improve the error message and abort the test. Continuing here is not
desired as without chdiring into the appropriate directory the test
would fail anyways and worse could attempt stat-ing random files on the
host.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Don't skip the whole test when qemu-img fails to format images
Peter Krempa [Wed, 8 Sep 2021 15:28:51 +0000 (17:28 +0200)] 
virstoragetest: Don't skip the whole test when qemu-img fails to format images

We have plenty of other work to do in this test. Skip only the real
image testing case when we can't find qemu-img or it failed to format
the image.

This allows us to also remove the last global variable in the test and
move the creation and cleanup of the images closer to the actual test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: testStorageChain: Skip test if filename is NULL
Peter Krempa [Wed, 8 Sep 2021 12:10:51 +0000 (14:10 +0200)] 
virstoragetest: testStorageChain: Skip test if filename is NULL

Prepare the test runner for skipping individual tests if images can't be
formatted rather than the whole virstoragetest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: testPrepImages: Use 'qemu-img' to format 'raw' image
Peter Krempa [Wed, 8 Sep 2021 15:14:29 +0000 (17:14 +0200)] 
virstoragetest: testPrepImages: Use 'qemu-img' to format 'raw' image

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: testPrepImages: Don't reuse 'cmd' pointer
Peter Krempa [Wed, 8 Sep 2021 15:13:04 +0000 (17:13 +0200)] 
virstoragetest: testPrepImages: Don't reuse 'cmd' pointer

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Assume that 'qemu-img' supports '-o compat='
Peter Krempa [Wed, 8 Sep 2021 15:11:00 +0000 (17:11 +0200)] 
virstoragetest: Assume that 'qemu-img' supports '-o compat='

All supported qemu versions have the parameter, so we don't need to
check. This allows us to simplify the code used for formating real
images for virstoragetest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Don't rewrite the 'qcow2' image
Peter Krempa [Wed, 8 Sep 2021 15:07:31 +0000 (17:07 +0200)] 
virstoragetest: Don't rewrite the 'qcow2' image

Create it with the appropriate backing file path rather than using
another instance of 'qemu-img rebase'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Stop rewriting images in 'mymain'
Peter Krempa [Wed, 8 Sep 2021 14:49:03 +0000 (16:49 +0200)] 
virstoragetest: Stop rewriting images in 'mymain'

For testing of real images formatted by 'qemu-img' it's now sufficient
to format them once without the need to rewrtie them since we use the
real images only for testing of one scenario.

This allows us to also remove most of the global variables holding the
path to the images which was necessary when they were being rewritten.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Unify testing of QCOW2 images with absolute backing
Peter Krempa [Wed, 8 Sep 2021 14:44:13 +0000 (16:44 +0200)] 
virstoragetest: Unify testing of QCOW2 images with absolute backing

We have 3 test cases for this currently:

1) "qcow2->raw"
 1.1) VIR_STORAGE_FILE_QCOW2 as top level format
 1.2) VIR_STORAGE_FILE_AUTO as top level format
2) "wrap->qcow2->raw" whith just VIR_STORAGE_FILE_QCOW2

This patch adds also testing of VIR_STORAGE_FILE_AUTO for case 2) and
removes both 1) subcases as they are being actually tested as part of
2).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Use preformatted qcow2 image for testing relative paths
Peter Krempa [Wed, 8 Sep 2021 12:08:47 +0000 (14:08 +0200)] 
virstoragetest: Use preformatted qcow2 image for testing relative paths

More preparation for eliminating image rewriting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Convert symlink and relative image testing use preformatted images
Peter Krempa [Wed, 8 Sep 2021 14:30:52 +0000 (16:30 +0200)] 
virstoragetest: Convert symlink and relative image testing use preformatted images

Use prepared test images instead to simplify and clarify the code
instead of rewriting existing images multiple times.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Use existing file for testing 'raw' image lookup
Peter Krempa [Wed, 8 Sep 2021 12:01:42 +0000 (14:01 +0200)] 
virstoragetest: Use existing file for testing 'raw' image lookup

We've already added a 'raw' file to the example image directory so we
can use that instead of formatting one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Use preformatted file for testing missing backing store
Peter Krempa [Wed, 8 Sep 2021 07:18:03 +0000 (09:18 +0200)] 
virstoragetest: Use preformatted file for testing missing backing store

Similarly to previous ones, this one doesn't need to be created by
qemu-img in order for the test to make sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Use pre-formatted file for non-path extraction test
Peter Krempa [Wed, 8 Sep 2021 07:11:54 +0000 (09:11 +0200)] 
virstoragetest: Use pre-formatted file for non-path extraction test

This one doesn't require using qemu-img either.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Use a pre-formatted QED file for testing backing store extraction
Peter Krempa [Wed, 8 Sep 2021 07:06:08 +0000 (09:06 +0200)] 
virstoragetest: Use a pre-formatted QED file for testing backing store extraction

The QED format isn't really being developed any more. Use a
pre-formatted image to test the existing code. In this instance we
switch to using a relative backing path for simplicity.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Use existing directory in the source tree for 'directory' probing...
Peter Krempa [Wed, 8 Sep 2021 07:03:06 +0000 (09:03 +0200)] 
virstoragetest: Use existing directory in the source tree for 'directory' probing tests

We don't need a special directory for the tests. Reuse the directory
holding the data for the virstoragetest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Test backing chain loops with hardcoded images
Peter Krempa [Mon, 6 Sep 2021 14:56:19 +0000 (16:56 +0200)] 
virstoragetest: Test backing chain loops with hardcoded images

Provide the images for the self and mutual backing image loop cases in
the repository rather than formatting them with qemu-img.

This makes the code more readable and also decouples the backing chain
tests from each other.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Rework TEST_LOOKUP* cases to work on fake backing chain
Peter Krempa [Tue, 7 Sep 2021 16:58:32 +0000 (18:58 +0200)] 
virstoragetest: Rework TEST_LOOKUP* cases to work on fake backing chain

Rather than using 'qemu-img' and rewriting the chain we can use fake
data and few empty files to ensure the same level of coverage. This is
possible since we've already tested that the metadata parsing from files
works properly and the only thing we are testing here is that the
symlink resolution works properly.

Additionally after the refactor of 'virstoragetest' is complete
additional tests on real data will be added.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Remove redundant arguments for chain lookup tests
Peter Krempa [Tue, 7 Sep 2021 15:32:22 +0000 (17:32 +0200)] 
virstoragetest: Remove redundant arguments for chain lookup tests

Passing in both "chain*" and "chain*->path" is pointless. Use only the
full struct which we can use to infer the rest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Store output of TEST_CHAIN in output files
Peter Krempa [Mon, 6 Sep 2021 12:13:29 +0000 (14:13 +0200)] 
virstoragetest: Store output of TEST_CHAIN in output files

The TEST_CHAIN cases were storing the expected output (or rather data
to generate the expected output) in code. This made the code really hard
to follow and even harder to modify to add new cases.

This patch modifies the code to store the expected output in text files
(using the same generator as we've used to) and uses
'virTestCompareToFile' to check the outputs.

The result is that the code is way simpler and doesn't require fiddling
with 'testFileData' structs when adding new cases. Additionally this
removes mixing of code and declaration so we can stop disabling the
warning for this file.

Another advantage is that the tests are now named so it's easier to
figure out if one of them breaks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotestutils: Introduce helper for stripping bulilddir/srcdir from test outputs
Peter Krempa [Tue, 7 Sep 2021 13:31:42 +0000 (15:31 +0200)] 
testutils: Introduce helper for stripping bulilddir/srcdir from test outputs

In certain cases we want to be able to compare test output containing
real paths against a static output file and thus we need a helper which
strips srcdir/builddir from given path.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Drop testing of NBD backends via parsing real images
Peter Krempa [Mon, 6 Sep 2021 11:35:09 +0000 (13:35 +0200)] 
virstoragetest: Drop testing of NBD backends via parsing real images

We now have specific tests for the backing store parser and previous
tests cover the extraction of the backing store string so there's no
need for these particular tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>