aboutsummaryrefslogtreecommitdiff
path: root/migration/ram.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2017-05-04 11:45:01 +0200
committerJuan Quintela <quintela@redhat.com>2017-06-07 10:20:53 +0200
commit83c13382e43c4ce157ee26b6d0a6d1db801df78b (patch)
treec677ae9abeb0f10efd51788666ef909e6d361d9a /migration/ram.c
parent338182c83c38f6c13731a98e487e7ba3cda6a615 (diff)
downloadqemu-83c13382e43c4ce157ee26b6d0a6d1db801df78b.zip
qemu-83c13382e43c4ce157ee26b6d0a6d1db801df78b.tar.gz
qemu-83c13382e43c4ce157ee26b6d0a6d1db801df78b.tar.bz2
ram: Call migration_page_queue_free() at ram_migration_cleanup()
We shouldn't be using memory later than that. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/ram.c')
-rw-r--r--migration/ram.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/migration/ram.c b/migration/ram.c
index f387e9c..701a1e6 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1184,10 +1184,9 @@ static bool get_queued_page(RAMState *rs, PageSearchStatus *pss)
* be some left. in case that there is any page left, we drop it.
*
*/
-void migration_page_queue_free(void)
+static void migration_page_queue_free(RAMState *rs)
{
struct RAMSrcPageRequest *mspr, *next_mspr;
- RAMState *rs = &ram_state;
/* This queue generally should be empty - but in the case of a failed
* migration might have some droppings in.
*/
@@ -1437,6 +1436,7 @@ void free_xbzrle_decoded_buf(void)
static void ram_migration_cleanup(void *opaque)
{
+ RAMState *rs = opaque;
RAMBlock *block;
/* caller have hold iothread lock or is in a bh, so there is
@@ -1462,6 +1462,7 @@ static void ram_migration_cleanup(void *opaque)
XBZRLE.current_buf = NULL;
}
XBZRLE_cache_unlock();
+ migration_page_queue_free(rs);
}
static void ram_state_reset(RAMState *rs)