]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Use 'virshCompletePathLocalExisting' for options reading local files
authorPeter Krempa <pkrempa@redhat.com>
Wed, 15 Sep 2021 15:26:35 +0000 (17:26 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 17 Sep 2021 07:40:46 +0000 (09:40 +0200)
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tools/virsh-backup.c
tools/virsh-checkpoint.c
tools/virsh-domain.c
tools/virsh-network.c
tools/virsh-pool.c
tools/virsh-secret.c
tools/virsh-snapshot.c

index 9125b7da97b8ba3c57aa2ecfb87137ca00fbdaee..7bac1923a63acbe76d9ae53e6d3adb48a3fc3c6e 100644 (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",
index 1f3a318014a7f73d18069b0bc080c93f6fa54f30..78272b43c4b7cfe42c348c36609699cc514427b1 100644 (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",
index ac57595e76302f51e93f26e3b1f87a3b4789c3f7..d23a30949887c6dd739b153dfed2d4cf1b9dfe75 100644 (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",
index 37c19b663b57a5119992be87ce9cc371ea255dfa..86512659093596ba2f16ac5b68c2e529be43003d 100644 (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")
     },
index cbbbe5c4b910d33af5f7852b89779baf5a152aa2..9ad7cbe4666c228538f29b7cda6d84582bbd5053 100644 (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}
index 173a77fd90485a7dcc37df348163bc5b3796d7f5..d23cbf04bf16f2c7418c5f5d47bc708c69ffb911 100644 (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",
index 60a68b334b77b4f8b42cbbca5fdc211980052f1d..5a3c468c533360b85d2bfd134932e15fd887327e 100644 (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",