[PATCH 09/12] ui/pixman: Consistent error handling in qemu_pixman_shareable_free()

Markus Armbruster posted 12 patches 4 months, 1 week ago
Maintainers: Jonathan Cameron <jonathan.cameron@huawei.com>, Fan Ni <fan.ni@samsung.com>, "Michael S. Tsirkin" <mst@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Dmitry Osipenko <dmitry.osipenko@collabora.com>, Jason Wang <jasowang@redhat.com>, Elena Ufimtseva <elena.ufimtseva@oracle.com>, Jagannathan Raman <jag.raman@oracle.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>, Steve Sistare <steven.sistare@oracle.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, "Dr. David Alan Gilbert" <dave@treblig.org>, Samuel Thibault <samuel.thibault@ens-lyon.org>, Richard Henderson <richard.henderson@linaro.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Stefan Weil <sw@weilnetz.de>
There is a newer version of this series
[PATCH 09/12] ui/pixman: Consistent error handling in qemu_pixman_shareable_free()
Posted by Markus Armbruster 4 months, 1 week ago
qemu_pixman_shareable_free() wraps around either qemu_memfd_free() or
qemu_win32_map_free().  The former reports trouble as error, with
error_report(), then succeeds.  The latter reports it as warning (we
pass it &error_warn), then succeeds.

Change the latter to report as error, too.

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 ui/qemu-pixman.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c
index ef4e71da11..e46c6232cf 100644
--- a/ui/qemu-pixman.c
+++ b/ui/qemu-pixman.c
@@ -288,7 +288,10 @@ qemu_pixman_shareable_free(qemu_pixman_shareable handle,
                            void *ptr, size_t size)
 {
 #ifdef WIN32
-    qemu_win32_map_free(ptr, handle, &error_warn);
+    Error *err = NULL;
+
+    qemu_win32_map_free(ptr, handle, &err);
+    error_report_err(err);
 #else
     qemu_memfd_free(ptr, size, handle);
 #endif
-- 
2.49.0


Re: [PATCH 09/12] ui/pixman: Consistent error handling in qemu_pixman_shareable_free()
Posted by Marc-André Lureau 4 months, 1 week ago
Hi

On Fri, Aug 8, 2025 at 12:08 PM Markus Armbruster <armbru@redhat.com> wrote:

> qemu_pixman_shareable_free() wraps around either qemu_memfd_free() or
> qemu_win32_map_free().  The former reports trouble as error, with
> error_report(), then succeeds.  The latter reports it as warning (we
> pass it &error_warn), then succeeds.
>
> Change the latter to report as error, too.
>
> Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>

lgtm, thanks

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>



> ---
>  ui/qemu-pixman.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c
> index ef4e71da11..e46c6232cf 100644
> --- a/ui/qemu-pixman.c
> +++ b/ui/qemu-pixman.c
> @@ -288,7 +288,10 @@ qemu_pixman_shareable_free(qemu_pixman_shareable
> handle,
>                             void *ptr, size_t size)
>  {
>  #ifdef WIN32
> -    qemu_win32_map_free(ptr, handle, &error_warn);
> +    Error *err = NULL;
> +
> +    qemu_win32_map_free(ptr, handle, &err);
> +    error_report_err(err);
>  #else
>      qemu_memfd_free(ptr, size, handle);
>  #endif
> --
> 2.49.0
>
>