]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
2 years agoqemuxml2xmloutdata: Don't symlink output data for 'mach-virt*' cases
Peter Krempa [Tue, 28 Mar 2023 13:52:46 +0000 (15:52 +0200)]
qemuxml2xmloutdata: Don't symlink output data for 'mach-virt*' cases

Replace them with full files so that potential fallout from conversion
to real capabilities is more obvious and the test is simpler to add.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2xmltest: Modernize 'aarch64-gic*' test cases
Peter Krempa [Fri, 24 Mar 2023 15:47:03 +0000 (16:47 +0100)]
qemuxml2xmltest: Modernize 'aarch64-gic*' test cases

Use real capabilities for them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2xmlout: Do not symlink output files for 'aarch64-gic' cases
Peter Krempa [Tue, 28 Mar 2023 13:48:09 +0000 (15:48 +0200)]
qemuxml2xmlout: Do not symlink output files for 'aarch64-gic' cases

Upcoming patch will be modifying all of them to use real capabilities.
This way it will be more obvious what will change.

Keeping the symlinks around is tedious for humans to do. Waste some
storage instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Modernize the rest of 'aarch64' cases
Peter Krempa [Fri, 24 Mar 2023 14:42:43 +0000 (15:42 +0100)]
qemuxml2argvtest: Modernize the rest of 'aarch64' cases

Use real capabilities for them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2(argv|xml)test: Modernize testing of USB controllers on aarch64
Peter Krempa [Fri, 24 Mar 2023 15:33:06 +0000 (16:33 +0100)]
qemuxml2(argv|xml)test: Modernize testing of USB controllers on aarch64

All supported qemu versions at this point support both 'qemu-xhci' and
'nec-xhci' controllers. To allow using real capabilities restructure the
tests so that we test both controllers explicitly as well as the
selection of the default model.

Also add a xml2xml test invocation of the unified test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2*test: Drop fake-caps invocation of 'aarch64-virtio-pci-manual-addresses'
Peter Krempa [Tue, 28 Mar 2023 12:49:37 +0000 (14:49 +0200)]
qemuxml2*test: Drop fake-caps invocation of 'aarch64-virtio-pci-manual-addresses'

The fake-caps version was kept as an example that the code behaves the
same with real capabilities. Now it's not needed any more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Update 'aarch64-virtio-pci-manual-addresses' case
Peter Krempa [Tue, 28 Mar 2023 12:41:57 +0000 (14:41 +0200)]
qemuxml2argvtest: Update 'aarch64-virtio-pci-manual-addresses' case

With all supported qemu versions we'll pick PCIe to use for the implicit
address busses (those lacking an explicit controller) and thus the
addresses must reflect that.

Update the test to add the new flags, and fix the addresses.
Additionally add a real-caps version of the test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Modernize all 'mach-virt-' aarch64 test cases
Peter Krempa [Fri, 24 Mar 2023 14:41:25 +0000 (15:41 +0100)]
qemuxml2argvtest: Modernize all 'mach-virt-' aarch64 test cases

Use real capabilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Don't symlink output files for 'mach-virt-' cases
Peter Krempa [Fri, 24 Mar 2023 15:28:24 +0000 (16:28 +0100)]
qemuxml2argvtest: Don't symlink output files for 'mach-virt-' cases

Make the output changes of upcoming modernization more visible.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Modernize 'balloon-mmio-deflate'
Peter Krempa [Fri, 24 Mar 2023 14:49:25 +0000 (15:49 +0100)]
qemuxml2argvtest: Modernize 'balloon-mmio-deflate'

Use real capabilities and mask-out support for PCIe.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argv: Test default aarch64 cofig without PCIe support
Peter Krempa [Fri, 24 Mar 2023 12:08:13 +0000 (13:08 +0100)]
qemuxml2argv: Test default aarch64 cofig without PCIe support

Use real caps and clear out flags for PCIe so that we have a real-ish
example of an aarch64 machine using mmio.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Drop "aarch64-virt-2.6-virtio-pci-default" case
Peter Krempa [Fri, 24 Mar 2023 15:11:56 +0000 (16:11 +0100)]
qemuxml2argvtest: Drop "aarch64-virt-2.6-virtio-pci-default" case

The test data is effectively identical to the
'aarch64-virtio-pci-default' case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Add real-caps versions of 'aarch64-virt-virtio'
Peter Krempa [Fri, 24 Mar 2023 12:03:27 +0000 (13:03 +0100)]
qemuxml2argvtest: Add real-caps versions of 'aarch64-virt-virtio'

