From: Zhao Liu Date: Mon, 11 Mar 2024 03:37:54 +0000 (+0800) Subject: error: Add error_vprepend() in comment of ERRP_GUARD() rules X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=042e4942b926eb067cbc040d7c7fa87a7ebc0917;p=qemu.git error: Add error_vprepend() in comment of ERRP_GUARD() rules The error_vprepend() should use ERRP_GUARD() just as the documentation of ERRP_GUARD() says: > It must be used when the function dereferences @errp or passes > @errp to error_prepend(), error_vprepend(), or error_append_hint(). Considering that error_vprepend() is also an API provided in error.h, it is necessary to add it to the description of the rules for using ERRP_GUARD(). Cc: Markus Armbruster Cc: Michael Roth Signed-off-by: Zhao Liu Reviewed-by: Markus Armbruster Message-ID: <20240311033822.3142585-2-zhao1.liu@linux.intel.com> Signed-off-by: Thomas Huth --- diff --git a/include/qapi/error.h b/include/qapi/error.h index f21a231bb1..71f8fb2c50 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -207,7 +207,7 @@ * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. - * - It should not be passed to error_prepend() or + * - It should not be passed to error_prepend(), error_vprepend(), or * error_append_hint(), because that doesn't work with &error_fatal. * ERRP_GUARD() lifts these restrictions. *