XBZRLE cache size should not be larger than guest memory size
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:
parent
905f26f222
commit
a5615b14a6
@ -479,6 +479,13 @@ void qmp_migrate_set_cache_size(int64_t value, Error **errp)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Cache should not be larger than guest ram size */
|
||||
if (value > ram_bytes_total()) {
|
||||
error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
|
||||
"exceeds guest ram size ");
|
||||
return;
|
||||
}
|
||||
|
||||
new_size = xbzrle_cache_resize(value);
|
||||
if (new_size < 0) {
|
||||
error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
|
||||
|
Loading…
Reference in New Issue
Block a user