Add a version for 'latest' caps as well as '4.2.0'. The test
demonstrates that with a real qemu PCIe will be used instead of MMIO.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Convert the rest of GIC tests to latest capabilities
Peter Krempa [Fri, 24 Mar 2023 10:15:40 +0000 (11:15 +0100)]
qemuxml2argvtest: Convert the rest of GIC tests to latest capabilities

Convert the two negative cases to use real capapbilities as well as the
positive case for situations when KVM is not used by stripping the
QEMU_CAPS_KVM flag.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Convert DO_TEST_GIC to use real latest capabilities
Peter Krempa [Fri, 24 Mar 2023 09:31:13 +0000 (10:31 +0100)]
qemuxml2argvtest: Convert DO_TEST_GIC to use real latest capabilities

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Use real capabilities in tests for picking the aarch64 GIC version
Peter Krempa [Fri, 24 Mar 2023 09:46:42 +0000 (10:46 +0100)]
qemuxml2argvtest: Use real capabilities in tests for picking the aarch64 GIC version

Convert 'aarch64-gic-default' and 'aarch64-gic-none' cases to use real
capabilities both latest and locked to 4.2.0 to show what would happen
with a real qemu.

Note that the qemuTestSetHostArch() calls are needed as real caps
override the setting once used. Once we convert all tests to real data
this can be dropped.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvdata: Do not symlink output files for aarch64 gic tests
Peter Krempa [Fri, 24 Mar 2023 09:55:41 +0000 (10:55 +0100)]
qemuxml2argvdata: Do not symlink output files for aarch64 gic tests

Upcoming patches will be modifying the tests for selecting the GIC
version to use real capabilities. This in certain cases will show that a
different version is picked.

Using symlinks makes it inconvenient to do the modifications and
unobvious what changed.

Remove the symlinks and replace them by real output files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainPCIAddressSetExtensionAlloc: Remove return value
Peter Krempa [Tue, 28 Mar 2023 12:37:40 +0000 (14:37 +0200)]
virDomainPCIAddressSetExtensionAlloc: Remove return value

The function always returns 0. Remove the return value and refactor
caller.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoAdded translation using Weblate (Romanian)
Remus-Gabriel Chelu [Sat, 8 Apr 2023 23:47:23 +0000 (01:47 +0200)]
Added translation using Weblate (Romanian)

Co-authored-by: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
Signed-off-by: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>
2 years agoutil: acpi: include unistd.h
Ján Tomko [Thu, 6 Apr 2023 13:39:37 +0000 (15:39 +0200)]
util: acpi: include unistd.h

For lseek.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2 years agoviracpi: Fir error format string in virAcpiParseIORTNodeHeader()
Michal Privoznik [Thu, 6 Apr 2023 12:27:00 +0000 (14:27 +0200)]
viracpi: Fir error format string in virAcpiParseIORTNodeHeader()

Inside of virAcpiParseIORTNodeHeader() there's an
virReportError() which reports size of a structure using sizeof()
operator. Well, it's not well documented but the returned type of
sizeof() is apparently size_t but the format string uses %lu.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2 years agovirt-host-validate: Detect SMMU presence on ARMs by parsing IORT table
Michal Privoznik [Wed, 5 Apr 2023 08:57:45 +0000 (10:57 +0200)]
virt-host-validate: Detect SMMU presence on ARMs by parsing IORT table

In my previous commit v9.2.0-rc1~3 I've made virt-host-validate
to report host IOMMU check pass if IORT table is present. This is
not sufficient though, because IORT describes much more than just
IOMMU (well, it's called SMMU in ARM world). In fact, this can be
seen in previous commit which adds test cases: there are tables
(IORT_virt_aarch64) which does not contain any SMMU records.

But after previous commits, we can parse the table so switch to
that.

Fixes: 2c13a2a7c9c368ea81eccd4ba12d9cf34bdd331b
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2178885
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agotests: Introduce viracpitest
Michal Privoznik [Tue, 4 Apr 2023 15:07:21 +0000 (17:07 +0200)]
tests: Introduce viracpitest

Introduce a test that checks newly introduced virAcpi module.
There are three IORT tables from a real HW (IORT_ampere,
IORT_gigabyte and IORT_qualcomm), then there's one from a VM
(IORT_virt_aarch64) and one that I handcrafted to be empty
(IORT_empty).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agoutil: Introduce virAcpi module
Michal Privoznik [Tue, 4 Apr 2023 13:37:01 +0000 (15:37 +0200)]
util: Introduce virAcpi module

The aim of this new module is to contain code that's parsing ACPI
tables. For now, only parsing of IORT table is implemented (it's
ARM specific table). And since we only need to check whether the
table contains SMMU record, the code is very simplified.
I've followed the specification published here:

  https://developer.arm.com/documentation/den0049/latest/

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2 years agoTranslated using Weblate (Chinese (Simplified) (zh_CN))
Yang Yulin [Thu, 6 Apr 2023 08:20:46 +0000 (10:20 +0200)]
Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 99.5% (10358 of 10400 strings)

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

Co-authored-by: Yang Yulin <yylteam@icloud.com>
Signed-off-by: Yang Yulin <yylteam@icloud.com>
2 years agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Thu, 6 Apr 2023 08:20:46 +0000 (10:20 +0200)]
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10400 of 10400 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>
2 years agoTranslated using Weblate (Korean)
김인수 [Thu, 6 Apr 2023 08:20:45 +0000 (10:20 +0200)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10400 of 10400 strings)

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

