]> xenbits.xensource.com Git - qemu-xen.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)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 29 Mar 2023 07:20:04 +0000 (10:20 +0300)
commitee2ec0ac52a315c8b4e9991b4523abd0c62d24d7
tree03badca92ce11678b29d1b09f0d3677726a5efa0
parentf759e330002777e9a4a7a3a600aad322733125fc
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>
(cherry picked from commit 72ef3a370836aa07261ad7aaeea27ed5cbcee342)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
migration/ram.c