diff options
author | Juan Quintela <quintela@redhat.com> | 2017-10-05 21:30:10 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2017-10-29 14:06:15 +0100 |
commit | 73af8dd8d75a3e1f13e6c5d2a509fa56eb406519 (patch) | |
tree | e6bf9e86d603baca9bc4ef18483cf273388c63f1 /hmp.c | |
parent | c9dede2d482676440cb6e826ebe87450965fe679 (diff) | |
download | qemu-73af8dd8d75a3e1f13e6c5d2a509fa56eb406519.zip qemu-73af8dd8d75a3e1f13e6c5d2a509fa56eb406519.tar.gz qemu-73af8dd8d75a3e1f13e6c5d2a509fa56eb406519.tar.bz2 |
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>
Diffstat (limited to 'hmp.c')
-rw-r--r-- | hmp.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -342,6 +342,9 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict) monitor_printf(mon, "%s: %" PRId64 "\n", MigrationParameter_str(MIGRATION_PARAMETER_X_MULTIFD_PAGE_COUNT), params->x_multifd_page_count); + monitor_printf(mon, "%s: %" PRId64 "\n", + MigrationParameter_str(MIGRATION_PARAMETER_XBZRLE_CACHE_SIZE), + params->xbzrle_cache_size); } qapi_free_MigrationParameters(params); @@ -1578,6 +1581,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict) Visitor *v = string_input_visitor_new(valuestr); MigrateSetParameters *p = g_new0(MigrateSetParameters, 1); uint64_t valuebw = 0; + uint64_t cache_size; Error *err = NULL; int val, ret; @@ -1653,6 +1657,16 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict) p->has_x_multifd_page_count = true; visit_type_int(v, param, &p->x_multifd_page_count, &err); break; + case MIGRATION_PARAMETER_XBZRLE_CACHE_SIZE: + p->has_xbzrle_cache_size = true; + visit_type_size(v, param, &cache_size, &err); + if (err || cache_size > INT64_MAX + || (size_t)cache_size != cache_size) { + error_setg(&err, "Invalid size %s", valuestr); + break; + } + p->xbzrle_cache_size = cache_size; + break; default: assert(0); } |