From: Orit Wasserman Date: Thu, 30 Jan 2014 18:08:36 +0000 (+0200) Subject: XBZRLE cache size should not be larger than guest memory size X-Git-Tag: qemu-xen-4.5.0-rc1~224^2~2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a5615b14a66e86f620e90c8f4b3537c28bb328d4;p=qemu-xen.git XBZRLE cache size should not be larger than guest memory size Signed-off-by: Orit Wasserman Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Juan Quintela --- diff --git a/migration.c b/migration.c index 46a7305395..25add6f9e2 100644 --- a/migration.c +++ b/migration.c @@ -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",