]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
2 years agoconf: Restrict use of <portForward> to the passt backend
Andrea Bolognani [Tue, 18 Apr 2023 09:08:03 +0000 (11:08 +0200)]
conf: Restrict use of <portForward> to the passt backend

That's already the case in practice, but it's a better
experience for the user if we reject this configuration
outright instead of silently ignoring part of it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: viracpitest only works on little endian
Boris Fiuczynski [Tue, 18 Apr 2023 09:53:08 +0000 (11:53 +0200)]
tests: viracpitest only works on little endian

Commit fc216db4fb789cbd309 introduced a mocked test with binary test data
which fails on big endian machines.
Therefore build the viracpitest test only on little endian machines.

Fixes: fc216db4fb789cbd30917be036d0b94d965bdf7f
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agovirsh: Introduce --xpath and --wrap to domcapabilities
Michal Privoznik [Fri, 14 Apr 2023 14:06:02 +0000 (16:06 +0200)]
virsh: Introduce --xpath and --wrap to domcapabilities

Similarly to dumpxml, let's have --xpath and --wrap to the
'domcapabilities' command since users might be interested only in
a subset of domcapabilities XML.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
2 years agovirsh: Introduce --xpath and --wrap to capabilities
Michal Privoznik [Fri, 14 Apr 2023 14:01:56 +0000 (16:01 +0200)]
virsh: Introduce --xpath and --wrap to capabilities

Similarly to dumpxml, let's have --xpath and --wrap to the
'capabilities' command since users might be interested only in a
subset of capabilities XML.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
2 years agodocs: formatdomain: Properly indent example XML for setting 'metadata_cache'
Peter Krempa [Tue, 28 Feb 2023 13:46:20 +0000 (14:46 +0100)]
docs: formatdomain: Properly indent example XML for setting 'metadata_cache'

Indent the example XML block so that it belongs to the paragraph talking
about it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agokbase: debuglogs: Add a 'TL;DR' section for enabling logging in most common case
Peter Krempa [Mon, 17 Apr 2023 11:31:25 +0000 (13:31 +0200)]
kbase: debuglogs: Add a 'TL;DR' section for enabling logging in most common case

The document grew a bit too much explaining all the mistakes we've seen
the users do when configuring logging. Add a section distilling the
configuration of the most basic scenario which we can refer to when
upstream issues are reported. The scenario is for a runtime setting of
logging into a file applied to the 'virtqemud' daemon.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoMove src/keycodemapdb -> subprojects/keycodemapdb
Marc-André Lureau [Mon, 17 Apr 2023 11:54:01 +0000 (15:54 +0400)]
Move src/keycodemapdb -> subprojects/keycodemapdb

Follow better meson build system conventions. This allows to find
keymap-gen or CSV without explicitly setting the paths.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agorpc/ssh: ssh_userauth_agent() is not supported on win32
Marc-André Lureau [Mon, 17 Apr 2023 11:54:00 +0000 (15:54 +0400)]
rpc/ssh: ssh_userauth_agent() is not supported on win32

The function does not exist on win32.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agomeson: drop explicit python interpreter
Marc-André Lureau [Mon, 17 Apr 2023 11:53:59 +0000 (15:53 +0400)]
meson: drop explicit python interpreter

meson wraps python scripts already on win32, so we end up with these
failing commands:

