From 50e9a629c6c92e73260cd3d7c2e3f5bfd84e47e2 Mon Sep 17 00:00:00 2001 From: Liang Li Date: Mon, 23 Mar 2015 16:32:29 +0800 Subject: migration: Add hmp interface to set and query parameters Add the hmp interface to tune and query the parameters used in live migration. Signed-off-by: Liang Li Signed-off-by: Yang Zhang Signed-off-by: Juan Quintela --- monitor.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'monitor.c') diff --git a/monitor.c b/monitor.c index d831d984d8..3952d646cd 100644 --- a/monitor.c +++ b/monitor.c @@ -2858,6 +2858,13 @@ static mon_cmd_t info_cmds[] = { .help = "show current migration capabilities", .mhandler.cmd = hmp_info_migrate_capabilities, }, + { + .name = "migrate_parameters", + .args_type = "", + .params = "", + .help = "show current migration parameters", + .mhandler.cmd = hmp_info_migrate_parameters, + }, { .name = "migrate_cache_size", .args_type = "", @@ -4540,6 +4547,24 @@ void migrate_set_capability_completion(ReadLineState *rs, int nb_args, } } +void migrate_set_parameter_completion(ReadLineState *rs, int nb_args, + const char *str) +{ + size_t len; + + len = strlen(str); + readline_set_completion_index(rs, len); + if (nb_args == 2) { + int i; + for (i = 0; i < MIGRATION_PARAMETER_MAX; i++) { + const char *name = MigrationParameter_lookup[i]; + if (!strncmp(str, name, len)) { + readline_add_completion(rs, name); + } + } + } +} + void host_net_add_completion(ReadLineState *rs, int nb_args, const char *str) { int i; -- cgit 1.4.1