summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorOrit Wasserman <owasserm@redhat.com>2014-01-30 20:08:38 +0200
committerJuan Quintela <quintela@redhat.com>2014-02-04 16:50:37 +0100
commit89db9987c07977bdb78d5d4b41d65e7acb9a5a2c (patch)
tree0da66555ff71ef4486679a0493d2ee632c4d6bcc /include
parenta17b2fd3580d1da96e806c8b58e61255e8c57577 (diff)
downloadqemu-89db9987c07977bdb78d5d4b41d65e7acb9a5a2c.tar.gz
Don't abort on memory allocation error
It is better to fail migration in case of failure to allocate new cache item Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/migration/page_cache.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/migration/page_cache.h b/include/migration/page_cache.h
index 87894fea9f..d156f0d398 100644
--- a/include/migration/page_cache.h
+++ b/include/migration/page_cache.h
@@ -60,11 +60,13 @@ uint8_t *get_cached_data(const PageCache *cache, uint64_t addr);
* cache_insert: insert the page into the cache. the page cache
* will dup the data on insert. the previous value will be overwritten
*
+ * Returns -1 on error
+ *
* @cache pointer to the PageCache struct
* @addr: page address
* @pdata: pointer to the page
*/
-void cache_insert(PageCache *cache, uint64_t addr, uint8_t *pdata);
+int cache_insert(PageCache *cache, uint64_t addr, uint8_t *pdata);
/**
* cache_resize: resize the page cache. In case of size reduction the extra