Skip to content
Snippets Groups Projects
  • Peter Xu's avatar
    7aa6070d
    migration: Refactor error handling in source return path · 7aa6070d
    Peter Xu authored
    
    rp_state.error was a boolean used to show error happened in return path
    thread.  That's not only duplicating error reporting (migrate_set_error),
    but also not good enough in that we only do error_report() and set it to
    true, we never can keep a history of the exact error and show it in
    query-migrate.
    
    To make this better, a few things done:
    
      - Use error_setg() rather than error_report() across the whole lifecycle
        of return path thread, keeping the error in an Error*.
    
      - With above, no need to have mark_source_rp_bad(), remove it, alongside
        with rp_state.error itself.
    
      - Use migrate_set_error() to apply that captured error to the global
        migration object when error occured in this thread.
    
      - Do the same when detected qemufile error in source return path
    
    We need to re-export qemu_file_get_error_obj() to do the last one.
    
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Reviewed-by: default avatarFabiano Rosas <farosas@suse.de>
    Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
    Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
    Message-ID: <20231017202633.296756-2-peterx@redhat.com>
    7aa6070d
    History
    migration: Refactor error handling in source return path
    Peter Xu authored
    
    rp_state.error was a boolean used to show error happened in return path
    thread.  That's not only duplicating error reporting (migrate_set_error),
    but also not good enough in that we only do error_report() and set it to
    true, we never can keep a history of the exact error and show it in
    query-migrate.
    
    To make this better, a few things done:
    
      - Use error_setg() rather than error_report() across the whole lifecycle
        of return path thread, keeping the error in an Error*.
    
      - With above, no need to have mark_source_rp_bad(), remove it, alongside
        with rp_state.error itself.
    
      - Use migrate_set_error() to apply that captured error to the global
        migration object when error occured in this thread.
    
      - Do the same when detected qemufile error in source return path
    
    We need to re-export qemu_file_get_error_obj() to do the last one.
    
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Reviewed-by: default avatarFabiano Rosas <farosas@suse.de>
    Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
    Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
    Message-ID: <20231017202633.296756-2-peterx@redhat.com>