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

Re: [Xen-devel] [PATCH v5 22/24] libxlu: introduce new APIs

Wei Liu writes ("[PATCH v5 22/24] libxlu: introduce new APIs"):
> These APIs can be used to manipulate XLU_ConfigValue and XLU_ConfigList.
> +    if (value->type != XLU_STRING) {
> +        if (!dont_warn)
> +            fprintf(cfg->report, "warning: value is not a string\n");
> +        *value_r = NULL;
> +        return EINVAL;

This message needs to include the file and line number, or it is very
hard for the user to use.  The other call sites (which are based on
`find') require the caller to provide a name, which means that the
setting name can be printed too.  Maybe you could do something

If you were feeling keen you could replace these formulaic things with
something like:
   return report_bad_cfg(dont_warn, cfg, set, n, "value is not a string");
   return REPORT_BAD_CFG("value is not a string");
(being a function or macro which always returns EINVAL), or some such.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.