mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virsh: Add signal name completion to send-process-signal 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
7a975279b1
commit
96d01ce969
@ -715,3 +715,24 @@ virshDomainConsoleCompleter(vshControl *ctl,
|
|||||||
|
|
||||||
return g_steal_pointer(&tmp);
|
return g_steal_pointer(&tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char **
|
||||||
|
virshDomainSignalCompleter(vshControl *ctl G_GNUC_UNUSED,
|
||||||
|
const vshCmd *cmd G_GNUC_UNUSED,
|
||||||
|
unsigned int flags)
|
||||||
|
{
|
||||||
|
VIR_AUTOSTRINGLIST tmp = NULL;
|
||||||
|
size_t i = 0;
|
||||||
|
|
||||||
|
virCheckFlags(0, NULL);
|
||||||
|
|
||||||
|
tmp = g_new0(char *, VIR_DOMAIN_PROCESS_SIGNAL_LAST + 1);
|
||||||
|
|
||||||
|
for (i = 0; i < VIR_DOMAIN_PROCESS_SIGNAL_LAST; i++) {
|
||||||
|
const char *name = virDomainProcessSignalTypeToString(i);
|
||||||
|
tmp[i] = g_strdup(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return g_steal_pointer(&tmp);
|
||||||
|
}
|
||||||
|
@ -98,3 +98,7 @@ char ** virshDomainVcpulistViaAgentCompleter(vshControl *ctl,
|
|||||||
char ** virshDomainConsoleCompleter(vshControl *ctl,
|
char ** virshDomainConsoleCompleter(vshControl *ctl,
|
||||||
const vshCmd *cmd,
|
const vshCmd *cmd,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
|
char ** virshDomainSignalCompleter(vshControl *ctl,
|
||||||
|
const vshCmd *cmd,
|
||||||
|
unsigned int flags);
|
||||||
|
@ -8905,6 +8905,7 @@ static const vshCmdOptDef opts_send_process_signal[] = {
|
|||||||
{.name = "signame",
|
{.name = "signame",
|
||||||
.type = VSH_OT_DATA,
|
.type = VSH_OT_DATA,
|
||||||
.flags = VSH_OFLAG_REQ,
|
.flags = VSH_OFLAG_REQ,
|
||||||
|
.completer = virshDomainSignalCompleter,
|
||||||
.help = N_("the signal number or name")
|
.help = N_("the signal number or name")
|
||||||
},
|
},
|
||||||
{.name = NULL}
|
{.name = NULL}
|
||||||
|
Loading…
Reference in New Issue
Block a user