On 20.10.25 14:22, Vladimir Sementsov-Ogievskiy wrote:
diff --git a/include/qapi/error.h b/include/qapi/error.h index d798faeec3..1c2484187f 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -43,8 +43,7 @@ * avoid useless error object creation and destruction. Note that * we still have many functions returning void. We recommend * • bool-valued functions return true on success / false on failure, - * • pointer-valued functions return non-null / null pointer, and - * • integer-valued functions return non-negative / negative. + * • pointer-valued functions return non-null / null pointer. * * = Creating errors = *
Still, we have functions that may return positive numbers, like numbers of bytes read. So integer return value makes sense, and removing this recommendation for integer-valued functions is wrong. May be adding some additional advice like: Don't blindly passthorough the -errno together with errp, if you don't sure it is reasonably used. Prefer boolean for functions which doesn't need to return some positive integer on success. Prefer the only -1 error value for integer-valued functions, if you don't need more different errors. -- Best regards, Vladimir
