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>
This commit is contained in:
Orit Wasserman 2014-01-30 20:08:38 +02:00 committed by Juan Quintela
parent a17b2fd358
commit 89db9987c0
3 changed files with 17 additions and 7 deletions

View file

@ -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;