@@ -534,7 +534,12 @@ static void *postcopy_ram_fault_thread(void *opaque)
migrate_send_rp_req_pages(mis, NULL,
rb_offset, hostpagesize);
}
- } else { /* UFFDIO_REGISTER_MODE_WP */
+ } else if (msg.arg.pagefault.flags &
+ UFFD_PAGEFAULT_FLAG_WP) { /* UFFDIO_REGISTER_MODE_WP */
+ /*
+ * msg.arg.pagefault.flags &UFFD_PAGEFAULT_FLAG_WP expected to
+ * be set in case of pagefault due to write protected page
+ * */
MigrationState *ms = container_of(us, MigrationState,
userfault_state);
ret = ram_save_queue_pages(ms, qemu_ram_get_idstr(rb), rb_offset,