提交 a5615b14 编写于 作者: O Orit Wasserman 提交者: Juan Quintela

XBZRLE cache size should not be larger than guest memory size

Signed-off-by: NOrit Wasserman <owasserm@redhat.com>
Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: NJuan Quintela <quintela@redhat.com>
上级 905f26f2
......@@ -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",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册