[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 20/26] qapi: Make output visitor return qnull
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v7 20/26] qapi: Make output visitor return qnull() instead of NULL |
Date: |
Mon, 14 Sep 2015 13:07:02 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
On 09/14/2015 11:57 AM, Markus Armbruster wrote:
> Before commit 1d10b44, it crashed. Since then, it returns NULL, with
> a FIXME comment. The FIXME is valid: code that assumes QObject *
> can't be null exists. I'm not aware of a way to feed this problematic
> return value to code that actually chokes on null in the current code,
> but the next few commits will create one, failing "make check".
>
> Commit 481b002 solved a very similar problem by introducing a special
> null QObject. Using this special null QObject is clearly the right
> way to resolve this FIXME, so do that, and update the test
> accordingly.
>
> However, the patch isn't quite right: it messes up the reference
> counting. After about SIZE_MAX visits, the reference counter
> overflows, failing the assertion in qnull_destroy_obj(). Because
> that's many orders of magnitude more visits of nulls than we expect,
> we take this patch despite its flaws, to get the QMP introspection
> stuff in without further delay.
>
> Naturally, we'll have to fix it for real before the release.
>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> qapi/qmp-output-visitor.c | 8 ++++++--
> tests/test-qmp-output-visitor.c | 3 ++-
> 2 files changed, 8 insertions(+), 3 deletions(-)
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v7 02/26] qapi: New QAPISchema intermediate reperesentation, (continued)
- [Qemu-devel] [PATCH v7 02/26] qapi: New QAPISchema intermediate reperesentation, Markus Armbruster, 2015/09/14
- [Qemu-devel] [PATCH v7 09/26] qapi: De-duplicate enum code generation, Markus Armbruster, 2015/09/14
- [Qemu-devel] [PATCH v7 08/26] qapi-commands: Convert to QAPISchemaVisitor, Markus Armbruster, 2015/09/14
- [Qemu-devel] [PATCH v7 12/26] qapi: Replace dirty is_c_ptr() by method c_null(), Markus Armbruster, 2015/09/14
- [Qemu-devel] [PATCH v7 11/26] qapi-event: Convert to QAPISchemaVisitor, fixing data with base, Markus Armbruster, 2015/09/14
- [Qemu-devel] [PATCH v7 19/26] qapi: Improve built-in type documentation, Markus Armbruster, 2015/09/14
- [Qemu-devel] [PATCH v7 20/26] qapi: Make output visitor return qnull() instead of NULL, Markus Armbruster, 2015/09/14
- [Qemu-devel] [PATCH v7 23/26] qapi-schema: Fix up misleading specification of netdev_add, Markus Armbruster, 2015/09/14
- [Qemu-devel] [PATCH v7 17/26] qapi: De-duplicate parameter list generation, Markus Armbruster, 2015/09/14
- [Qemu-devel] [PATCH v7 05/26] tests/qapi-schema: Convert test harness to QAPISchemaVisitor, Markus Armbruster, 2015/09/14
- [Qemu-devel] [PATCH v7 10/26] qapi-event: Eliminate global variable event_enum_value, Markus Armbruster, 2015/09/14