Re: [PATCH 1/3] vsh: Make self-test more robust

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

 



On Thu, Nov 16, 2017 at 02:49:27PM +0100, Michal Privoznik wrote:
> There are couple of limitations when it comes to option types and
> flags for the options. For instance, VSH_OT_STRING cannot have
> VSH_OFLAG_REQ set (commit c7543a728). For some reason this is
> checked in vshCmddefHelp() but not in vshCmddefCheckInternals().
>
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---

[...]

> -        if (opt->type == VSH_OT_ARGV && cmd->opts[i + 1].name)
> -            return -1; /* argv option must be listed last */
> +            break;
> +        case VSH_OT_ARGV:
> +            if (cmd->opts[i + 1].name)
> +                return -1; /* argv option must be listed last */
> +            break;
> +
> +        case VSH_OT_DATA:
> +            if (!(opt->flags & VSH_OFLAG_REQ))
> +                return -1; /* OT_DATA should always be required. */

This got me thinking a bit, since we're going to do the checking here, is there
a need for performing the same check within vshCmddefHelp too? My reasoning is
that virsh-self-test is part of the test suite run at make check. Not a deal
breaker though, just thinking out loud.

> +            break;
> +
> +        case VSH_OT_INT:
> +            /* nada */

please don't...

> +            break;
> +        }

Reviewed-by: Erik Skultety <eskultet@xxxxxxxxxx>

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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