diff options
author | Peter Lieven <pl@dlhnet.de> | 2013-02-25 19:12:04 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2013-03-11 13:32:03 +0100 |
commit | ee0b44aa9d9450e873a761ca2030b2fa3ec52eb0 (patch) | |
tree | 1f8f203f961610e5b5a1d23e8985df071e847d1b /arch_init.c | |
parent | 32a1c08b60a8ac0e63b54a5793a26b5e32b36618 (diff) | |
download | qemu-ee0b44aa9d9450e873a761ca2030b2fa3ec52eb0.zip qemu-ee0b44aa9d9450e873a761ca2030b2fa3ec52eb0.tar.gz qemu-ee0b44aa9d9450e873a761ca2030b2fa3ec52eb0.tar.bz2 |
page_cache: dup memory on insert
The page cache frees all data on finish, on resize and
if there is collision on insert. So it should be the caches
responsibility to dup the data that is stored in the cache.
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'arch_init.c')
-rw-r--r-- | arch_init.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch_init.c b/arch_init.c index 6089c53..98e2bc6 100644 --- a/arch_init.c +++ b/arch_init.c @@ -293,8 +293,7 @@ static int save_xbzrle_page(QEMUFile *f, uint8_t *current_data, if (!cache_is_cached(XBZRLE.cache, current_addr)) { if (!last_stage) { - cache_insert(XBZRLE.cache, current_addr, - g_memdup(current_data, TARGET_PAGE_SIZE)); + cache_insert(XBZRLE.cache, current_addr, current_data); } acct_info.xbzrle_cache_miss++; return -1; |