mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
virsh: Add coredump format completion to dump command
Signed-off-by: Lin Ma <lma@suse.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
84cc4543be
commit
564512e916
@ -940,3 +940,22 @@ virshDomainFSMountpointsCompleter(vshControl *ctl,
|
||||
virshDomainFree(dom);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
char **
|
||||
virshDomainCoreDumpFormatCompleter(vshControl *ctl G_GNUC_UNUSED,
|
||||
const vshCmd *cmd G_GNUC_UNUSED,
|
||||
unsigned int flags)
|
||||
{
|
||||
char **ret = NULL;
|
||||
size_t i;
|
||||
|
||||
virCheckFlags(0, NULL);
|
||||
|
||||
ret = g_new0(char *, VIR_DOMAIN_CORE_DUMP_FORMAT_LAST + 1);
|
||||
|
||||
for (i = 0; i < VIR_DOMAIN_CORE_DUMP_FORMAT_LAST; i++)
|
||||
ret[i] = g_strdup(virDomainCoreDumpFormatTypeToString(i));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -122,3 +122,8 @@ char ** virshKeycodeNameCompleter(vshControl *ctl,
|
||||
char ** virshDomainFSMountpointsCompleter(vshControl *ctl,
|
||||
const vshCmd *cmd,
|
||||
unsigned int flags);
|
||||
|
||||
char **
|
||||
virshDomainCoreDumpFormatCompleter(vshControl *ctl,
|
||||
const vshCmd *cmd,
|
||||
unsigned int flags);
|
||||
|
@ -5405,6 +5405,8 @@ static const vshCmdOptDef opts_dump[] = {
|
||||
},
|
||||
{.name = "format",
|
||||
.type = VSH_OT_STRING,
|
||||
.flags = VSH_OFLAG_NONE,
|
||||
.completer = virshDomainCoreDumpFormatCompleter,
|
||||
.help = N_("specify the format of memory-only dump")
|
||||
},
|
||||
{.name = NULL}
|
||||
|
Loading…
x
Reference in New Issue
Block a user