exec/rom_reset: Free rom data during inmigrate skip
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Fri, 13 Mar 2020 15:59:39 +0000 (15:59 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Mar 2020 22:02:26 +0000 (23:02 +0100)
commit5073b5d3ea303d37f4a8e2ea451d7a2eb1817448
tree8ae0d8931db979d8cfcb40d9b79ef5a852f85704
parent67cf3f5cf590549b1b8f8e2eb92ca20ed80d8a0a
exec/rom_reset: Free rom data during inmigrate skip

Commit 355477f8c73e9 skips rom reset when we're an incoming migration
so as not to overwrite shared ram in the ignore-shared migration
optimisation.
However, it's got an unexpected side effect that because it skips
freeing the ROM data, when rom_reset gets called later on, after
migration (e.g. during a reboot), the ROM does get reset to the original
file contents.  Because of seabios/x86's weird reboot process
this confuses a reboot into hanging after a migration.

Fixes: 355477f8c73e9 ("migration: do not rom_reset() during incoming migration")
https://bugzilla.redhat.com/show_bug.cgi?id=1809380

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/core/loader.c