From 9e1ba4cc4e2536d9650e84e2614c5691ed45938f Mon Sep 17 00:00:00 2001 From: Orit Wasserman Date: Mon, 6 Aug 2012 21:42:54 +0300 Subject: Add migrate_set_cache_size command Change XBZRLE cache size in bytes (the size should be a power of 2, it will be rounded down to the nearest power of 2). If XBZRLE cache size is too small there will be many cache miss. New query-migrate-cache-size QMP command and 'info migrate_cache_size' HMP command to query cache value. Signed-off-by: Benoit Hudzia Signed-off-by: Petter Svard Signed-off-by: Aidan Shribman Signed-off-by: Orit Wasserman Reviewed-by: Luiz Capitulino Reviewed-by: Eric Blake --- hmp.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'hmp.c') diff --git a/hmp.c b/hmp.c index 2a03b446a1..8abb4bddb3 100644 --- a/hmp.c +++ b/hmp.c @@ -194,6 +194,12 @@ void hmp_info_migrate_capabilities(Monitor *mon) qapi_free_MigrationCapabilityStatusList(caps); } +void hmp_info_migrate_cache_size(Monitor *mon) +{ + monitor_printf(mon, "xbzrel cache size: %" PRId64 " kbytes\n", + qmp_query_migrate_cache_size(NULL) >> 10); +} + void hmp_info_cpus(Monitor *mon) { CpuInfoList *cpu_list, *cpu; @@ -764,6 +770,19 @@ void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict) qmp_migrate_set_downtime(value, NULL); } +void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict) +{ + int64_t value = qdict_get_int(qdict, "value"); + Error *err = NULL; + + qmp_migrate_set_cache_size(value, &err); + if (err) { + monitor_printf(mon, "%s\n", error_get_pretty(err)); + error_free(err); + return; + } +} + void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict) { int64_t value = qdict_get_int(qdict, "value"); -- cgit v1.2.1