[1/359] "C:/msys64/ucrt64/bin/meson" "--internal" "exe" "--capture" "src/util/virkeycodetable_atset1.h" "--" "sh" "C:/msys64/home/marca/src/libvirt/scripts/meson-python.sh" "C:/msys64/ucrt64/bin/python3.EXE" "python" "C:/msys64/home/marca/src/libvirt/src/keycodemapdb/tools/keymap-gen" "code-table" "--lang" "stdc" "--varname" "virKeyCodeTable_atset1" "C:/msys64/home/marca/src/libvirt/src/keycodemapdb/data/keymaps.csv" "atset1"
FAILED: src/util/virkeycodetable_atset1.h
"C:/msys64/ucrt64/bin/meson" "--internal" "exe" "--capture" "src/util/virkeycodetable_atset1.h" "--" "sh" "C:/msys64/home/marca/src/libvirt/scripts/meson-python.sh" "C:/msys64/ucrt64/bin/python3.EXE" "python" "C:/msys64/home/marca/src/libvirt/src/keycodemapdb/tools/keymap-gen" "code-table" "--lang" "stdc" "--varname" "virKeyCodeTable_atset1" "C:/msys64/home/marca/src/libvirt/src/keycodemapdb/data/keymaps.csv" "atset1"

If LC_ALL, LANG and LC_CTYPE need to be set, it would probably be better
to use a meson environment() instead.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agomeson: don't hard code find_program() location
Marc-André Lureau [Mon, 17 Apr 2023 11:53:58 +0000 (15:53 +0400)]
meson: don't hard code find_program() location

Use 'dirs' argument to locate the program.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agokeycodemapdb: update submodule for build fixes
Marc-André Lureau [Mon, 17 Apr 2023 11:53:57 +0000 (15:53 +0400)]
keycodemapdb: update submodule for build fixes

A number of changes, but notably python script shebang fixing build
issues in CI:

Daniel P. Berrangé (1):
      Revert "Add local argparse for compat with python 2.6"

Dawid Dziurla (1):
      Don't hardcode python3 path in shebang

Eli Schwartz (1):
      make the meson.build stub a bit more well-rounded by exporting files

Pierre Ossman (1):
      Fix macOS "ISO" key

Ross Lagerwall (2):
      Use python3 binary rather than unversioned python
      Fix Hangeul/Hanja scancodes

William (1):
      Add Qemu qcode support for F13 to F24

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agomeson: don't look for unix paths on win32
Marc-André Lureau [Mon, 17 Apr 2023 11:53:56 +0000 (15:53 +0400)]
meson: don't look for unix paths on win32

Or meson will complain with:
../meson.build:770:2: ERROR: Search directory /sbin is not an absolute path.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agovirsh-domain-event: Make 'virshEventIOError(Reason)Print' translation friendly
Peter Krempa [Thu, 13 Apr 2023 06:39:22 +0000 (08:39 +0200)]
virsh-domain-event: Make 'virshEventIOError(Reason)Print' translation friendly

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agovirsh-domain-event: Make 'virshEventWatchdogPrint' translation friendly
Peter Krempa [Thu, 13 Apr 2023 06:39:22 +0000 (08:39 +0200)]
virsh-domain-event: Make 'virshEventWatchdogPrint' translation friendly

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agovirsh-domain-event: Make 'virshEventTrayChangePrint' translation friendly
Peter Krempa [Thu, 13 Apr 2023 06:39:22 +0000 (08:39 +0200)]
virsh-domain-event: Make 'virshEventTrayChangePrint' translation friendly

Remove construction of the event string from sub-strings marked as
translatable. Without context it's impossible to translate it correctly.

This slightly increases verbosity of the code but actually makes it more
readable as everything is inline.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agovirsh: event: Introduce virshEventPrintf
Peter Krempa [Thu, 13 Apr 2023 07:31:34 +0000 (09:31 +0200)]
virsh: event: Introduce virshEventPrintf

Extract internals of virshEventPrint into a function that can take the
format string. The function will be used in upcoming patches which make
the event formatting translatable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agovshPrint: Add version using 'va_list'
Peter Krempa [Thu, 13 Apr 2023 07:19:27 +0000 (09:19 +0200)]
vshPrint: Add version using 'va_list'

Add a version for functions which may already need to take a printf
format string.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agovirshGraphicsAddressToString: Remove pointless translation
Peter Krempa [Thu, 13 Apr 2023 07:44:05 +0000 (09:44 +0200)]
virshGraphicsAddressToString: Remove pointless translation