Translated using Weblate (Korean)

Currently translated at 99.8% (10384 of 10400 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2 years agoTranslated using Weblate (French)
Jérémie Tarot [Thu, 6 Apr 2023 08:20:45 +0000 (10:20 +0200)]
Translated using Weblate (French)

Currently translated at 99.9% (10399 of 10400 strings)

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

Co-authored-by: Jérémie Tarot <silopolis@gmail.com>
Signed-off-by: Jérémie Tarot <silopolis@gmail.com>
2 years agoTranslated using Weblate (Czech)
Pavel Borecki [Thu, 6 Apr 2023 08:20:44 +0000 (10:20 +0200)]
Translated using Weblate (Czech)

Currently translated at 84.9% (8830 of 10400 strings)

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

Co-authored-by: Pavel Borecki <pavel.borecki@gmail.com>
Signed-off-by: Pavel Borecki <pavel.borecki@gmail.com>
2 years agocoding style: Follow our own rule on comment style
Michal Privoznik [Tue, 4 Apr 2023 09:56:31 +0000 (11:56 +0200)]
coding style: Follow our own rule on comment style

In our coding style document we have examples of good and bad
code, which we mark as:

  // Good
  // Bad

respectively. But in the very same document we advocate for using
C style of comments over C++. Follow our own advice and switch
annotation to:

  /* Good */
  /* Bad */

And while at it, align these annotations within their blocks for
better readability.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agotests: Don't use GIO_COMPILATION
Andrea Bolognani [Thu, 30 Mar 2023 14:08:05 +0000 (16:08 +0200)]
tests: Don't use GIO_COMPILATION

This flag is intended to be used exclusively in the context of
building GLib itself and should not be passed to the compiler
by a third-party project such as libvirt.

Reverts: 77d1fa5 ("tests: Compile virgdbusmock.c with GIO_COMPILATION enabled")
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: Don't build virgdbusmock on Windows
Andrea Bolognani [Thu, 30 Mar 2023 14:07:33 +0000 (16:07 +0200)]
tests: Don't build virgdbusmock on Windows

All of the tests that use this mock (networkxml2firewalltest,
virsystemdtest, virpolkittest) are either no-ops on Windows, or
are not compiled at all on the target.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: Drop dead code
Andrea Bolognani [Thu, 30 Mar 2023 13:25:31 +0000 (15:25 +0200)]
tests: Drop dead code

Left behind by commit 35eb484 ("tests: remove firewalld
backend tests from virfirewalltest.c").

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoci: Regenerate files
Andrea Bolognani [Thu, 30 Mar 2023 09:15:18 +0000 (11:15 +0200)]
ci: Regenerate files

This unbreaks the various $CROSS-$NAME-local-env jobs.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agoqemu_snapshot: external: don't error out when updating metadata
Pavel Hrdina [Tue, 21 Mar 2023 16:42:10 +0000 (17:42 +0100)]
qemu_snapshot: external: don't error out when updating metadata

Attaching disk into running VM the offline definition may not be
updated and we will end up with that disk existing only in live
definition. Creating snapshot with this state saves both live and
offline definition into snapshot metadata.

When we are deleting an external snapshot we are updating these
definitions in the snapshot metadata so we should just skip over
non-existing disks instead of reporting error.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agodocs: apps: Add a new section for backup utilities and mention 'virtnbdbackup'
Michael Ablassmeier [Thu, 30 Mar 2023 11:16:55 +0000 (13:16 +0200)]
docs: apps: Add a new section for backup utilities and mention 'virtnbdbackup'

Signed-off-by: Michael Ablassmeier <abi@grinser.de>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agodomaincapstest: Skip unknown variants instead of the default variant
Peter Krempa [Mon, 3 Apr 2023 08:47:36 +0000 (10:47 +0200)]
domaincapstest: Skip unknown variants instead of the default variant

Fix the logic selecting when to run the tests to skip unknown variants
rather than the default variant.

Fixes: 738c5bae888
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2 years agotestutilsqemu: Drop fake capability testing infrastructure for 's390'
Peter Krempa [Fri, 24 Mar 2023 12:24:06 +0000 (13:24 +0100)]
testutilsqemu: Drop fake capability testing infrastructure for 's390'

Now that all tests were converted to use real capabilities we don't need
it any more. Remove it so that no new tests are added with it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2xmltest: Convert all s390 test cases to real capabilities
Peter Krempa [Fri, 24 Mar 2023 14:10:25 +0000 (15:10 +0100)]
qemuxml2xmltest: Convert all s390 test cases to real capabilities

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Convert rest of s390 tests to real caps
Peter Krempa [Fri, 24 Mar 2023 14:28:56 +0000 (15:28 +0100)]
qemuxml2argvtest: Convert rest of s390 tests to real caps

Convert the rest of the outstanding tests to use real capabilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Modernize s390 cpu tests
Peter Krempa [Fri, 24 Mar 2023 13:53:01 +0000 (14:53 +0100)]
qemuxml2argvtest: Modernize s390 cpu tests

Use real capabilities for the CPU test. The negative test case for QEMUs
without QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION is removed as the feature is
now supported by all supported qemu versions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Modernize all s390 'loadparm' tests
Peter Krempa [Fri, 24 Mar 2023 14:26:22 +0000 (15:26 +0100)]
qemuxml2argvtest: Modernize all s390 'loadparm' tests

Use latest caps for the tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Modernize all s390 'keywrap' tests
Peter Krempa [Fri, 24 Mar 2023 13:42:04 +0000 (14:42 +0100)]
qemuxml2argvtest: Modernize all s390 'keywrap' tests

Use latest caps for the tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Remove obsolete negative tests
Peter Krempa [Fri, 24 Mar 2023 12:45:41 +0000 (13:45 +0100)]
qemuxml2argvtest: Remove obsolete negative tests

The 'hostdev-subsys-mdev-vfio-ccw', 'hostdev-vfio-zpci', and
'hostdev-vfio-zpci-autogenerate-fids' test cases have negative versions
which are invoked without capabilities. This does not make sense going
forward as the tests are going to be switched to real capabilities.

Remove them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotestutilsqemu: Drop fake capability testing infrastructure for 'ppc64'
Peter Krempa [Wed, 8 Mar 2023 21:46:27 +0000 (22:46 +0100)]
testutilsqemu: Drop fake capability testing infrastructure for 'ppc64'

Now that all tests were converted to use real capabilities we don't need
it any more. Remove it so that no new tests are added with it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Use real capabilities for negative test cases for ppc64 architecture
Peter Krempa [Fri, 17 Mar 2023 14:52:06 +0000 (15:52 +0100)]
qemuxml2argvtest: Use real capabilities for negative test cases for ppc64 architecture

Convert the last outstanding test cases for ppc64 to use real
capabilities.

In couple cases this actually fixes the test case to test what it was
intending to do.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuValidateDomainDefPSeriesFeature: Simplify feature validation
Peter Krempa [Tue, 21 Mar 2023 15:15:25 +0000 (16:15 +0100)]
qemuValidateDomainDefPSeriesFeature: Simplify feature validation

Unify validation of VIR_DOMAIN_FEATURE_HTM, VIR_DOMAIN_FEATURE_NESTED_HV,
VIR_DOMAIN_FEATURE_CCF_ASSIST and remove temporary string.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuValidateDomainDefPSeriesFeature: Simplify machine validation logic
Peter Krempa [Tue, 21 Mar 2023 15:11:43 +0000 (16:11 +0100)]
qemuValidateDomainDefPSeriesFeature: Simplify machine validation logic

Return early and reformat the error message.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: capabilities: Retire obsolete 'pseries' capabilities
Peter Krempa [Tue, 21 Mar 2023 15:07:20 +0000 (16:07 +0100)]
qemu: capabilities: Retire obsolete 'pseries' capabilities

Retire:

    QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE
    QEMU_CAPS_MACHINE_PSERIES_CAP_HTM
    QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV
    QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST
    QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC
    QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC
    QEMU_CAPS_MACHINE_PSERIES_CAP_IBS

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuValidateDomainDefPSeriesFeature: Remove obsolete checks
Peter Krempa [Tue, 21 Mar 2023 15:02:33 +0000 (16:02 +0100)]
qemuValidateDomainDefPSeriesFeature: Remove obsolete checks

The features:

QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE
QEMU_CAPS_MACHINE_PSERIES_CAP_HTM
QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV
QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST
QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC
QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC
QEMU_CAPS_MACHINE_PSERIES_CAP_IBS

are supported by all qemu versions that libvirt supports. Drop the
obsolete checks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Drop negative test cases for 'pseries' machine features
Peter Krempa [Tue, 21 Mar 2023 14:56:41 +0000 (15:56 +0100)]
qemuxml2argvtest: Drop negative test cases for 'pseries' machine features

All of the tested features are always present in the 'pseries' machine
with oldest-supported qemu-4.2, thus the tests don't make sense any
more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Add '4.2.0' version of 'pseries-features' test case
Peter Krempa [Tue, 21 Mar 2023 14:49:22 +0000 (15:49 +0100)]
qemuxml2argvtest: Add '4.2.0' version of 'pseries-features' test case

Add an example case showing that every feature in the 'pseries-features'
test works also with the oldest supported qemu version.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2xmltest: Modernize all remaining 'ppc64' test cases
Peter Krempa [Thu, 9 Mar 2023 10:23:33 +0000 (11:23 +0100)]
qemuxml2xmltest: Modernize all remaining 'ppc64' test cases

Switch them to use latest caps.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Modernize all 'ppc64' remaining test cases
Peter Krempa [Wed, 8 Mar 2023 22:31:47 +0000 (23:31 +0100)]
qemuxml2argvtest: Modernize all 'ppc64' remaining test cases

Switch them to use latest caps.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuhotplugtest: Make the test more useful by validating used commands against QMP...
Peter Krempa [Thu, 9 Mar 2023 17:07:45 +0000 (18:07 +0100)]
qemuhotplugtest: Make the test more useful by validating used commands against QMP schema

qemuhotplugtest validates only that a given command is used but not the
arguments of the command. With this patch we'll validate the arguments
against the QMP schema thus we can catch possible issues with deprecated
commands.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuhotplugtest: Use real 'latest' capabilities for hotplug testing
Peter Krempa [Thu, 9 Mar 2023 15:47:32 +0000 (16:47 +0100)]
qemuhotplugtest: Use real 'latest' capabilities for hotplug testing

Rather than test with synthetic capabilities which might get outdated
reuse testQemuGetRealCaps to fetch latest capabilities and use those.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuhotplugtest: Refactor calling of testQemuHotplugCpuPrepare
Peter Krempa [Thu, 9 Mar 2023 15:11:47 +0000 (16:11 +0100)]
qemuhotplugtest: Refactor calling of testQemuHotplugCpuPrepare

Pass in the whole struct rather than splitting out individual members.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuhotplugtest: Assert QEMU_CAPS_SET_ACTION
Peter Krempa [Thu, 9 Mar 2023 15:53:25 +0000 (16:53 +0100)]
qemuhotplugtest: Assert QEMU_CAPS_SET_ACTION

With modern qemu we use 'set-action' instead of 'watchdog-set-action'.

Switch to it so that later qemuhotplugtest can be switched to use real
capabilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuhotplugtest: Enable 'lsilogic' SCSI controller
Peter Krempa [Thu, 9 Mar 2023 16:12:54 +0000 (17:12 +0100)]
qemuhotplugtest: Enable 'lsilogic' SCSI controller

All real qemus support the 'lsilogic' controller and thus would pick it
as the default rather than virtio-scsi. Since lsilogic is limited in
some aspects we should test it with the proper default model.

In the future the fake capabilities will be replaced by real
capabilities so this test would break.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuhotplugtestdomain: Move all i686 test cases to x86_64
Peter Krempa [Thu, 9 Mar 2023 16:02:47 +0000 (17:02 +0100)]
qemuhotplugtestdomain: Move all i686 test cases to x86_64

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuhotplugtest: Don't fetch capabilities when they are not used
Peter Krempa [Thu, 9 Mar 2023 14:51:08 +0000 (15:51 +0100)]
qemuhotplugtest: Don't fetch capabilities when they are not used

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemumemlocktest: Use real capabilities
Peter Krempa [Thu, 9 Mar 2023 08:21:13 +0000 (09:21 +0100)]
qemumemlocktest: Use real capabilities

Use testQemuGetRealCaps to fetch real capabilities and use it in place
of the faked caps.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotestQemuGetRealCaps: Integrate fetching of QMP schema
Peter Krempa [Thu, 9 Mar 2023 14:15:40 +0000 (15:15 +0100)]
testQemuGetRealCaps: Integrate fetching of QMP schema

Move the lookup of the corresponding QMP schema used for validation of
QMP commands from 'testCompareXMLToArgvValidateSchema' to
testQemuGetRealCaps as an optional step.

This will simplify using QMP command validation in other tests which
will use testQemuGetRealCaps.

'testutilsqemuschema' module is now linked into 'test_utils_qemu' as it
contains no monitor-specific code itself and after this patch it's
referenced directly from that module.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotestutilsqemu: Extract fetching of real virQEMUCaps into testQemuGetRealCaps
Peter Krempa [Thu, 9 Mar 2023 13:24:45 +0000 (14:24 +0100)]
testutilsqemu: Extract fetching of real virQEMUCaps into testQemuGetRealCaps

'testQemuInfoInitArgs' contains the logic to fetch and use the
capabilities for tests using 'struct testQemuInfo'.

As in certain cases use of 'struct testQemuInfo' is an overkill extract
the code to fetch the capabilities into a standalone helper.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: Remove 'vircapstest'
Peter Krempa [Thu, 9 Mar 2023 07:58:19 +0000 (08:58 +0100)]
tests: Remove 'vircapstest'

Technically for the LXC capabilities lookup we don't have another test
case, but given that it shares the implementation with qemu and thus the
only thing we are missing out on is testing of filling of the fake
capabilities which doesn't make sense testing.

Remove vircapstest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: vircaps: Remove pointless testing of virCapabilitiesHostNUMAGetCpus
Peter Krempa [Fri, 17 Mar 2023 13:52:28 +0000 (14:52 +0100)]
tests: vircaps: Remove pointless testing of virCapabilitiesHostNUMAGetCpus

The test case doesn't validate the returned map of cpus, just checks
that it didn't fail. We test the returned value indirectly via
qemuxml2argvtest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovircapstest: Remove 'qemu' testing
Peter Krempa [Wed, 8 Mar 2023 23:10:48 +0000 (00:10 +0100)]
vircapstest: Remove 'qemu' testing

We have testing based on real capabilities in 'qemucaps2xmltest' for
qemu guest related data and 'vircaps2xmltest' tests the host data
gathering. The testing done here makes no sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirCapabilitiesFreeMachines: Remove unused function
Peter Krempa [Fri, 17 Mar 2023 13:40:11 +0000 (14:40 +0100)]
virCapabilitiesFreeMachines: Remove unused function

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirQEMUCapsInitGuest: Refactor cleanup and remove return value
Peter Krempa [Fri, 17 Mar 2023 13:38:20 +0000 (14:38 +0100)]
virQEMUCapsInitGuest: Refactor cleanup and remove return value

Use automatic pointer freeing, remove 'ret' variable and also remove
return value completely.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirQEMUCapsInitGuestFromBinary: Remove return value
Peter Krempa [Fri, 17 Mar 2023 13:36:54 +0000 (14:36 +0100)]
virQEMUCapsInitGuestFromBinary: Remove return value

The function always returns 0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirQEMUCapsInitGuestFromBinary: Refactor cleanup
Peter Krempa [Fri, 17 Mar 2023 13:18:58 +0000 (14:18 +0100)]
virQEMUCapsInitGuestFromBinary: Refactor cleanup

Remove useless call to virCapabilitiesFreeMachines as the pointers were
cleared and the unneeded 'ret' variable. Since we don't need to clear
the 'machines' pointer now, remove that as well.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirQEMUCapsGetMachineTypesCaps: Remove return value
Peter Krempa [Fri, 17 Mar 2023 13:14:45 +0000 (14:14 +0100)]
virQEMUCapsGetMachineTypesCaps: Remove return value

The function always returns 0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirCapabilitiesAllocMachines: Use NULL-terminated list as argument and return count
Peter Krempa [Fri, 17 Mar 2023 13:12:11 +0000 (14:12 +0100)]
virCapabilitiesAllocMachines: Use NULL-terminated list as argument and return count

Simplify use of the function by determining the number of elements
inside the function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agolibxlCapsInitGuests: Rework insane use of ternary operators
Peter Krempa [Fri, 17 Mar 2023 12:55:54 +0000 (13:55 +0100)]
libxlCapsInitGuests: Rework insane use of ternary operators

Get rid of nested ternaries by adding a few helper variables and more
explicit if conditions to fill them appropriately.

Note that 'virCapabilitiesAllocMachines' doesn't require return value
check any more as it can't fail.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: capabilities: Drop 'kvmVersion' field
Peter Krempa [Fri, 17 Mar 2023 07:37:46 +0000 (08:37 +0100)]
qemu: capabilities: Drop 'kvmVersion' field

It's never set to any real value. Remove it along with the caching code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainHostdevDefClear: Fix and shorten comment
Peter Krempa [Thu, 30 Mar 2023 12:28:06 +0000 (14:28 +0200)]
virDomainHostdevDefClear: Fix and shorten comment

There's more stuff than device info to clear nowadays. Drop the
misleading comment. Shorten the comment saying that device info is freed
elsewhere when 'parentnet' is present.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: Unexport virDomainHostdevDefClear
Peter Krempa [Thu, 30 Mar 2023 09:59:34 +0000 (11:59 +0200)]
conf: Unexport virDomainHostdevDefClear

Move it before its first usage and make it static.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotestutilsqemu: Remove infrastructure for fake-caps testing of OSX
Peter Krempa [Wed, 8 Mar 2023 16:49:28 +0000 (17:49 +0100)]
testutilsqemu: Remove infrastructure for fake-caps testing of OSX

All tests using this were refactored to use real capabilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2xmltest: Remove infrastructure for fake-caps testing on OSX
Peter Krempa [Wed, 8 Mar 2023 16:34:25 +0000 (17:34 +0100)]
qemuxml2xmltest: Remove infrastructure for fake-caps testing on OSX

The last tests using it were refactored to use real capabilities and no
new tests should ever use it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Remove infrastructure for fake-caps testing on OSX
Peter Krempa [Wed, 8 Mar 2023 16:34:25 +0000 (17:34 +0100)]
qemuxml2argvtest: Remove infrastructure for fake-caps testing on OSX

The last tests using it were refactored to use real capabilities and no
new tests should ever use it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2(argv|xml): Convert "hvf-aarch64-virt-headless" test case to real capabilities
Peter Krempa [Wed, 8 Mar 2023 16:12:07 +0000 (17:12 +0100)]
qemuxml2(argv|xml): Convert "hvf-aarch64-virt-headless" test case to real capabilities

Rather than using fake data and faking the host use the newly introduced
support for test variants to test the OSX HVF qemu version with real
data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2(argv|xml): Convert "hvf-x86_64-q35-headless" test case to real capabilities
Peter Krempa [Wed, 8 Mar 2023 16:12:07 +0000 (17:12 +0100)]
qemuxml2(argv|xml): Convert "hvf-x86_64-q35-headless" test case to real capabilities

Rather than using fake data and faking the host use the newly introduced
support for test variants to test the OSX HVF qemu version with real
data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotestutilsqemu: Add support for specifying the variant for qemuxml2(argv|xml)test
Peter Krempa [Wed, 8 Mar 2023 16:23:05 +0000 (17:23 +0100)]
testutilsqemu: Add support for specifying the variant for qemuxml2(argv|xml)test

Add the possibility to control the variant of the test data for real
caps testing in qemuxml2argvtest and qemuxml2xmltest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemucapabilitiesdata: Add (fake) '+hvf' variant of aarch64 data
Peter Krempa [Wed, 8 Mar 2023 08:02:36 +0000 (09:02 +0100)]
qemucapabilitiesdata: Add (fake) '+hvf' variant of aarch64 data

The data is based on the generic variant of the 7.2.0 data on aarch64.

Only modification to the '.replies' file is that KVM is reported as
unavailable/unsupported.

Ideally this will be replaced by a dump captured from a real system.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemucapabilitiesdata: Add (fake) '+hvf' variant of x86_64 data
Peter Krempa [Wed, 8 Mar 2023 08:02:36 +0000 (09:02 +0100)]
qemucapabilitiesdata: Add (fake) '+hvf' variant of x86_64 data

The data is based on the generic variant of the 7.2.0 data on x86_64.

Only modification to the '.replies' file is that KVM is reported as
unavailable/unsupported.

Ideally this will be replaced by a dump captured from a real system.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemucapabilitiestest: Add support for '+hvf' variant
Peter Krempa [Wed, 8 Mar 2023 17:26:56 +0000 (18:26 +0100)]
qemucapabilitiestest: Add support for '+hvf' variant

We need to signal to the capabilities code that HVF variant is used so
that it can behave as if it were running on OSX.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: Mock virQEMUCapsProbeHVF directly in qemucapabilitiestest
Peter Krempa [Wed, 8 Mar 2023 17:16:06 +0000 (18:16 +0100)]
tests: Mock virQEMUCapsProbeHVF directly in qemucapabilitiestest

It needs to be mocked only for 'qemucapabilitiestest'. Additionally
moving it here will allow to control the return value based on the test
data which will be required for testing dumps from HVF accelerated qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirQEMUCapsProbeHVF: Factor out setting of the capability
Peter Krempa [Wed, 8 Mar 2023 17:14:03 +0000 (18:14 +0100)]
virQEMUCapsProbeHVF: Factor out setting of the capability

Separate the architecture specific code to probe the support for HVF
from the actual setting of the capability.

In upcoming patches 'virQEMUCapsProbeHVF' will be mocked in the
testsuite to provide testing for the HVF hypervisor.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: capabilities: Fix testing of 'TCG' capabilities probing
Peter Krempa [Wed, 8 Mar 2023 17:58:51 +0000 (18:58 +0100)]
qemu: capabilities: Fix testing of 'TCG' capabilities probing

The logic in 'virQEMUCapsInitQMP' invokes a second probe of qemu in case
when acceleration is used and TCG is supported to specifically probe the
CPU and features of non-accelerated guests.

The same logic must then be used in 'qemucapabilitiestest' when
replaying the data for testing otherwise the test would fail.

Export 'virQEMUCapsHaveAccel' for test usage and use the same logic
in 'testQemuCaps'.

Fix the comment in 'virQEMUCapsInitQMP' to outline what's happening.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agodomaincapstest: Add testing infrastructure for the '+hvf' variant
Peter Krempa [Wed, 8 Mar 2023 14:29:56 +0000 (15:29 +0100)]
domaincapstest: Add testing infrastructure for the '+hvf' variant

Allow testing of capabilities of OSX systems with the hvf accelerator.

'domaincapstest' requires special handling as we need to set
VIR_DOMAIN_VIRT_HVF virt type in such case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: capabilities: Add 'hvf' virt type into list of allowed types
Peter Krempa [Wed, 8 Mar 2023 14:02:06 +0000 (15:02 +0100)]
schema: capabilities: Add 'hvf' virt type into list of allowed types

The capabilities generated on OSX hosts with 'hvf' accelerator will not
pass schema testing as the 'hvf' type was not allowed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agodomaincapstest: Propagate variant name into doTestQemuInternal
Peter Krempa [Wed, 8 Mar 2023 14:27:47 +0000 (15:27 +0100)]
domaincapstest: Propagate variant name into doTestQemuInternal

Use it to format test file name as in other cases. Currently
domaincapstest will not run for any unknown variant. This patch is meant
to simplify the review of patches doing actual functional changes.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: Add support for multiple variants of data for the same qemu version+architecture
Peter Krempa [Wed, 8 Mar 2023 13:49:56 +0000 (14:49 +0100)]
tests: Add support for multiple variants of data for the same qemu version+architecture

'qemucapabilitiestest' and other users of the capability data can
benefit from adding a discriminator string to have multiple instances
for the same version+architecture tuple.

This will in the future allow us to have specific capability versions
for test cases which require a specific host feature or are based on a
different operating system.

Add the basic skeleton for parsing the variant string and passing it
around into test cases.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: qemucapabilitiesdata: Add README file
Peter Krempa [Thu, 16 Mar 2023 13:41:11 +0000 (14:41 +0100)]
tests: qemucapabilitiesdata: Add README file

Explain what the purpose of these files is as well as how they are
named, captured, used and modified.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotestQemuGetLatestCapsForArch: Rewrite using testQemuGetLatestCaps
Peter Krempa [Tue, 7 Mar 2023 15:01:35 +0000 (16:01 +0100)]
testQemuGetLatestCapsForArch: Rewrite using testQemuGetLatestCaps

Fetch the full hash of 'latest' files and just return the correct one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotestQemuGetLatestCaps: Process capabilities for all architectures in one pass
Peter Krempa [Tue, 7 Mar 2023 13:44:34 +0000 (14:44 +0100)]
testQemuGetLatestCaps: Process capabilities for all architectures in one pass

Rather than finding the newest caps file iteratively for specific
architectures in multiple passes over the directory we can simply load
the latest for everything in one pass by storing the version in the hash
table and filling it progressively.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemucapabilitiesdata: Separate version from architecture with a '_'
Peter Krempa [Tue, 7 Mar 2023 14:07:27 +0000 (15:07 +0100)]
qemucapabilitiesdata: Separate version from architecture with a '_'

Parsing a version where components are separated by dots, while other
components are also separated by dots is a bit insane. Separate the
version by an underscore.

To achieve this we rename all the caps files and adjust the appropriate
places formatting the path.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agodomaincapstest: Restructure code to avoid disabling of warnings
Peter Krempa [Wed, 8 Mar 2023 12:29:00 +0000 (13:29 +0100)]
domaincapstest: Restructure code to avoid disabling of warnings

Construct the capsName/emulator strings as initialization of variable
definition and move definition of 'struct testData' above the code.

This means that 'name' field will be initialized later.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agodomaincapstest: Make construction of filename more extensible
Peter Krempa [Wed, 8 Mar 2023 12:18:57 +0000 (13:18 +0100)]
domaincapstest: Make construction of filename more extensible

Rather than trying to cram everything into one printf statement format
the type with prefix and machine with prefix separately and then
concatenate everything into the filename.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemumigrationcookiexmltest: Don't fetch latest caps files without using them
Peter Krempa [Tue, 7 Mar 2023 13:44:23 +0000 (14:44 +0100)]
qemumigrationcookiexmltest: Don't fetch latest caps files without using them

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