qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH-for-5.2 0/5] qom: Let ObjectPropertyGet functions return


From: Markus Armbruster
Subject: Re: [RFC PATCH-for-5.2 0/5] qom: Let ObjectPropertyGet functions return a boolean value
Date: Thu, 16 Jul 2020 10:25:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> RFC series to follow Markus direction to simplify error
> propagation. Not sure it is worth it yet. It starts to
> be interesting when using the QEMU_WARN_UNUSED_RESULT
> attribute in the visitors, such:
>
> -- >8 --
> @@ -525,6 +533,7 @@ bool visit_type_uint8(Visitor *v, const char *name, 
> uint8_t *obj,
>   * Visit a uint16_t value.
>   * Like visit_type_int(), except clamps the value to uint16_t range.
>   */
> +QEMU_WARN_UNUSED_RESULT
>  bool visit_type_uint16(Visitor *v, const char *name, uint16_t *obj,
>                         Error **errp);

QEMU_WARN_UNUSED_RESULT is problematic with functions taking an Error **
argument, because using &error_abort or &error_fatal the intended way
triggers the warning.

Does that make &error_abort and &error_fatal bad ideas?  They do help
keeping the code concise in places...  Hundreds of places, according to
git-grep.

> ---
>
> But to get there we need to update the QAPI generators first :)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]