On 7/2/24 14:33, Cédric Le Goater wrote:
The .save_setup() handler has now an Error** argument that we can use
to propagate errors reported by the .log_global_start() handler. Do
that for the RAM. qemu_savevm_state_setup() will store the error under
the migration stream for later detection in the migration sequence.
Signed-off-by: Cédric Le Goater <c...@redhat.com>
---
migration/ram.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
-static void ram_init_bitmaps(RAMState *rs)
+static void ram_init_bitmaps(RAMState *rs, Error **errp)
Please return a boolean.
{
- Error *local_err = NULL;
-
qemu_mutex_lock_ramlist();
WITH_RCU_READ_LOCK_GUARD() {
ram_list_init_bitmaps();
/* We don't use dirty log with background snapshots */
if (!migrate_background_snapshot()) {
- memory_global_dirty_log_start(GLOBAL_DIRTY_MIGRATION, &local_err);
- if (local_err) {
- error_report_err(local_err);
+ memory_global_dirty_log_start(GLOBAL_DIRTY_MIGRATION, errp);
+ if (*errp) {
+ break;
}
migration_bitmap_sync_precopy(rs, false);
}
@@ -2828,7 +2826,7 @@ static void ram_init_bitmaps(RAMState *rs)
migration_bitmap_clear_discarded_pages(rs);
}