[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 04/10] include/qom/object.h: New OBJECT_DEFINE_SIMPLE_TYPE{,
From: |
Zhao Liu |
Subject: |
Re: [PATCH 04/10] include/qom/object.h: New OBJECT_DEFINE_SIMPLE_TYPE{, _WITH_INTERFACES} macros |
Date: |
Mon, 26 Feb 2024 22:33:34 +0800 |
On Tue, Feb 20, 2024 at 04:06:16PM +0000, Peter Maydell wrote:
> Date: Tue, 20 Feb 2024 16:06:16 +0000
> From: Peter Maydell <peter.maydell@linaro.org>
> Subject: [PATCH 04/10] include/qom/object.h: New
> OBJECT_DEFINE_SIMPLE_TYPE{, _WITH_INTERFACES} macros
> X-Mailer: git-send-email 2.34.1
>
> We have an OBJECT_DEFINE_TYPE_EXTENDED macro, plus several variations
> on it, which emits the boilerplate for the TypeInfo and ensures it is
> registered with the type system. However, all the existing macros
> insist that the type being defined has its own FooClass struct, so
> they aren't useful for the common case of a simple leaf class which
> doesn't have any new methods or any other need for its own class
> struct (that is, for the kind of type that OBJECT_DECLARE_SIMPLE_TYPE
> declares).
>
> Pull the actual implementation of OBJECT_DEFINE_TYPE_EXTENDED out
> into a new DO_OBJECT_DEFINE_TYPE_EXTENDED which parameterizes the
> value we use for the class_size field. This lets us add a new
> OBJECT_DEFINE_SIMPLE_TYPE which does the same job as the various
> existing OBJECT_DEFINE_*_TYPE_* family macros for this kind of simple
> type, and the variant OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES for
> when the type will implement some interfaces.
>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> docs/devel/qom.rst | 34 +++++++++++--
> include/qom/object.h | 114 +++++++++++++++++++++++++++++++++----------
> 2 files changed, 117 insertions(+), 31 deletions(-)
>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Re: [PATCH 06/10] hw/core: Add ResetContainer which holds objects implementing Resettable, Zhao Liu, 2024/02/26
[PATCH 04/10] include/qom/object.h: New OBJECT_DEFINE_SIMPLE_TYPE{, _WITH_INTERFACES} macros, Peter Maydell, 2024/02/20
[PATCH 07/10] hw/core/reset: Add qemu_{register, unregister}_resettable(), Peter Maydell, 2024/02/20
[PATCH 10/10] docs/devel/reset: Update to discuss system reset, Peter Maydell, 2024/02/20
[PATCH 08/10] hw/core/reset: Implement qemu_register_reset via qemu_register_resettable, Peter Maydell, 2024/02/20
[PATCH 09/10] hw/core/machine: Use qemu_register_resettable for sysbus reset, Peter Maydell, 2024/02/20