There's no point in marking the protocol name as translatable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoDon't translate strings used with VIR_DEBUG
Peter Krempa [Thu, 13 Apr 2023 06:30:21 +0000 (08:30 +0200)]
Don't translate strings used with VIR_DEBUG

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirCgroupV1GetBlkioIo(Device)Serviced: Refactor extraction of cgroup data
Peter Krempa [Wed, 12 Apr 2023 12:46:04 +0000 (14:46 +0200)]
virCgroupV1GetBlkioIo(Device)Serviced: Refactor extraction of cgroup data

Rewrite the code to improve maintainability and also re-do construction
of error messages which are assembled from non-translatable parts.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/455
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu: Fix incorrect command name in error messages
Andrea Bolognani [Fri, 14 Apr 2023 08:37:10 +0000 (10:37 +0200)]
qemu: Fix incorrect command name in error messages

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2 years agosecurity: do not remember/recall labels for VFIO MDEVs
Eric Farman [Sat, 1 Apr 2023 00:42:04 +0000 (02:42 +0200)]
security: do not remember/recall labels for VFIO MDEVs

Commit dbf1f68410 ("security: do not remember/recall labels for VFIO")
rightly changed the DAC and SELinux labeling parameters to fix a problem
with "VFIO hostdevs" but really only addressed the PCI codepaths.
As a result, we can still encounter this with VFIO MDEVs such as
vfio-ccw and vfio-ap, which can fail on a hotplug:

  [test@host ~]# mdevctl stop -u 11f2d2bc-4083-431d-a023-eff72715c4f0
  [test@host ~]# mdevctl start -u 11f2d2bc-4083-431d-a023-eff72715c4f0
  [test@host ~]# cat disk.xml
    <hostdev mode='subsystem' type='mdev' model='vfio-ccw'>
      <source>
        <address uuid='11f2d2bc-4083-431d-a023-eff72715c4f0'/>
      </source>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x3c51'/>
    </hostdev>
  [test@host ~]# virsh attach-device guest ~/disk.xml
  error: Failed to attach device from /home/test/disk.xml
  error: Requested operation is not valid: Setting different SELinux label on /dev/vfio/3 which is already in use

Make the same changes as reported in commit dbf1f68410, for the mdev paths.

Reported-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: Introduce igb model for <interface>
Akihiko Odaki [Mon, 10 Apr 2023 05:48:07 +0000 (14:48 +0900)]
conf: Introduce igb model for <interface>

igb is a new network device which will be introduced with QEMU 8.0.0.
It is a successor of e1000e so it has PCIe interface and is understands
virtio-net headers as e1000e does.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu: Fix potential crash during driver cleanup
Jim Fehlig [Tue, 11 Apr 2023 15:15:43 +0000 (09:15 -0600)]
qemu: Fix potential crash during driver cleanup

During qemu driver shutdown, objects are freed in qemuStateCleanup that
could still be used by active worker threads, resulting in crashes. E.g.
a worker thread could be processing a monitor EOF event after the
security manager is already disposed

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fd9a9a1e1fe in virSecurityManagerMoveImageMetadata (mgr=0x7fd948012160, pid=-1, src=src@entry=0x7fd98c072c90, dst=dst@entry=0x0)
    at ../../src/security/security_manager.c:468
#1  0x00007fd9646ff0f0 in qemuSecurityMoveImageMetadata (driver=driver@entry=0x7fd948043830, vm=vm@entry=0x7fd98c066db0, src=src@entry=0x7fd98c072c90,
    dst=dst@entry=0x0) at ../../src/qemu/qemu_security.c:182
#2  0x00007fd96462c7b0 in qemuBlockRemoveImageMetadata (driver=driver@entry=0x7fd948043830, vm=vm@entry=0x7fd98c066db0, diskTarget=0x7fd98c072530 "vda",
    src=<optimized out>) at ../../src/qemu/qemu_block.c:2628
