[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/34] migration: Do not call PRECOPY_NOTIFY_SETUP notifiers in ca
From: |
peterx |
Subject: |
[PULL 08/34] migration: Do not call PRECOPY_NOTIFY_SETUP notifiers in case of error |
Date: |
Mon, 11 Mar 2024 17:58:59 -0400 |
From: Cédric Le Goater <clg@redhat.com>
When commit bd2270608fa0 ("migration/ram.c: add a notifier chain for
precopy") added PRECOPY_NOTIFY_SETUP notifiers at the end of
qemu_savevm_state_setup(), it didn't take into account a possible
error in the loop calling vmstate_save() or .save_setup() handlers.
Check ret value before calling the notifiers.
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Link: 20240304122844.1888308-10-clg@redhat.com">https://lore.kernel.org/r/20240304122844.1888308-10-clg@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/savevm.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/migration/savevm.c b/migration/savevm.c
index e84b26e1c8..76b57a9888 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1317,7 +1317,7 @@ void qemu_savevm_state_setup(QEMUFile *f)
MigrationState *ms = migrate_get_current();
SaveStateEntry *se;
Error *local_err = NULL;
- int ret;
+ int ret = 0;
json_writer_int64(ms->vmdesc, "page_size", qemu_target_page_size());
json_writer_start_array(ms->vmdesc, "devices");
@@ -1351,6 +1351,10 @@ void qemu_savevm_state_setup(QEMUFile *f)
}
}
+ if (ret) {
+ return;
+ }
+
if (precopy_notify(PRECOPY_NOTIFY_SETUP, &local_err)) {
error_report_err(local_err);
}
--
2.44.0
- [PULL 00/34] Migration 20240311 patches, peterx, 2024/03/11
- [PULL 01/34] migration: Don't serialize devices in qemu_savevm_state_iterate(), peterx, 2024/03/11
- [PULL 02/34] vfio/migration: Refactor vfio_save_state() return value, peterx, 2024/03/11
- [PULL 03/34] vfio/migration: Add a note about migration rate limiting, peterx, 2024/03/11
- [PULL 04/34] migration/ram: add additional check, peterx, 2024/03/11
- [PULL 05/34] migration: Report error when shutdown fails, peterx, 2024/03/11
- [PULL 06/34] migration: Remove SaveStateHandler and LoadStateHandler typedefs, peterx, 2024/03/11
- [PULL 07/34] migration: Add documentation for SaveVMHandlers, peterx, 2024/03/11
- [PULL 08/34] migration: Do not call PRECOPY_NOTIFY_SETUP notifiers in case of error,
peterx <=
- [PULL 09/34] migration/multifd: Don't fsync when closing QIOChannelFile, peterx, 2024/03/11
- [PULL 10/34] migration/rdma: Fix a memory issue for migration, peterx, 2024/03/11
- [PULL 11/34] physmem: Rename addr1 to more informative mr_addr in flatview_read/write() and similar, peterx, 2024/03/11
- [PULL 13/34] physmem: Factor out body of flatview_read/write_continue() loop, peterx, 2024/03/11
- [PULL 12/34] physmem: Reduce local variable scope in flatview_read/write_continue(), peterx, 2024/03/11
- [PULL 16/34] migration: export fewer options, peterx, 2024/03/11
- [PULL 14/34] physmem: Fix wrong address in large address_space_read/write_cached_slow(), peterx, 2024/03/11
- [PULL 27/34] migration: purge MigrationState from public interface, peterx, 2024/03/11
- [PULL 29/34] migration/multifd: Allow clearing of the file_bmap from multifd, peterx, 2024/03/11
- [PULL 34/34] migration/multifd: Add new migration test cases for legacy zero page checking., peterx, 2024/03/11