On 04/11/20 08:35, Markus Armbruster wrote:
+               "boolean (on/off, yes/no, true/false, y/n)");
Recommend to have the error message only mention the preferred form.  I
like the laconic "'on' or 'off'".  It's really all the user needs to
know.


I went for "boolean (on/off) value".


Avoiding the full_name() on success isn't hard:

       if (!qapi_bool_parse(name, str, obj, NULL)) {
           error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
                      full_name(qiv, name), "'on' or 'off'");
           return false;
       }
       return true;

Can't refuse.


     case QEMU_OPT_BOOL:
-        return parse_option_bool(opt->name, opt->str, &opt->value.boolean,
-                                 errp);
+        return qapi_bool_parse(opt->name, opt->str, &opt->value.boolean, errp);

Please break the line the same way as before.

Why? It's not even 80 characters.

Paolo


Reply via email to