aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorHani Benhabiles <kroosec@gmail.com>2014-05-27 23:39:32 +0100
committerLuiz Capitulino <lcapitulino@redhat.com>2014-06-11 10:10:29 -0400
commitc68a0409b388c30c7f4ee8be44081c143f280279 (patch)
tree3075c0eeea8ba3ef1e2b2052ff607ad7c7fe6363 /monitor.c
parentd0ece345cbe3a58a9952f0f539641009bfd7ddf9 (diff)
monitor: Add migrate_set_capability completion
Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index 68d74cd351..709425ddb0 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4573,6 +4573,27 @@ void watchdog_action_completion(ReadLineState *rs, int nb_args, const char *str)
add_completion_option(rs, str, "none");
}
+void migrate_set_capability_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_CAPABILITY_MAX; i++) {
+ const char *name = MigrationCapability_lookup[i];
+ if (!strncmp(str, name, len)) {
+ readline_add_completion(rs, name);
+ }
+ }
+ } else if (nb_args == 3) {
+ add_completion_option(rs, str, "on");
+ add_completion_option(rs, str, "off");
+ }
+}
+
static void monitor_find_completion_by_table(Monitor *mon,
const mon_cmd_t *cmd_table,
char **args,