[libvirt] [PATCH] vshCommandOpt: Do more checking if skipChecks is set

Martin Kletzander mkletzan at redhat.com
Wed Feb 28 14:35:55 UTC 2018


On Wed, Feb 28, 2018 at 10:20:51AM +0100, Michal Privoznik wrote:
>Currently if cmd->skipChecks is set (done only from completers)
>some basic checks are skipped because we're working over
>partially parsed command. See a26ff63ae4 for more detailed
>explanation. Anyway, the referenced commit was too aggressive in
>disabling checks and effectively returned success even in clear
>case of failure. For instance:
>
>  # domif-getlink --interface <TAB><TAB>
>
>causes virshDomainInterfaceCompleter() to be called, which calls
>virshDomainGetXML() which eventually calls
>vshCommandOptStringReq(.., name = "domain"); The --domain
>argument is required for the command and if not present -1 should
>be returned to tell the caller the argument was not found. Well,
>zero is returned meaning the argument was not found but it's not
>required either.
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> tools/vsh.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>

ACK, SFF.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180228/f8685e35/attachment-0001.sig>


More information about the libvir-list mailing list