Commit Graph

46653 Commits

Author SHA1 Message Date
Peter Krempa
b27549e631 qemu: capabilities: Retire QEMU_CAPS_BLOCKDEV_DEL
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 15:07:14 +02:00
Peter Krempa
e06c1fa7ee qemu: migration: Assume support for QEMU_CAPS_BLOCKDEV_DEL
The migration code was using few blockdev bits before blockdev was
fully integrated to allow TLS with NBD.

Since we now always use blockdev we can remove the check.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 15:07:05 +02:00
Peter Krempa
9f15b8fb18 qemuMigrationSrcNBDStorageCopyBlockdev: Remove some arguments
We no longer need the arguments which were conditionally filled based on
presence of the QEMU_CAPS_BLOCKDEV feature.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 15:06:55 +02:00
Peter Krempa
6111b23522 qemu: migration: Remove pre-blockdev code paths
Assume that QEMU_CAPS_BLOCKDEV is present and remove all code executed
when it's not.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 15:06:36 +02:00
Peter Krempa
b74d17279d qemu: block: Remove legacy spellings for InetSocketAddress
In one of early iterations of the gluster driver 'tcp' was used instead
of 'inet' and 'socket' instead of 'path' for unix sockets. All of this
can be now removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:32 +02:00
Peter Krempa
b45f63ecd9 qemu: capabilities: Retire QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
dc8dbb27d4 qemu: Remove code conditional on QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI
Now that QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI is always set we can remove the
code which handled cases when the capability was not set.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
ebfa1fb0f9 qemu: capabilities: Retire capabilities used for -blockdev detection
Retire:
    QEMU_CAPS_BLOCK_FILE_AUTO_READONLY_DYNAMIC
    QEMU_CAPS_SCSI_DISK_DEVICE_ID
    QEMU_CAPS_SAVEVM_MONITOR_NODES

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
b51512f915 qemu: command: Always assume support for QEMU_CAPS_SCSI_DISK_DEVICE_ID
The 'device_id' property of 'scsi_disk' was added in qemu-4.0 and it's
unconditionally present, thus we can now always assume its presence.

Update some fake-caps test which didn't yet assert the capability.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
31556cf167 qemu: Refactor access to 'qomName' field of the qemu disk private data
The code which fills 'qomName' does so only when the blockdev capability
is enabled so we don't have to check it separately as it can be only
non-NULL when blockdev is used.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
5998381b08 tests: Force QEMU_CAPS_BLOCKDEV(_HOSTDEV_SCSI) in fake caps tests
Until we finish removing the capabilities we need to force them in the
tests so that it's obvious that the code changes have no impact.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
9b54efb7cf qemu: capabilities: Unconditionally set QEMU_CAPS_BLOCKDEV/QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI
The cleanup of the code to always assume support for QEMU_CAPS_BLOCKDEV
will not be simple, so for now we hardcode the support and the code will
be cleaned up gradually.

We also disallow users to clear the flags via the namespace property or
qemu.conf configuration.

The change to the PPC64 test data originates from the fact that the
capability dump is not from the release version but is lacking one of
the necessary flags to enable -blockdev.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
78ad796a43 qemu: capabilities: Retire QEMU_CAPS_QCOW2_LUKS
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
b17e669c84 qemu: Always assume support for QEMU_CAPS_QCOW2_LUKS
luks-encrypted QCOW2 files were introduced in qemu-2.6 unconditionally.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
8eae01ba28 qemuxml2xmltest: Modernize all test cases using QEMU_CAPS_QCOW2_LUKS
Modernize 'disk-nvme', 'encrypted-disk-usage', 'encrypted-disk', and
'user-aliases' cases to use DO_TEST_CAPS_LATEST.

This will remove all uses of QEMU_CAPS_QCOW2_LUKS from the test suite.

