diff options
author | Fabiano Rosas <farosas@suse.de> | 2024-01-19 20:39:19 -0300 |
---|---|---|
committer | Peter Xu <peterx@redhat.com> | 2024-01-29 11:02:12 +0800 |
commit | 59094cfa7aa3bcca85cf5ab2110431124da24d84 (patch) | |
tree | 0df4354b91269e560a430f29d99847eab10e03c6 /migration | |
parent | 27eb8499edb2bc952c29ddae0bdac9fc959bf7b1 (diff) | |
download | qemu-59094cfa7aa3bcca85cf5ab2110431124da24d84.zip qemu-59094cfa7aa3bcca85cf5ab2110431124da24d84.tar.gz qemu-59094cfa7aa3bcca85cf5ab2110431124da24d84.tar.bz2 |
migration: Take reference to migration state around bg_migration_vm_start_bh
We need to hold a reference to the current_migration object around
async calls to avoid it been freed while still in use.
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240119233922.32588-3-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r-- | migration/migration.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/migration/migration.c b/migration/migration.c index cf17b68..b1213b5 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3382,6 +3382,7 @@ static void bg_migration_vm_start_bh(void *opaque) vm_resume(s->vm_old_state); migration_downtime_end(s); + object_unref(OBJECT(s)); } /** @@ -3486,6 +3487,7 @@ static void *bg_migration_thread(void *opaque) * writes to virtio VQs memory which is in write-protected region. */ s->vm_start_bh = qemu_bh_new(bg_migration_vm_start_bh, s); + object_ref(OBJECT(s)); qemu_bh_schedule(s->vm_start_bh); bql_unlock(); |