Message ID | 20231004220240.167175-5-peterx@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | migration: Better error handling in rp thread, allow failures in recover | expand |
Peter Xu <peterx@redhat.com> wrote: > We've already did this for most of the return path thread errors, but not > yet for the IO errors happened on the return path qemufile. Do that too. > > Re-export qemu_file_get_error_obj(). > > Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com>
diff --git a/migration/qemu-file.h b/migration/qemu-file.h index 03e718c264..75efe503c4 100644 --- a/migration/qemu-file.h +++ b/migration/qemu-file.h @@ -120,6 +120,7 @@ int coroutine_mixed_fn qemu_peek_byte(QEMUFile *f, int offset); void qemu_file_skip(QEMUFile *f, int size); int qemu_file_get_error_obj_any(QEMUFile *f1, QEMUFile *f2, Error **errp); void qemu_file_set_error_obj(QEMUFile *f, int ret, Error *err); +int qemu_file_get_error_obj(QEMUFile *f, Error **errp); void qemu_file_set_error(QEMUFile *f, int ret); int qemu_file_shutdown(QEMUFile *f); QEMUFile *qemu_file_get_return_path(QEMUFile *f); diff --git a/migration/migration.c b/migration/migration.c index e821e80094..b28b504b4c 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1884,6 +1884,7 @@ static void *source_return_path_thread(void *opaque) header_len = qemu_get_be16(rp); if (qemu_file_get_error(rp)) { + qemu_file_get_error_obj(rp, &err); goto out; } diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 5e8207dae4..ffa9c0a48a 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -146,7 +146,7 @@ void qemu_file_set_hooks(QEMUFile *f, const QEMUFileHooks *hooks) * is not 0. * */ -static int qemu_file_get_error_obj(QEMUFile *f, Error **errp) +int qemu_file_get_error_obj(QEMUFile *f, Error **errp) { if (errp) { *errp = f->last_error_obj ? error_copy(f->last_error_obj) : NULL;
We've already did this for most of the return path thread errors, but not yet for the IO errors happened on the return path qemufile. Do that too. Re-export qemu_file_get_error_obj(). Signed-off-by: Peter Xu <peterx@redhat.com> --- migration/qemu-file.h | 1 + migration/migration.c | 1 + migration/qemu-file.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-)