Failing to print the table is also a reason to return failure
and print the reported error.
Switch to the usual pattern where we fall through the cleanup
label right after setting ret to true instead of infering the
return value from the number of filesystems returned.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
virDomainFSInfoPtr *info = NULL;
vshTablePtr table = NULL;
size_t ninfos = 0;
+ bool ret = false;
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
ninfos = rc;
if (ninfos == 0) {
+ ret = true;
vshError(ctl, _("No filesystems are mounted in the domain"));
goto cleanup;
}
vshTablePrintToStdout(table, ctl);
}
+ ret = true;
+
cleanup:
if (info) {
for (i = 0; i < ninfos; i++)
}
vshTableFree(table);
virshDomainFree(dom);
- return rc >= 0;
+ return ret;
}
const vshCmdDef domManagementCmds[] = {