Since the output files are done via symlinks to input files, the input
files need to be modernized with few auto-added XML bits.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
cd2d9808db qemuxml2argvtest: Use DO_TEST_CAPS_LATEST for all 'user-aliases' tests
Modernize the tests as they mostly care that the aliases are properly
propagated to qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
f80829dece qemu: capabilities: Retire QEMU_CAPS_DRIVE_DISCARD and QEMU_CAPS_DRIVE_DETECT_ZEROES
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
9a7609a5da qemu: Always assume support for QEMU_CAPS_DRIVE_DISCARD and QEMU_CAPS_DRIVE_DETECT_ZEROES
Discard and zero-detection for disk sources is supported since qemu-2.1
so we can always assume it's supported.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
c250c5a3db qemu: capabilities: Retire QEMU_CAPS_GLUSTER_DEBUG_LEVEL
The debug level of gluster backend became configurable in qemu-2.8.

This also removes the only old-style syntax for the 'blockdev-add'
command prior to stabilization.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
73011dd0ab qemu: Always assume support for QEMU_CAPS_GLUSTER_DEBUG_LEVEL
The 'debug' level for the gluster driver was added in qemu-2.8
unconditionally so libvirt can always assume it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
fc0aa62377 qemu: capabilities: Retire QEMU_CAPS_ACTIVE_COMMIT
Active block commit is supported since qemu-2.0

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
7ae3ddf4a6 qemu: Always assume support for QEMU_CAPS_ACTIVE_COMMIT
Active layer block commit is unconditionally supported since qemu-2.0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
3d367a2c93 qemu: capabilities: Retire QEMU_CAPS_CHANGE_BACKING_FILE
The 'change-backing-file' command is unconditionally supported since
qemu-2.1.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
e6f50bab56 qemu: Allways assume QEMU_CAPS_CHANGE_BACKING_FILE
The 'change-backing-file' command was added in qemu-2.1 and doesn't have
any dependencies. We use it as witness for using blockjobs with relative
backing paths. Always assume it's supported.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
d1e0eaabb1 qemu: capabilities: Retire QEMU_CAPS_AUDIODEV
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
95215e6b79 qemuxml2(argv|xml)test: Remove use of QEMU_CAPS_AUDIODEV in fake-caps tests
The code no longer uses the capability so the tests don't need to assert
it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
3d4e7d17a0 qemu: validate: Remove unreachable checks for QEMU_CAPS_AUDIODEV
We now only support qemu versions which already have the capability so
we can remove this now unused code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
d348a4c8b6 qemu: command: Drop qemuBuildAudioCommandLine thin wrapper
Rename qemuBuildAudioCommandLineArgs to qemuBuildAudioCommandLine and
fix the arguments.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
fb9eece471 qemu: command: Drop the code for configuring audio devices via environment variables
Remove the old now unused code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
31ee59d4e1 qemu: command: Always assume QEMU_CAPS_AUDIODEV
Generate only new version of the '-audiodev' commandline. The leftover
old code and validation will be removed in subsequent patches.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
0da0304818 qemu: Formally deprecate support for qemu < 4.2
Per [1] the Debian 10 reaches EOL in August of 2022. This allows us to
bump the minimum supported qemu version to qemu-4.2 which will also
allow us to do significant cleanups.

This commit bumps the minimum qemu verison and updates the corresponding
docs.

