]> git.proxmox.com Git - mirror_qemu.git/commit
migration/ram: Fix error handling in ram_write_tracking_start()
authorDavid Hildenbrand <david@redhat.com>
Thu, 5 Jan 2023 12:45:25 +0000 (13:45 +0100)
committerJuan Quintela <quintela@redhat.com>
Mon, 6 Feb 2023 18:22:56 +0000 (19:22 +0100)
commit72ef3a370836aa07261ad7aaeea27ed5cbcee342
treeac29b9ef11fa628301ba6d0c0583e8997dec8e5e
parent5f19a4491941fdc5c5b50ce4ade6ffffe0f591b4
migration/ram: Fix error handling in ram_write_tracking_start()

If something goes wrong during uffd_change_protection(), we would miss
to unregister uffd-wp and not release our reference. Fix it by
performing the uffd_change_protection(true) last.

Note that a uffd_change_protection(false) on the recovery path without a
prior uffd_change_protection(false) is fine.

Fixes: 278e2f551a09 ("migration: support UFFD write fault processing in ram_save_iterate()")
Cc: qemu-stable@nongnu.org
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration/ram.c