migration: Make xbzrle_cache_size a migration parameter

Right now it is a variable in MigrationState instead of a
MigrationParameter.  The change allows to set it as the rest of the
Migration parameters, from the command line, with
query_migration_paramters, set_migrate_parameters, etc.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
Juan Quintela 2017-10-05 21:30:10 +02:00
parent c9dede2d48
commit 73af8dd8d7
5 changed files with 69 additions and 22 deletions

View file

@ -129,13 +129,6 @@ int xbzrle_cache_resize(int64_t new_size, Error **errp)
return -1;
}
/* Cache should not be larger than guest ram size */
if (new_size > ram_bytes_total()) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size",
"exceeds guest ram size");
return -1;
}
if (new_size == migrate_xbzrle_cache_size()) {
/* nothing to do */
return 0;