[1]: https://wiki.debian.org/DebianReleases

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
c7ab87b8a6 domaincapstest: Remove test data for qemu-4.1
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
ff4e0b775b qemucapabilitiestest: Remove test data for qemu-4.1
qemu-4.1 will not be supported any more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
1228fc69b1 domaincapstest: Remove test data for qemu-4.0
qemu-4.0 will no longer be supported.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
3397826a68 qemucapabilitiestest: Remove test data for qemu-4.0
qemu-4.0 will no longer be supported, remove the test data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
91c7835cf9 tests: domaincaps: Remove test data for qemu-3.1
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
79cb01304f tests: qemucapabilities: Remove qemu-3.1 test data
Upcoming patches will raise the minimum required qemu version to 4.2.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
b1973b883c qemuxml2argvtest: Remove 'qemu-4.0' versions of 'cpu-host-model-cmt' and 'cpu-tsc-frequency'
Minimum qemu version is going to be bumped to qemu-4.2. Upgrading the
version of these tests doesn't make sense as the host cpu in the real
capabilities doesn't support the features the tests are attempting to
test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
081230fcdb qemuxml2argvtest: Remove 'qemu-4.0' version of aarch64-features-sve case
Minimum qemu will be bumped to 4.2 so this test no longer makes sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
a0ce9317fc qemuxml2argvtest: Remove pre-qemu-4.2 versions of 'cpu-host-model' test
Minimum qemu will be bumped to 4.2 so remove the older test cases.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
9248434536 qemuxml2argvtest: Remove 'qemu-3.1' versions of virtio-(non-)transitional tests
Starting from qemu-4.0 a new device model name is used instead of the
'disable_*' props. Since we are going to bump to qemu-4.2 as minimum
this test can be removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
6a9b336be1 qemuxml2argvtest: Drop 'qemu-4.1' variants of all audio tests
Minimum qemu version will be bumped to qemu-4.2 so we no longer need to
care about configuring audiodevs via the environment variables.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
5838bd98a4 tests: qemuxml2argv: Remove pre-blockdev versions of disk-related tests
Upcoming patches will bump minimum supported qemu version to 4.2 which
will use '-blockdev' with qemu so we can drop all the old test cases for
pre-blockdev configs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
88dbfabd4e qemuxml2(argv|xml)test: Remove 'qemu-4.1' variant of 'x86-kvm-32-on-64'
Upcoming patches will bump minimum qemu version to 4.2. In this case we
the 'latest' case is sufficient as with qemu-4.2 we already behave as
upstream ('qemu64' cpu is used instead of 'qemu32').

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
2700787d0a ci: Drop Debian 10
Debian 10 reaches EOL in August of 2022.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:31 +02:00
Peter Krempa
41c92a1325 ci: Move active Debian-10 jobs to Debian-11
Debian 10 will reach EOL in august of 2022 and thus libvirt will no
longer target it. Move CI jobs over to Debian-11.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:38:30 +02:00
Peter Krempa
b76c58081c qemuMigrationSrcWaitForSpice: Remove return value
The only caller doesn't check the return value and actually doesn't have
one either. Remove the return value and adjust return statements.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:34:54 +02:00
Peter Krempa
4d1a1fdffd qemuDomainObjWait: Report error when VM is being destroyed
Since we started handling the monitor EOF event inside a job any code
which uses virDomainObjWait would no longer properly abort in case when
the VM crashed during the wait.

This is because virDomainObjWait uses virDomainObjIsActive which checks
'vm->def->id' to see if the VM is still active. Unfortunately the domain
id is cleared in qemuProcessStop which is run only inside the job.

To fix this we can use the 'beingDestroyed' flag stored in the VM
private data which is set to true around the time when the condition is
signalled.

Reported-by: Pavel Hrdina <phrdina@redhat.com>
Fixes: 8c9ff9960b
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-08-11 14:34:25 +02:00
Andrea Bolognani
24fb0270c6 ci: Fix paths shown in the website
Right now we're setting the prefix to a custom path, which
results in paths like

  /builds/libvirt/libvirt/vroot/etc/libvirt/virtqemud.conf

ending up in the generated HTML. In order to avoid that,
set the prefix and other installation paths to reasonable
default values by passing

  -Dsystem=true

and then take advantage of $DESTDIR support to still be able
to write the HTML files without requiring root privileges.

Reported-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-08-11 14:02:00 +02:00
Andrea Bolognani
03ba5f68b8 scripts: Add $DESTDIR support to meson-install-web.py
meson already supports $DESTDIR natively, but in this case
we're using a custom script and so we have to do some extra
work ourselves.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-08-11 14:01:55 +02:00