]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: add ability to set TLS priority string with QEMU
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 16 Jul 2025 15:40:01 +0000 (16:40 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 22 Jul 2025 10:06:50 +0000 (11:06 +0100)
commit14e41ac9f365b148e69088c5ffeb565a0f9ba326
treedae27d86f5fec6325f6ea3cbfd6c85355bf97e9c
parent0b9cfa791f2bd135ea36fe03fd1a8d6c8bf5e3d6
qemu: add ability to set TLS priority string with QEMU

QEMU will either use the GNUTLS default priority string of "NORMAL",
or on Fedora/RHEL related distros, "@QEMU,SYSTEM", which resolves to
a configuration in /etc/crypto-policies/back-ends/gnutls.config.

The latter gives the sysadmin the ability to change the priority
string used for GNUTLS at deployment time, either system side, or
exclusively for QEMU, avoiding the hardcoded GNUTLS defaults.

There are still some limitations to this:

 * Priorities cannot be set for different areas of QEMU
   functionality (migration, vnc, nbd, etc)

 * Priorities are fixed at the time when QEMU first
   triggers GNUTLS to load its config file, often
   immediately at startup.

We recently uncovered a QEMU bug that causes crashes in live
migration with TLS-1.3, where the easiest workaround is to
change the TLS priorities. We can't change this on the running
QEMU, but fortunately it is possible to change it on the target
QEMU and the TLS handshake will make it take effect on both
src and dst.

The problem is, while fixing the immediate incoming and outgoing
live migration problems, the workaround will apply to everything
else that QEMU does for the rest of the time that process exists.

We want to make it possible to set the TLS priorities only for
the current migrations, such that if the target QEMU has a fixed
GNUTLS, it will not have its TLS priorities hobbled for the next
live migration.

To achieve this we need libvirt to be able to (optionally) set
the TLS priority string with QEMU. While live migration is the
most pressing need, the new qemu.conf parameters are wired up
for every subsystem for greater selectivity in future.

With this we can activate the GNUTLS workaround for running
QEMU processes by editting qemu.conf and restarting virtqemud,
and later undo this the same way.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
20 files changed:
src/conf/storage_source_conf.c
src/conf/storage_source_conf.h
src/qemu/libvirtd_qemu.aug
src/qemu/qemu.conf.in
src/qemu/qemu_backup.c
src/qemu/qemu_blockjob.c
src/qemu/qemu_command.c
src/qemu/qemu_command.h
src/qemu/qemu_conf.c
src/qemu/qemu_conf.h
src/qemu/qemu_domain.c
src/qemu/qemu_domain.h
src/qemu/qemu_hotplug.c
src/qemu/qemu_hotplug.h
src/qemu/qemu_migration_params.c
src/qemu/test_libvirtd_qemu.aug.in
tests/qemuxmlconfdata/disk-network-tlsx509-nbd-hostname.x86_64-latest.args
tests/qemuxmlconfdata/graphics-vnc-tls-secret.x86_64-latest.args
tests/qemuxmlconfdata/serial-tcp-tlsx509-secret-chardev.x86_64-latest.args
tests/qemuxmlconftest.c