diff options
author | Orit Wasserman <owasserm@redhat.com> | 2014-01-30 20:08:38 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2014-02-04 16:50:37 +0100 |
commit | 89db9987c07977bdb78d5d4b41d65e7acb9a5a2c (patch) | |
tree | 0da66555ff71ef4486679a0493d2ee632c4d6bcc /arch_init.c | |
parent | a17b2fd3580d1da96e806c8b58e61255e8c57577 (diff) |
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 'arch_init.c')
-rw-r--r-- | arch_init.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch_init.c b/arch_init.c index 1fa5f1fdd4..80574a090c 100644 --- a/arch_init.c +++ b/arch_init.c @@ -284,7 +284,9 @@ 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, current_data); + if (cache_insert(XBZRLE.cache, current_addr, current_data) == -1) { + return -1; + } } acct_info.xbzrle_cache_miss++; return -1; |