From 8b1cc39acd8ddc2534b691c8e174ae4dbd924784 Mon Sep 17 00:00:00 2001 From: Miroslav Rezanina Date: Fri, 13 Dec 2024 03:22:12 -0500 Subject: [PATCH] * Fri Dec 13 2024 Miroslav Rezanina - 9.1.0-8 - kvm-migration-Allow-pipes-to-keep-working-for-fd-migrati.patch [RHEL-69047] - Resolves: RHEL-69047 (warning: fd: migration to a file is deprecated when create or revert a snapshot) --- ...pipes-to-keep-working-for-fd-migrati.patch | 116 ++++++++++++++++++ qemu-kvm.spec | 9 +- 2 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 kvm-migration-Allow-pipes-to-keep-working-for-fd-migrati.patch diff --git a/kvm-migration-Allow-pipes-to-keep-working-for-fd-migrati.patch b/kvm-migration-Allow-pipes-to-keep-working-for-fd-migrati.patch new file mode 100644 index 0000000..145d080 --- /dev/null +++ b/kvm-migration-Allow-pipes-to-keep-working-for-fd-migrati.patch @@ -0,0 +1,116 @@ +From 3f4762ae8fd1fb148b97cd713209d3b55e8ea489 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Wed, 20 Nov 2024 11:01:32 -0500 +Subject: [PATCH] migration: Allow pipes to keep working for fd migrations +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 302: migration: Allow pipes to keep working for fd migrations +RH-Jira: RHEL-69047 +RH-Acked-by: Juraj Marcin +RH-Acked-by: Miroslav Rezanina +RH-Commit: [1/1] f5c0af772cbd3ced12a7b260f86f98e74d8345d1 (peterx/qemu-kvm) + +Libvirt may still use pipes for old file migrations in fd: URI form, +especially when loading old images dumped from Libvirt's compression +algorithms. + +In that case, Libvirt needs to compress / uncompress the images on its own +over the migration binary stream, and pipes are passed over to QEMU for +outgoing / incoming migrations in "fd:" URIs. + +For future such use case, it should be suggested to use mapped-ram when +saving such VM image. However there can still be old images that was +compressed in such way, so libvirt needs to be able to load those images, +uncompress them and use the same pipe mechanism to pass that over to QEMU. + +It means, even if new file migrations can be gradually moved over to +mapped-ram (after Libvirt start supporting it), Libvirt still needs the +uncompressor for the old images to be able to load like before. + +Meanwhile since Libvirt currently exposes the compression capability to +guest images, it may needs its own lifecycle management to move that over +to mapped-ram, maybe can be done after mapped-ram saved the image, however +Dan and PeterK raised concern on temporary double disk space consumption. +I suppose for now the easiest is to enable pipes for both sides of "fd:" +migrations, until all things figured out from Libvirt side on how to move +on. + +And for "channels" QMP interface support on "migrate" / "migrate-incoming" +commands, we'll also need to move away from pipe. But let's leave that for +later too. + +So far, still allow pipes to happen like before on both save/load sides, +just like we would allow sockets to pass. + +Cc: qemu-stable +Cc: Fabiano Rosas +Cc: Peter Krempa +Cc: Daniel P. Berrangé +Fixes: c55deb860c ("migration: Deprecate fd: for file migration") +Reviewed-by: Fabiano Rosas +Link: https://lore.kernel.org/r/20241120160132.3659735-1-peterx@redhat.com +Signed-off-by: Peter Xu +(cherry picked from commit 87ae45e602e2943d58509e470e3a1d4ba084ab2f) +Signed-off-by: Peter Xu +--- + migration/fd.c | 27 +++++++++++++++++++++++++-- + 1 file changed, 25 insertions(+), 2 deletions(-) + +diff --git a/migration/fd.c b/migration/fd.c +index aab5189eac..9bf9be6acb 100644 +--- a/migration/fd.c ++++ b/migration/fd.c +@@ -25,6 +25,29 @@ + #include "io/channel-util.h" + #include "trace.h" + ++static bool fd_is_pipe(int fd) ++{ ++ struct stat statbuf; ++ ++ if (fstat(fd, &statbuf) == -1) { ++ return false; ++ } ++ ++ return S_ISFIFO(statbuf.st_mode); ++} ++ ++static bool migration_fd_valid(int fd) ++{ ++ if (fd_is_socket(fd)) { ++ return true; ++ } ++ ++ if (fd_is_pipe(fd)) { ++ return true; ++ } ++ ++ return false; ++} + + void fd_start_outgoing_migration(MigrationState *s, const char *fdname, Error **errp) + { +@@ -34,7 +57,7 @@ void fd_start_outgoing_migration(MigrationState *s, const char *fdname, Error ** + return; + } + +- if (!fd_is_socket(fd)) { ++ if (!migration_fd_valid(fd)) { + warn_report("fd: migration to a file is deprecated." + " Use file: instead."); + } +@@ -68,7 +91,7 @@ void fd_start_incoming_migration(const char *fdname, Error **errp) + return; + } + +- if (!fd_is_socket(fd)) { ++ if (!migration_fd_valid(fd)) { + warn_report("fd: migration to a file is deprecated." + " Use file: instead."); + } +-- +2.39.3 + diff --git a/qemu-kvm.spec b/qemu-kvm.spec index 9dfc1f3..1f20488 100644 --- a/qemu-kvm.spec +++ b/qemu-kvm.spec @@ -143,7 +143,7 @@ Obsoletes: %{name}-block-ssh <= %{epoch}:%{version} \ Summary: QEMU is a machine emulator and virtualizer Name: qemu-kvm Version: 9.1.0 -Release: 7%{?rcrel}%{?dist}%{?cc_suffix} +Release: 8%{?rcrel}%{?dist}%{?cc_suffix} # Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped # Epoch 15 used for RHEL 8 # Epoch 17 used for RHEL 9 (due to release versioning offset in RHEL 8.5) @@ -358,6 +358,8 @@ Patch90: kvm-pc-bios-s390x-Initialize-cdrom-type-to-false-for-eac.patch Patch91: kvm-pc-bios-s390x-Initialize-machine-loadparm-before-pro.patch # For RHEL-68444 - The new "boot order" feature is sometimes not working as expected [RHEL 10] Patch92: kvm-pc-bios-s390-ccw-Re-initialize-receive-queue-index-b.patch +# For RHEL-69047 - warning: fd: migration to a file is deprecated when create or revert a snapshot +Patch93: kvm-migration-Allow-pipes-to-keep-working-for-fd-migrati.patch %if %{have_clang} BuildRequires: clang @@ -1424,6 +1426,11 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %endif %changelog +* Fri Dec 13 2024 Miroslav Rezanina - 9.1.0-8 +- kvm-migration-Allow-pipes-to-keep-working-for-fd-migrati.patch [RHEL-69047] +- Resolves: RHEL-69047 + (warning: fd: migration to a file is deprecated when create or revert a snapshot) + * Tue Dec 03 2024 Miroslav Rezanina - 9.1.0-7 - kvm-virtio-net-Add-queues-before-loading-them.patch [RHEL-58316] - kvm-docs-system-s390x-bootdevices-Update-loadparm-docume.patch [RHEL-68444]