Re: [PATCH 10/14] virsh: Expand VIRSH_COMMON_OPT_FILE for cases when it's not a local file used by virsh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/16/21 7:10 PM, Peter Krempa wrote:
> In cases such as the APIs for managed save management, the file path
> provided via the '--file' option is passed to the API.
> 
> We'll need to make them distinct from cases for when virsh is using the
> file so that different completers can be used.
> 
> Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
> ---
>  tools/virsh-domain.c | 36 ++++++++++++++++++++++++++++++------
>  tools/virsh-volume.c |  6 +++++-
>  tools/virsh.h        |  1 +
>  3 files changed, 36 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index 05fa5c07f6..f45ab5b9d1 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -4129,7 +4129,11 @@ static const vshCmdInfo info_save[] = {
> 
>  static const vshCmdOptDef opts_save[] = {
>      VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE),
> -    VIRSH_COMMON_OPT_FILE(N_("where to save the data")),
> +    {.name = "file",
> +     .type = VSH_OT_DATA,
> +     .flags = VSH_OFLAG_REQ,
> +     .help = N_("where to save the data")
> +    },
>      {.name = "bypass-cache",
>       .type = VSH_OT_BOOL,
>       .help = N_("avoid file system cache when saving")

Maybe have new macro VIRSH_COMMON_OPT_FILE_REMOTE? If we ever come with
a completer for remote paths we have just one place to put .completer = XXX?

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux