[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 1/5] qobject: ensure base is at offset 0
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v6 1/5] qobject: ensure base is at offset 0 |
Date: |
Thu, 19 Apr 2018 10:20:03 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 04/19/2018 10:01 AM, Marc-André Lureau wrote:
> All QObject types have the base QObject as their first field. This
> allows the simplification of qobject_to().
>
> This explicitly guarantees that existing casts work correctly (even
> though we'd prefer to get rid of such casts in any location except the
> qobject.h macros)
>
> Signed-off-by: Marc-André Lureau <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
My R-b stands that this is correct from a coding point of view. But if
I read Markus' review correctly, we could omit this patch, fix the one
broken client in tests/check-qdict.c to use qobject_to() (why didn't you
fix that in v6)?, and then just apply patches 2-5 without this patch,
with no change in behavior and where we are no longer dependent on using
offset 0 (even though all current instances do). So, I'll leave that to
maintainer discretion.
--
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 v6 1/5] qobject: ensure base is at offset 0, Markus Armbruster, 2018/04/27
[Qemu-devel] [PATCH v6 2/5] qobject: use a QObjectBase_ struct, Marc-André Lureau, 2018/04/19
[Qemu-devel] [PATCH v6 5/5] qobject: modify qobject_ref() to assert on NULL, Marc-André Lureau, 2018/04/19