[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/34] migration/ram: add additional check
From: |
peterx |
Subject: |
[PULL 04/34] migration/ram: add additional check |
Date: |
Mon, 11 Mar 2024 17:58:55 -0400 |
From: Maksim Davydov <davydov-max@yandex-team.ru>
If a migration stream is broken, the address and flag reading can return
zero. Thus, an irrelevant flag error will be returned instead of EIO.
It can be fixed by additional check after the reading.
Signed-off-by: Maksim Davydov <davydov-max@yandex-team.ru>
Link:
20240304144203.158477-1-davydov-max@yandex-team.ru">https://lore.kernel.org/r/20240304144203.158477-1-davydov-max@yandex-team.ru
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/ram.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/migration/ram.c b/migration/ram.c
index 003c28e133..2cd936d9ce 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -4214,6 +4214,12 @@ static int ram_load_precopy(QEMUFile *f)
i++;
addr = qemu_get_be64(f);
+ ret = qemu_file_get_error(f);
+ if (ret) {
+ error_report("Getting RAM address failed");
+ break;
+ }
+
flags = addr & ~TARGET_PAGE_MASK;
addr &= TARGET_PAGE_MASK;
--
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 <=
- [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, 2024/03/11
- [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