[PATCH 2/4] virsh: Provide local path completer for vol-download --file

Michal Privoznik mprivozn at redhat.com
Fri Sep 17 08:13:08 UTC 2021


The vol-download command takes mandatory --file argument which
points to a local (possibly non-existent) path. If the file
exists then it's overwritten. Set the argument's completer so
that self-test doesn't report it as missing.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 tools/virsh-volume.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c
index 103a9b9237..152f5b0dbe 100644
--- a/tools/virsh-volume.c
+++ b/tools/virsh-volume.c
@@ -779,11 +779,7 @@ static const vshCmdInfo info_vol_download[] = {
 
 static const vshCmdOptDef opts_vol_download[] = {
     VIRSH_COMMON_OPT_VOL_FULL,
-    {.name = "file",
-     .type = VSH_OT_DATA,
-     .flags = VSH_OFLAG_REQ,
-     .help = N_("file")
-    },
+    VIRSH_COMMON_OPT_FILE(N_("file")),
     VIRSH_COMMON_OPT_POOL_OPTIONAL,
     {.name = "offset",
      .type = VSH_OT_INT,
-- 
2.32.0




More information about the libvir-list mailing list