mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
virsh: Add format completion to blockcopy command
Signed-off-by: Lin Ma <lma@suse.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
8de9a54b9e
commit
8cdbca6213
@ -35,6 +35,7 @@
|
||||
#include "virkeynametable_linux.h"
|
||||
#include "virkeynametable_osx.h"
|
||||
#include "virkeynametable_win32.h"
|
||||
#include "conf/storage_conf.h"
|
||||
|
||||
char **
|
||||
virshDomainNameCompleter(vshControl *ctl,
|
||||
@ -976,3 +977,22 @@ virshDomainMigrateCompMethodsCompleter(vshControl *ctl,
|
||||
|
||||
return virshCommaStringListComplete(method, methods);
|
||||
}
|
||||
|
||||
|
||||
char **
|
||||
virshDomainStorageFileFormatCompleter(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_STORAGE_FILE_LAST + 1);
|
||||
|
||||
for (i = 0; i < VIR_STORAGE_FILE_LAST; i++)
|
||||
ret[i] = g_strdup(virStorageFileFormatTypeToString(i));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -132,3 +132,9 @@ char **
|
||||
virshDomainMigrateCompMethodsCompleter(vshControl *ctl,
|
||||
const vshCmd *cmd,
|
||||
unsigned int flags);
|
||||
|
||||
|
||||
char **
|
||||
virshDomainStorageFileFormatCompleter(vshControl *ctl,
|
||||
const vshCmd *cmd,
|
||||
unsigned int flags);
|
||||
|
@ -2236,6 +2236,8 @@ static const vshCmdOptDef opts_blockcopy[] = {
|
||||
},
|
||||
{.name = "format",
|
||||
.type = VSH_OT_STRING,
|
||||
.flags = VSH_OFLAG_NONE,
|
||||
.completer = virshDomainStorageFileFormatCompleter,
|
||||
.help = N_("format of the destination file")
|
||||
},
|
||||
{.name = "granularity",
|
||||
|
Loading…
Reference in New Issue
Block a user