mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
migration/ram: add additional check
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: https://lore.kernel.org/r/20240304144203.158477-1-davydov-max@yandex-team.ru Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
ff64e0ba81
commit
12ab1e4fe8
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue