mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
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>
This commit is contained in:
parent
338182c83c
commit
83c13382e4
3 changed files with 3 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue