From 0aa6aefc9c93db1f64e3ba406ee5234da75b545b Mon Sep 17 00:00:00 2001 From: Denis V. Lunev Date: Wed, 24 Feb 2016 11:53:38 +0300 Subject: migration (ordinary): move bdrv_invalidate_cache_all of of coroutine context There is a possibility to hit an assert in qcow2_get_specific_info that s->qcow_version is undefined. This happens when VM in starting from suspended state, i.e. it processes incoming migration, and in the same time 'info block' is called. The problem is that qcow2_invalidate_cache() closes the image and memset()s BDRVQcowState in the middle. The patch moves processing of bdrv_invalidate_cache_all out of coroutine context for standard migration to avoid that. Signed-off-by: Denis V. Lunev Reviewed-by: Fam Zheng CC: Paolo Bonzini CC: Juan Quintela CC: Amit Shah Message-Id: <1456304019-10507-2-git-send-email-den@openvz.org> [Amit: Fix a use-after-free bug] Signed-off-by: Amit Shah --- include/migration/migration.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/migration/migration.h b/include/migration/migration.h index 85b6026d10..ac2c12c2a5 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -104,6 +104,8 @@ struct MigrationIncomingState { QemuMutex rp_mutex; /* We send replies from multiple threads */ void *postcopy_tmp_page; + QEMUBH *bh; + int state; /* See savevm.c */ LoadStateEntry_Head loadvm_handlers; -- cgit v1.2.3-55-g7522