mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
migration: avoid segmentfault when take a snapshot of a VM which being migrated
During an active background migration, snapshot will trigger a segmentfault. As snapshot clears the "current_migration" struct and updates "to_dst_file" before it finds out that there is a migration task, Migration accesses the null pointer in "current_migration" struct and qemu crashes eventually. Signed-off-by: Jia Lina <jialina01@baidu.com> Signed-off-by: Chai Wen <chaiwen@baidu.com> Signed-off-by: Zhang Yu <zhangyu31@baidu.com> Message-Id: <20181026083620.10172-1-jialina01@baidu.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
ea3b23e5ff
commit
3d63da16fb
3 changed files with 14 additions and 9 deletions
|
@ -742,7 +742,7 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp)
|
|||
* Return true if we're already in the middle of a migration
|
||||
* (i.e. any of the active or setup states)
|
||||
*/
|
||||
static bool migration_is_setup_or_active(int state)
|
||||
bool migration_is_setup_or_active(int state)
|
||||
{
|
||||
switch (state) {
|
||||
case MIGRATION_STATUS_ACTIVE:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue