diff options
| author | 2024-01-19 20:39:20 -0300 | |
|---|---|---|
| committer | 2024-01-29 11:02:12 +0800 | |
| commit | 9cf268965dba03b718c514adc06c2a5d444778e1 (patch) | |
| tree | aaaa41e0c2e8d10b288e1a536335800a7f4c7108 | |
| parent | migration: Take reference to migration state around bg_migration_vm_start_bh (diff) | |
| download | qemu-9cf268965dba03b718c514adc06c2a5d444778e1.tar.xz qemu-9cf268965dba03b718c514adc06c2a5d444778e1.zip | |
migration: Reference migration state around loadvm_postcopy_handle_run_bh
We need to hold a reference to the current_migration object around
async calls to avoid it been freed while still in use. Even on this
load-side function, we might still use the MigrationState, e.g to
check for capabilities.
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240119233922.32588-4-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
| -rw-r--r-- | migration/savevm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/migration/savevm.c b/migration/savevm.c index 6410705ebe..93387350c7 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2174,6 +2174,7 @@ static void loadvm_postcopy_handle_run_bh(void *opaque) qemu_bh_delete(mis->bh); trace_vmstate_downtime_checkpoint("dst-postcopy-bh-vm-started"); + object_unref(OBJECT(migration_get_current())); } /* After all discards we can start running and asking for pages */ @@ -2189,6 +2190,7 @@ static int loadvm_postcopy_handle_run(MigrationIncomingState *mis) postcopy_state_set(POSTCOPY_INCOMING_RUNNING); mis->bh = qemu_bh_new(loadvm_postcopy_handle_run_bh, mis); + object_ref(OBJECT(migration_get_current())); qemu_bh_schedule(mis->bh); /* We need to finish reading the stream from the package |
