]> git.ipfire.org Git - thirdparty/libvirt.git/commit
vshCommandOpt: Do more checking if skipChecks is set
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 28 Feb 2018 09:09:56 +0000 (10:09 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 28 Feb 2018 09:36:24 +0000 (10:36 +0100)
commit846d3b5874be9f5b808f8bf5ce2e1f07fe1293f0
treed6e4ffb8db0037fa86ffbc6d8215f0df3fcb397f
parent98c9c3048d88acd81748466f7970e897ccbe81f1
vshCommandOpt: Do more checking if skipChecks is set

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@redhat.com>
tools/vsh.c