qemu/migration
Avihai Horon 4f8cf323e8 migration: Fix migration_channel_read_peek() error path
migration_channel_read_peek() calls qio_channel_readv_full() and handles
both cases of return value == 0 and return value < 0 the same way, by
calling error_setg() with errp. However, if return value < 0, errp is
already set, so calling error_setg() with errp will lead to an assert.

Fix it by handling these cases separately, calling error_setg() with
errp only in return value == 0 case.

Fixes: 6720c2b32725 ("migration: check magic value for deciding the mapping of channels")
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/r/20231231093016.14204-10-avihaih@nvidia.com
Signed-off-by: Peter Xu <peterx@redhat.com>
2024-01-04 09:52:42 +08:00
..
2023-12-21 22:49:27 +01:00
2023-06-05 20:48:34 +02:00
2023-10-04 13:16:58 +02:00
2023-07-25 17:13:20 +03:00
2023-07-25 17:13:20 +03:00
2023-11-01 16:13:58 +01:00
2023-11-01 16:13:58 +01:00
2023-11-03 10:48:37 +01:00