- kvm-vmstate-Introduce-VMSTATE_VARRAY_INT32_ALLOC.patch [RHEL-174858] - kvm-target-arm-Move-compare_u64-to-helper.c.patch [RHEL-174858] - kvm-target-arm-Convert-init_cpreg_list-to-g_hash_table_f.patch [RHEL-174858] - kvm-target-arm-machine-Use-VMSTATE_VARRAY_INT32_ALLOC-fo.patch [RHEL-174858] - kvm-target-arm-kvm-Export-kvm_print_register_name.patch [RHEL-174858] - kvm-target-arm-kvm-Tweak-print_register_name-for-arm64-s.patch [RHEL-174858] - kvm-target-arm-machine-Trace-cpreg-names-which-do-not-ma.patch [RHEL-174858] - kvm-target-arm-machine-Trace-all-register-mismatches.patch [RHEL-174858] - kvm-target-arm-machine-Fix-detection-of-unknown-incoming.patch [RHEL-174858] - kvm-target-arm-cpu-Introduce-the-infrastructure-for-cpre.patch [RHEL-174858] - kvm-target-arm-machine-Handle-ToleranceNotOnBothEnds-mig.patch [RHEL-174858] - kvm-target-arm-machine-Handle-ToleranceOnlySrcTestValue-.patch [RHEL-174858] - kvm-target-arm-cpu64-Mitigate-migration-failures-due-to-.patch [RHEL-174858] - kvm-target-arm-cpu64-Define-cpreg-migration-tolerance-fo.patch [RHEL-174858] - kvm-target-arm-helper-Define-cpreg-migration-tolerance-f.patch [RHEL-174858] - kvm-Revert-target-arm-Reinstate-bogus-AArch32-DBGDTRTX-r.patch [RHEL-174858] - kvm-hw-pci-host-gpex-acpi-Fix-_DSM-function-0-support-re.patch [RHEL-138494] - kvm-vfio-scsi-ui-Error-check-qio_channel_socket_connect_.patch [RHEL-138494] - kvm-vfio-igd-Enable-quirks-when-IGD-is-not-the-primary-d.patch [RHEL-138494] - kvm-vfio-Remove-vfio-amd-xgbe-device.patch [RHEL-138494] - kvm-vfio-Remove-vfio-calxeda-xgmac-device.patch [RHEL-138494] - kvm-hw-arm-virt-Include-system-system.h.patch [RHEL-138494] - kvm-vfio-Remove-vfio-platform.patch [RHEL-138494] - kvm-vfio-Move-vfio-region.h-under-hw-vfio.patch [RHEL-138494] - kvm-vfio-container-set-error-on-cpr-failure.patch [RHEL-138494] - kvm-vfio-Report-an-error-when-the-dma_max_mappings-limit.patch [RHEL-138494] - kvm-hw-vfio-user-add-x-pci-class-code.patch [RHEL-138494] - kvm-vfio-Introduce-helper-vfio_pci_from_vfio_device.patch [RHEL-138494] - kvm-vfio-vfio-container-base.h-update-VFIOContainerBase-.patch [RHEL-138494] - kvm-vfio-vfio-container.h-update-VFIOContainer-declarati.patch [RHEL-138494] - kvm-hw-vfio-cpr-legacy.c-use-QOM-casts-where-appropriate.patch [RHEL-138494] - kvm-hw-vfio-container.c-use-QOM-casts-where-appropriate.patch [RHEL-138494] - kvm-vfio-spapr.c-use-QOM-casts-where-appropriate.patch [RHEL-138494] - kvm-vfio-vfio-container.h-rename-VFIOContainer-bcontaine.patch [RHEL-138494] - kvm-vfio-user-container.h-update-VFIOUserContainer-decla.patch [RHEL-138494] - kvm-vfio-container.c-use-QOM-casts-where-appropriate.patch [RHEL-138494] - kvm-vfio-user-container.h-rename-VFIOUserContainer-bcont.patch [RHEL-138494] - kvm-vfio-user-pci.c-update-VFIOUserPCIDevice-declaration.patch [RHEL-138494] - kvm-vfio-user-pci.c-use-QOM-casts-where-appropriate.patch [RHEL-138494] - kvm-vfio-user-pci.c-rename-VFIOUserPCIDevice-device-fiel.patch [RHEL-138494] - kvm-vfio-pci.h-update-VFIOPCIDevice-declaration.patch [RHEL-138494] - kvm-vfio-pci.c-use-QOM-casts-where-appropriate.patch [RHEL-138494] - kvm-vfio-pci-quirks.c-use-QOM-casts-where-appropriate.patch [RHEL-138494] - kvm-vfio-cpr.c-use-QOM-casts-where-appropriate.patch [RHEL-138494] - kvm-vfio-igd.c-use-QOM-casts-where-appropriate.patch [RHEL-138494] - kvm-vfio-user-pci.c-use-QOM-casts-where-appropriate2.patch [RHEL-138494] - kvm-vfio-pci.h-rename-VFIOPCIDevice-pdev-field-to-parent.patch [RHEL-138494] - kvm-treewide-handle-result-of-qio_channel_set_blocking.patch [RHEL-138494] - kvm-vfio-pci-Do-not-unparent-in-instance_finalize.patch [RHEL-138494] - kvm-vfio-Do-not-unparent-in-instance_finalize.patch [RHEL-138494] - kvm-include-hw-vfio-vfio-container.h-rename-VFIOContaine.patch [RHEL-138494] - kvm-include-hw-vfio-vfio-container-base.h-rename-VFIOCon.patch [RHEL-138494] - kvm-include-hw-vfio-vfio-container.h-rename-file-to-vfio.patch [RHEL-138494] - kvm-include-hw-vfio-vfio-container-base.h-rename-file-to.patch [RHEL-138494] - kvm-hw-vfio-container.c-rename-file-to-container-legacy..patch [RHEL-138494] - kvm-hw-vfio-container-base.c-rename-file-to-container.c.patch [RHEL-138494] - kvm-vfio-iommufd.c-use-QOM-casts-where-appropriate.patch [RHEL-138494] - kvm-vfio-cpr-iommufd.c-use-QOM-casts-where-appropriate.patch [RHEL-138494] - kvm-vfio-vfio-iommufd.h-rename-VFIOContainer-bcontainer-.patch [RHEL-138494] - kvm-vfio-spapr.c-use-QOM-casts-where-appropriate2.patch [RHEL-138494] - kvm-vfio-spapr.c-rename-VFIOContainer-bcontainer-field-t.patch [RHEL-138494] - kvm-vfio-pci.c-rename-vfio_instance_init-to-vfio_pci_ini.patch [RHEL-138494] - kvm-vfio-pci.c-rename-vfio_instance_finalize-to-vfio_pci.patch [RHEL-138494] - kvm-vfio-pci.c-rename-vfio_pci_dev_class_init-to-vfio_pc.patch [RHEL-138494] - kvm-vfio-pci.c-rename-vfio_pci_dev_info-to-vfio_pci_info.patch [RHEL-138494] - kvm-s390x-s390-pci-vfio.c-use-QOM-casts-where-appropriat.patch [RHEL-138494] - kvm-hw-vfio-types.h-rename-TYPE_VFIO_PCI_BASE-to-TYPE_VF.patch [RHEL-138494] - kvm-vfio-pci.c-rename-vfio_pci_base_dev_class_init-to-vf.patch [RHEL-138494] - kvm-vfio-pci.c-rename-vfio_pci_base_dev_info-to-vfio_pci.patch [RHEL-138494] - kvm-vfio-pci.c-rename-vfio_pci_dev_properties-to-vfio_pc.patch [RHEL-138494] - kvm-vfio-pci.c-rename-vfio_pci_dev_nohotplug_properties-.patch [RHEL-138494] - kvm-vfio-pci.c-rename-vfio_pci_nohotplug_dev_class_init-.patch [RHEL-138494] - kvm-vfio-pci.c-rename-vfio_pci_nohotplug_dev_info-to-vfi.patch [RHEL-138494] - kvm-vfio-user-pci.c-rename-vfio_user_pci_dev_class_init-.patch [RHEL-138494] - kvm-vfio-user-pci.c-rename-vfio_user_pci_dev_properties-.patch [RHEL-138494] - kvm-vfio-user-pci.c-rename-vfio_user_instance_init-to-vf.patch [RHEL-138494] - kvm-vfio-user-pci.c-rename-vfio_user_instance_finalize-t.patch [RHEL-138494] - kvm-vfio-user-pci.c-rename-vfio_user_pci_dev_info-to-vfi.patch [RHEL-138494] - kvm-include-hw-vfio-vfio-device.h-fix-include-header-gua.patch [RHEL-138494] - kvm-vfio-Remove-workaround-for-kernel-DMA-unmap-overflow.patch [RHEL-138494] - kvm-system-iommufd-Use-uint64_t-type-for-IOVA-mapping-si.patch [RHEL-138494] - kvm-hw-vfio-Reorder-vfio_container_query_dirty_bitmap-tr.patch [RHEL-138494] - kvm-hw-vfio-Avoid-ram_addr_t-in-vfio_container_query_dir.patch [RHEL-138494] - kvm-hw-vfio-Use-uint64_t-for-IOVA-mapping-size-in-vfio_c.patch [RHEL-138494] - kvm-migration-push-Error-errp-into-vmstate_subsection_lo.patch [RHEL-138494] - kvm-migration-push-Error-errp-into-vmstate_load_state.patch [RHEL-138494] - kvm-migration-Remove-error-variant-of-vmstate_save_state.patch [RHEL-138494] - kvm-migration-multi-mode-notifier.patch [RHEL-138494] - kvm-migration-add-cpr_walk_fd.patch [RHEL-138494] - kvm-oslib-qemu_clear_cloexec.patch [RHEL-138494] - kvm-migration-cpr-exec-command-parameter.patch [RHEL-138494] - kvm-migration-cpr-exec-save-and-load.patch [RHEL-138494] - kvm-migration-cpr-exec-mode.patch [RHEL-138494] - kvm-migration-cpr-exec-docs.patch [RHEL-138494] - kvm-vfio-cpr-exec-mode.patch [RHEL-138494] - kvm-hw-vfio-listener-Include-missing-exec-target_page.h-.patch [RHEL-138494] - kvm-hw-Remove-unnecessary-system-ram_addr.h-header.patch [RHEL-138494] - kvm-vfio-container-Remap-only-populated-parts-in-a-secti.patch [RHEL-138494] - kvm-vfio-cpr-legacy-drop-an-erroneous-assert.patch [RHEL-138494] - kvm-vfio-iommufd-Set-cpr.ioas_id-on-source-side-for-CPR-.patch [RHEL-138494] - kvm-vfio-iommufd-Restore-vbasedev-s-reference-to-hwpt-af.patch [RHEL-138494] - kvm-vfio-container-Support-unmap-all-in-one-ioctl.patch [RHEL-138494] - kvm-vfio-iommufd-Support-unmap-all-in-one-ioctl.patch [RHEL-138494] - kvm-vfio-listener-Add-an-assertion-for-unmap_all.patch [RHEL-138494] - kvm-vfio-Clean-up-includes.patch [RHEL-138494] - kvm-migration-set-correct-list-pointer-when-removing-not.patch [RHEL-138494] - kvm-vfio-user-simplify-vfio_user_process.patch [RHEL-138494] - kvm-vfio-user-clarify-partial-message-handling.patch [RHEL-138494] - kvm-vfio-user-refactor-out-header-handling.patch [RHEL-138494] - kvm-vfio-user-simplify-vfio_user_recv_one.patch [RHEL-138494] - kvm-vfio-user-recycle-msg-on-failure.patch [RHEL-138494] - kvm-include-hw-hyperv-Remove-unused-struct-mshv_vp_regis.patch [RHEL-138494] - kvm-linux-headers-Update-to-Linux-v6.18-rc3.patch [RHEL-138494] - kvm-linux-headers-Update-to-Linux-v6.19-rc1.patch [RHEL-138494] - kvm-hw-vfio-Add-helper-to-retrieve-device-feature.patch [RHEL-138494] - kvm-hw-vfio-region-Create-dmabuf-for-PCI-BAR-per-region.patch [RHEL-138494] - Resolves: RHEL-174858 ([rhel10] Backport qemu cross-kernel migration mitigation series) - Resolves: RHEL-138494 (NVIDIA:Grace-Hopper:Backport vfio: Add DMABUF support for PCI BAR regions - RHEL 10.3)
156 lines
5.7 KiB
Diff
156 lines
5.7 KiB
Diff
From b3c7dae14ab3fad5f9fea955b775084517553518 Mon Sep 17 00:00:00 2001
|
|
From: Steve Sistare <steven.sistare@oracle.com>
|
|
Date: Wed, 1 Oct 2025 08:33:59 -0700
|
|
Subject: [PATCH 094/116] migration: cpr-exec docs
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
RH-Author: Rodolfo Vick <None>
|
|
RH-MergeRequest: 486: Add DMABUF support
|
|
RH-Jira: RHEL-138494
|
|
RH-Acked-by: Cédric Le Goater <clg@redhat.com>
|
|
RH-Acked-by: Eric Auger <eric.auger@redhat.com>
|
|
RH-Commit: [78/100] e7264165aa8f378494974ca1898ec4bc3aa6e38f (rovick1/qemu-kvm)
|
|
|
|
Update developer documentation for cpr-exec mode.
|
|
|
|
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
|
|
Reviewed-by: Fabiano Rosas <farosas@suse.de>
|
|
Link: https://lore.kernel.org/r/1759332851-370353-8-git-send-email-steven.sistare@oracle.com
|
|
Signed-off-by: Peter Xu <peterx@redhat.com>
|
|
---
|
|
docs/devel/migration/CPR.rst | 112 ++++++++++++++++++++++++++++++++++-
|
|
1 file changed, 111 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/docs/devel/migration/CPR.rst b/docs/devel/migration/CPR.rst
|
|
index 0a0fd4f6dc..b6178568a8 100644
|
|
--- a/docs/devel/migration/CPR.rst
|
|
+++ b/docs/devel/migration/CPR.rst
|
|
@@ -5,7 +5,7 @@ CPR is the umbrella name for a set of migration modes in which the
|
|
VM is migrated to a new QEMU instance on the same host. It is
|
|
intended for use when the goal is to update host software components
|
|
that run the VM, such as QEMU or even the host kernel. At this time,
|
|
-the cpr-reboot and cpr-transfer modes are available.
|
|
+the cpr-reboot, cpr-transfer, and cpr-exec modes are available.
|
|
|
|
Because QEMU is restarted on the same host, with access to the same
|
|
local devices, CPR is allowed in certain cases where normal migration
|
|
@@ -324,3 +324,113 @@ descriptors from old to new QEMU. In the future, descriptors for
|
|
vhost, and char devices could be transferred,
|
|
preserving those devices and their kernel state without interruption,
|
|
even if they do not explicitly support live migration.
|
|
+
|
|
+cpr-exec mode
|
|
+-------------
|
|
+
|
|
+In this mode, QEMU stops the VM, writes VM state to the migration
|
|
+URI, and directly exec's a new version of QEMU on the same host,
|
|
+replacing the original process while retaining its PID. Guest RAM is
|
|
+preserved in place, albeit with new virtual addresses. The user
|
|
+completes the migration by specifying the ``-incoming`` option, and
|
|
+by issuing the ``migrate-incoming`` command if necessary; see details
|
|
+below.
|
|
+
|
|
+This mode supports VFIO/IOMMUFD devices by preserving device
|
|
+descriptors and hence kernel state across the exec, even for devices
|
|
+that do not support live migration.
|
|
+
|
|
+Because the old and new QEMU instances are not active concurrently,
|
|
+the URI cannot be a type that streams data from one instance to the
|
|
+other.
|
|
+
|
|
+This mode does not require a channel of type ``cpr``. The information
|
|
+that is passed over that channel for cpr-transfer mode is instead
|
|
+serialized to a memfd, the number of the fd is saved in the
|
|
+QEMU_CPR_EXEC_STATE environment variable during the exec of new QEMU.
|
|
+and new QEMU mmaps the memfd.
|
|
+
|
|
+Usage
|
|
+^^^^^
|
|
+
|
|
+Arguments for the new QEMU process are taken from the
|
|
+@cpr-exec-command parameter. The first argument should be the
|
|
+path of a new QEMU binary, or a prefix command that exec's the
|
|
+new QEMU binary, and the arguments should include the ''-incoming''
|
|
+option.
|
|
+
|
|
+Memory backend objects must have the ``share=on`` attribute.
|
|
+The VM must be started with the ``-machine aux-ram-share=on`` option.
|
|
+
|
|
+Outgoing:
|
|
+ * Set the migration mode parameter to ``cpr-exec``.
|
|
+ * Set the ``cpr-exec-command`` parameter.
|
|
+ * Issue the ``migrate`` command. It is recommended that the URI be
|
|
+ a ``file`` type, but one can use other types such as ``exec``,
|
|
+ provided the command captures all the data from the outgoing side,
|
|
+ and provides all the data to the incoming side.
|
|
+
|
|
+Incoming:
|
|
+ * You do not need to explicitly start new QEMU. It is started as
|
|
+ a side effect of the migrate command above.
|
|
+ * If the VM was running when the outgoing ``migrate`` command was
|
|
+ issued, then QEMU automatically resumes VM execution.
|
|
+
|
|
+Example 1: incoming URI
|
|
+^^^^^^^^^^^^^^^^^^^^^^^
|
|
+
|
|
+In these examples, we simply restart the same version of QEMU, but in
|
|
+a real scenario one would set a new QEMU binary path in
|
|
+cpr-exec-command.
|
|
+
|
|
+::
|
|
+
|
|
+ # qemu-kvm -monitor stdio
|
|
+ -object memory-backend-memfd,id=ram0,size=4G
|
|
+ -machine memory-backend=ram0
|
|
+ -machine aux-ram-share=on
|
|
+ ...
|
|
+
|
|
+ QEMU 10.2.50 monitor - type 'help' for more information
|
|
+ (qemu) info status
|
|
+ VM status: running
|
|
+ (qemu) migrate_set_parameter mode cpr-exec
|
|
+ (qemu) migrate_set_parameter cpr-exec-command qemu-kvm ... -incoming file:vm.state
|
|
+ (qemu) migrate -d file:vm.state
|
|
+ (qemu) QEMU 10.2.50 monitor - type 'help' for more information
|
|
+ (qemu) info status
|
|
+ VM status: running
|
|
+
|
|
+Example 2: incoming defer
|
|
+^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
+::
|
|
+
|
|
+ # qemu-kvm -monitor stdio
|
|
+ -object memory-backend-memfd,id=ram0,size=4G
|
|
+ -machine memory-backend=ram0
|
|
+ -machine aux-ram-share=on
|
|
+ ...
|
|
+
|
|
+ QEMU 10.2.50 monitor - type 'help' for more information
|
|
+ (qemu) info status
|
|
+ VM status: running
|
|
+ (qemu) migrate_set_parameter mode cpr-exec
|
|
+ (qemu) migrate_set_parameter cpr-exec-command qemu-kvm ... -incoming defer
|
|
+ (qemu) migrate -d file:vm.state
|
|
+ (qemu) QEMU 10.2.50 monitor - type 'help' for more information
|
|
+ (qemu) info status
|
|
+ status: paused (inmigrate)
|
|
+ (qemu) migrate_incoming file:vm.state
|
|
+ (qemu) info status
|
|
+ VM status: running
|
|
+
|
|
+Caveats
|
|
+^^^^^^^
|
|
+
|
|
+cpr-exec mode may not be used with postcopy, background-snapshot,
|
|
+or COLO.
|
|
+
|
|
+cpr-exec mode requires permission to use the exec system call, which
|
|
+is denied by certain sandbox options, such as spawn.
|
|
+
|
|
+The guest pause time increases for large guest RAM backed by small pages.
|
|
--
|
|
2.52.0
|
|
|