virsh: report errors for empty strings

Several callers were using vshCommandOptString without setting an error.
Use vshCommandOptStringReq which sets the error.

https://bugzilla.redhat.com/show_bug.cgi?id=1281707
This commit is contained in:
Ján Tomko
2015-12-03 13:42:35 +01:00
parent 1e6d87bdfc
commit 45138725cf
3 changed files with 9 additions and 9 deletions

View File

@@ -2243,9 +2243,9 @@ cmdDomIfAddr(vshControl *ctl, const vshCmd *cmd)
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
if (vshCommandOptString(ctl, cmd, "interface", &ifacestr) < 0)
if (vshCommandOptStringReq(ctl, cmd, "interface", &ifacestr) < 0)
goto cleanup;
if (vshCommandOptString(ctl, cmd, "source", &sourcestr) < 0)
if (vshCommandOptStringReq(ctl, cmd, "source", &sourcestr) < 0)
goto cleanup;
if (sourcestr) {