Skip to content

migration: Error reporting cleanups

Peter Xu qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 10 repliesIn review
  2. v16 patches 11 repliesSuperseded

Changes in v2 from the cover letter

- Added R-bs
- Patch 1:
- update commit message on s/accidentally merged/merged without proper review/ [Markus]
- Patch 2:
- Added a new follow up patch here from Markus to poison Error's autoptr
- Patch 3:
- Rename migration_connect_set_error to migration_connect_error_propagate [Markus]
- Add comments in commit log for both migrate_connect() and the rename [Markus]
- Patch 4:
- Rename multifd_send_set_error to multifd_send_error_propagate [Markus]
- Patch 6:
- Make migrate_error_propagate() take MigrationState* as before [Markus]
- Remove the one use case of g_clear_pointer() [Markus]
- Touch up commit message for the change

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7migration: Use explicit error_free() instead of g_autoptrmigration/multifd-device-state.c migration/savevm.c+4 -20 replies
2/7Revert "error: define g_autoptr() cleanup function for the Error type"include/qapi/error.h+0 -21 reply
3/7error: Poison g_autoptr(Error) to prevent its useinclude/qapi/error.h+20 -00 replies
4/7migration: Make migration_connect_set_error() own the errormigration/channel.c migration/migration.c+5 -51 reply
5/7migration: Make multifd_send_set_error() own the errormigration/multifd.c+4 -50 replies
6/7migration: Make multifd_recv_terminate_threads() own the errormigration/multifd.c+3 -31 reply
7/7migration: Replace migrate_set_error() with migrate_error_propagate()migration/cpr-exec.c migration/migration.c migration/migration.h +5 more+43 -572 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMaciej S. SzmigieroMarkus ArmbrusterCédric Le Goater
SeriesR-b
1/7R-b
2/7A-b R-b R-b
3/7T-b R-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH for-11.0 v2 0/7] migration: Error reporting cleanups

Based-on: <[email protected]>

This series is based on Markus's recent fix:

[PATCH] migration: Fix double-free on error path
https://lore.kernel.org/r/[email protected]

v2:
- Added R-bs
- Patch 1:
- update commit message on s/accidentally merged/merged without proper review/ [Markus]
- Patch 2:
- Added a new follow up patch here from Markus to poison Error's autoptr
- Patch 3:
- Rename migration_connect_set_error to migration_connect_error_propagate [Markus]
- Add comments in commit log for both migrate_connect() and the rename [Markus]
- Patch 4:
- Rename multifd_send_set_error to multifd_send_error_propagate [Markus]
- Patch 6:
- Make migrate_error_propagate() take MigrationState* as before [Markus]
- Remove the one use case of g_clear_pointer() [Markus]
- Touch up commit message for the change

This series should address the issues discussed in this thread here:

https://lore.kernel.org/r/[email protected]

The problem is Error is not a good candidate of g_autoptr, however the cleanup function was merged without enough review. Luckily, we only have two users so far (after Markus's patch above lands). This series removes the last two in migration code and reverts the auto cleanup function for Error. Instead, poison the auto cleanup function.

When at it, it'll also change migrate_set_error() to start taking ownership of errors, just like what most error APIs do. When at it, it is renamed to migrate_error_propagate() to imply migration version of error_propagate().

Comments welcomed, thanks.

Markus Armbruster (1):
error: Poison g_autoptr(Error) to prevent its use

Peter Xu (6):
migration: Use explicit error_free() instead of g_autoptr Revert "error: define g_autoptr() cleanup function for the Error type"
migration: Make migration_connect_set_error() own the error
migration: Make multifd_send_set_error() own the error
migration: Make multifd_recv_terminate_threads() own the error
migration: Replace migrate_set_error() with migrate_error_propagate()

 include/qapi/error.h             | 20 ++++++++++++-
 migration/migration.h            |  2 +-
 migration/channel.c              |  1 -
 migration/cpr-exec.c             |  5 ++--
 migration/migration.c            | 51 +++++++++++++++-----------------
 migration/multifd-device-state.c |  6 ++--
 migration/multifd.c              | 30 +++++++++----------
 migration/postcopy-ram.c         |  5 ++--
 migration/ram.c                  |  4 +--
 migration/savevm.c               | 17 +++++------
 10 files changed, 73 insertions(+), 68 deletions(-)
Signature · 1 line
2.50.1