@samitouri / QOSamiQemu / commits / 455c908278

migration/savevm.c: reorder usage and assertion of mis->from_src_file

Reorder the code so the assertion of mis->from_src_file occurs before the call to migration_ioc_unregister_yank_from_file, which dereferences it in qemu_file_get_ioc. Fixes: 39675ffffb3394 ("migration: Move the yank unregister of channel_close out") Signed-off-by: Sergei Heifetz <heifetz@yandex-team.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

Sergei Heifetz committed Feb 8, 2026 at 15:39 UTC 455c908278985718f107281eef1a87d30994c55c
1 file changed +2 -1
migration/savevm.c
+2 -1
@@ -2875,13 +2875,14 @@ static bool postcopy_pause_incoming(MigrationIncomingState *mis)
2875
2876 assert(migrate_postcopy_ram());
2877
2878 + assert(mis->from_src_file);
2879 +
2880 /*
2881 * Unregister yank with either from/to src would work, since ioc behind it
2882 * is the same
2883 */
2884 migration_ioc_unregister_yank_from_file(mis->from_src_file);
2885
2884 - assert(mis->from_src_file);
2886 qemu_file_shutdown(mis->from_src_file);
2887 qemu_fclose(mis->from_src_file);
2888 mis->from_src_file = NULL;