[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 :)
- [PATCH-for-5.2 1/5] hw/core/qdev-properties: Simplify get_reserved_region(), (continued)
- [RFC PATCH-for-5.2 2/5] qom: Split ObjectPropertyAccessor as ObjectProperty[Get/Set], Philippe Mathieu-Daudé, 2020/07/15
- [PATCH-for-5.2 3/5] qom: Use g_autofree in ObjectPropertyGet functions, Philippe Mathieu-Daudé, 2020/07/15
- [RFC PATCH-for-5.2 5/5] hw/virtio: Simplify virtio_mem_set_requested_size(), Philippe Mathieu-Daudé, 2020/07/15
- [RFC PATCH-for-5.2 4/5] qom: Let ObjectPropertyGet functions return a boolean value, Philippe Mathieu-Daudé, 2020/07/15
- Re: [RFC PATCH-for-5.2 0/5] qom: Let ObjectPropertyGet functions return a boolean value,
Markus Armbruster <=