virsh: Use 'virshCompletePathLocalExisting' for options reading local files

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2021-09-15 17:26:35 +02:00
parent 16252b16b7
commit 2732d81984
7 changed files with 17 additions and 0 deletions

View File

@ -39,10 +39,12 @@ static const vshCmdOptDef opts_backup_begin[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE),
{.name = "backupxml",
.type = VSH_OT_STRING,
.completer = virshCompletePathLocalExisting,
.help = N_("domain backup XML"),
},
{.name = "checkpointxml",
.type = VSH_OT_STRING,
.completer = virshCompletePathLocalExisting,
.help = N_("domain checkpoint XML"),
},
{.name = "reuse-external",

View File

@ -88,6 +88,7 @@ static const vshCmdOptDef opts_checkpoint_create[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE),
{.name = "xmlfile",
.type = VSH_OT_STRING,
.completer = virshCompletePathLocalExisting,
.help = N_("domain checkpoint XML")
},
{.name = "redefine",

View File

@ -2243,6 +2243,7 @@ static const vshCmdOptDef opts_blockcopy[] = {
},
{.name = "xml",
.type = VSH_OT_STRING,
.completer = virshCompletePathLocalExisting,
.help = N_("filename containing XML description of the copy destination")
},
{.name = "format",
@ -4140,6 +4141,7 @@ static const vshCmdOptDef opts_save[] = {
},
{.name = "xml",
.type = VSH_OT_STRING,
.completer = virshCompletePathLocalExisting,
.help = N_("filename containing updated XML for the target")
},
{.name = "running",
@ -4534,6 +4536,7 @@ static const vshCmdOptDef opts_save_image_define[] = {
{.name = "xml",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.completer = virshCompletePathLocalExisting,
.help = N_("filename containing updated XML for the target")
},
{.name = "running",
@ -4947,6 +4950,7 @@ static const vshCmdOptDef opts_managed_save_define[] = {
{.name = "xml",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.completer = virshCompletePathLocalExisting,
.help = N_("filename containing updated XML for the target")
},
{.name = "running",
@ -5249,6 +5253,7 @@ static const vshCmdOptDef opts_restore[] = {
},
{.name = "xml",
.type = VSH_OT_STRING,
.completer = virshCompletePathLocalExisting,
.help = N_("filename containing updated XML for the target")
},
{.name = "running",
@ -10008,6 +10013,7 @@ static const vshCmdOptDef opts_domxmlfromnative[] = {
{.name = "config",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.completer = virshCompletePathLocalExisting,
.help = N_("config data file to import from")
},
{.name = NULL}
@ -10063,6 +10069,7 @@ static const vshCmdOptDef opts_domxmltonative[] = {
VIRSH_COMMON_OPT_DOMAIN_OT_STRING_FULL(VSH_OFLAG_REQ_OPT, 0),
{.name = "xml",
.type = VSH_OT_STRING,
.completer = virshCompletePathLocalExisting,
.help = N_("xml data file to export from")
},
{.name = NULL}
@ -10393,6 +10400,7 @@ static const vshCmdOptDef opts_migrate[] = {
},
{.name = "xml",
.type = VSH_OT_STRING,
.completer = virshCompletePathLocalExisting,
.help = N_("filename containing updated XML for the target")
},
{.name = "migrate-disks",
@ -10439,6 +10447,7 @@ static const vshCmdOptDef opts_migrate[] = {
},
{.name = "persistent-xml",
.type = VSH_OT_STRING,
.completer = virshCompletePathLocalExisting,
.help = N_("filename containing updated persistent XML for the target")
},
{.name = "tls",
@ -13974,6 +13983,7 @@ static const vshCmdOptDef opts_set_user_sshkeys[] = {
},
{.name = "file",
.type = VSH_OT_STRING,
.completer = virshCompletePathLocalExisting,
.help = N_("optional file to read keys from"),
},
{.name = "reset",

View File

@ -948,6 +948,7 @@ static const vshCmdOptDef opts_network_update[] = {
{.name = "xml",
.type = VSH_OT_DATA,
.flags = VSH_OFLAG_REQ,
.completer = virshCompletePathLocalExisting,
.help = N_("name of file containing xml (or, if it starts with '<', the complete "
"xml element itself) to add/modify, or to be matched for search")
},

View File

@ -1501,6 +1501,7 @@ static const vshCmdOptDef opts_find_storage_pool_sources[] = {
},
{.name = "srcSpec",
.type = VSH_OT_STRING,
.completer = virshCompletePathLocalExisting,
.help = N_("optional file of source xml to query for pools")
},
{.name = NULL}

View File

@ -186,6 +186,7 @@ static const vshCmdOptDef opts_secret_set_value[] = {
{.name = "file",
.type = VSH_OT_STRING,
.flags = VSH_OFLAG_REQ_OPT,
.completer = virshCompletePathLocalExisting,
.help = N_("read secret from file"),
},
{.name = "plain",

View File

@ -115,6 +115,7 @@ static const vshCmdOptDef opts_snapshot_create[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(0),
{.name = "xmlfile",
.type = VSH_OT_STRING,
.completer = virshCompletePathLocalExisting,
.help = N_("domain snapshot XML")
},
{.name = "redefine",