[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 5/5] qobject: modify qobject_ref() to assert
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v5 5/5] qobject: modify qobject_ref() to assert on NULL |
Date: |
Tue, 17 Apr 2018 13:51:27 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 04/17/2018 08:36 AM, Marc-André Lureau wrote:
> While it may be convenient to accept NULL value in
> qobject_unref() (for similar reasons as free() accepts NULL), it is
> not such a good idea for qobject_ref(), assert() on NULL. One place
> relied on that behaviour (the monitor request id), and it's best to be
> explicit that NULL is accepted there.
>
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
> include/qapi/qmp/qobject.h | 7 ++++---
> monitor.c | 2 +-
> 2 files changed, 5 insertions(+), 4 deletions(-)
>
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v5 1/5] qobject: ensure base is at offset 0, (continued)
[Qemu-devel] [PATCH v5 2/5] qobject: use a QObjectBase_ struct, Marc-André Lureau, 2018/04/17
[Qemu-devel] [PATCH v5 4/5] qobject: modify qobject_ref() to return obj, Marc-André Lureau, 2018/04/17
[Qemu-devel] [PATCH v5 5/5] qobject: modify qobject_ref() to assert on NULL, Marc-André Lureau, 2018/04/17
[Qemu-devel] [PATCH v5 3/5] qobject: replace qobject_incref/QINCREF qobject_decref/QDECREF, Marc-André Lureau, 2018/04/17
Re: [Qemu-devel] [PATCH v5 0/5] Simplify qobject refcount, Markus Armbruster, 2018/04/19