#3  0x00007fd9646929d6 in qemuProcessStop (driver=driver@entry=0x7fd948043830, vm=vm@entry=0x7fd98c066db0, reason=reason@entry=VIR_DOMAIN_SHUTOFF_SHUTDOWN,
    asyncJob=asyncJob@entry=QEMU_ASYNC_JOB_NONE, flags=<optimized out>) at ../../src/qemu/qemu_process.c:7585
#4  0x00007fd9646fc842 in processMonitorEOFEvent (vm=0x7fd98c066db0, driver=0x7fd948043830) at ../../src/qemu/qemu_driver.c:4794
#5  qemuProcessEventHandler (data=0x561a93febb60, opaque=0x7fd948043830) at ../../src/qemu/qemu_driver.c:4900
#6  0x00007fd9a9971a31 in virThreadPoolWorker (opaque=opaque@entry=0x561a93fb58e0) at ../../src/util/virthreadpool.c:163
(gdb) p mgr->drv
$2 = (virSecurityDriverPtr) 0x0

Prior to commit 7cf76d4e3ab, the worker thread pool was freed before
disposing any driver objects. Let's return to that pattern, but leave
the other changes made by 7cf76d4e3ab.

Signed-off-by: Tamara Schmitz <tamara.schmitz@suse.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoconf: Fix migration in some firmware autoselection scenarios
Andrea Bolognani [Tue, 11 Apr 2023 15:56:45 +0000 (17:56 +0200)]
conf: Fix migration in some firmware autoselection scenarios

Introduce a small kludge in the parser to avoid unnecessarily
blocking incoming migration from a range of recent libvirt
releases.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: Tweak input file
Andrea Bolognani [Tue, 11 Apr 2023 16:06:20 +0000 (18:06 +0200)]
tests: Tweak input file

The canonical order for <os> child elements is <firmware>
then <loader>.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: Move validation of virDomainGraphicsListenDef out of parser
K Shiva Kiran [Thu, 6 Apr 2023 16:23:32 +0000 (21:53 +0530)]
conf: Move validation of virDomainGraphicsListenDef out of parser

In an effort to separate the validation steps from the Parse stage,
a few validation checks of virDomainGraphicsListenDef have been moved from
virDomainGraphicsListenDefParseXML() in domain_conf.c to
virDomainGraphicsDefListensValidate() in domain_validate.c

Signed-off-by: K Shiva <shiva_kr@riseup.net>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoTranslated using Weblate (Czech)
Pavel Borecki [Tue, 11 Apr 2023 20:20:51 +0000 (22:20 +0200)]
Translated using Weblate (Czech)

Currently translated at 86.1% (8958 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 agoqemu: snapshot: Allow inactive internal snapshots with uefi
Peter Krempa [Thu, 6 Apr 2023 13:23:46 +0000 (15:23 +0200)]
qemu: snapshot: Allow inactive internal snapshots with uefi

Historically the snapshot code attempted to forbid internal snapshots
with UEFI both in active and inactive case. Unfortunately due to the
intricacies of UEFI probing this didn't really work for inactive VMs
which made users rely on the feature.

Now with the changes to store detected UEFI environment also in the
inactive definition this broke the feature for those users.

Since the varstore doesn't really change that much in the lifecycle of a
VM it usually is okay to simply leave it as is.

Restore the functionality for inactive snapshots by disabling the check.

In the future when uefi snapshotting will be added the rest of the
condition will also be removed.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/460
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 'aarch64'
Peter Krempa [Fri, 24 Mar 2023 09:25:05 +0000 (10:25 +0100)]
testutilsqemu: Drop fake capability testing infrastructure for 'aarch64'

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 rest of 'aarch64' cases to real capabilities
Peter Krempa [Fri, 24 Mar 2023 15:48:38 +0000 (16:48 +0100)]
qemuxml2xmltest: Convert rest of 'aarch64' cases to real capabilities

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

Use real capabilities.

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