virsh: Add comp-methods completion to migrate command

Signed-off-by: Lin Ma <lma@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Lin Ma 2021-06-15 08:38:21 +08:00 committed by Michal Privoznik
parent f14ca48ef4
commit a61a6978d3
3 changed files with 23 additions and 0 deletions

View File

@ -959,3 +959,20 @@ virshDomainCoreDumpFormatCompleter(vshControl *ctl G_GNUC_UNUSED,
return ret;
}
char **
virshDomainMigrateCompMethodsCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags)
{
const char *methods[] = {"xbzrle", "mt", NULL};
const char *method = NULL;
virCheckFlags(0, NULL);
if (vshCommandOptStringQuiet(ctl, cmd, "comp-methods", &method) < 0)
return NULL;
return virshCommaStringListComplete(method, methods);
}

View File

@ -127,3 +127,8 @@ char **
virshDomainCoreDumpFormatCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags);
char **
virshDomainMigrateCompMethodsCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags);

View File

@ -10619,6 +10619,7 @@ static const vshCmdOptDef opts_migrate[] = {
},
{.name = "comp-methods",
.type = VSH_OT_STRING,
.completer = virshDomainMigrateCompMethodsCompleter,
.help = N_("comma separated list of compression methods to be used")
},
{.name = "comp-mt-level",