mbox series

[0/2] qom: Introduce class_post_init() handler

Message ID 20250125165855.32168-1-philmd@linaro.org (mailing list archive)
Headers show
Series qom: Introduce class_post_init() handler | expand

Message

Philippe Mathieu-Daudé Jan. 25, 2025, 4:58 p.m. UTC
Add a class_post_init() handler to be called by parents
*after* child class_init() handler is called. This is
necessary to have parent class check children properly
set some values or mandatory handlers.

Philippe Mathieu-Daudé (2):
  qom: Declare class_base_init() before class_init()
  qom: Introduce class_post_init() handler

 include/qom/object.h     | 17 ++++++++++-------
 qom/object.c             | 14 ++++++++++++--
 rust/qemu-api/src/qom.rs |  8 +++++++-
 3 files changed, 29 insertions(+), 10 deletions(-)

Comments

Richard Henderson Jan. 26, 2025, 12:28 p.m. UTC | #1
On 1/25/25 08:58, Philippe Mathieu-Daudé wrote:
> Add a class_post_init() handler to be called by parents
> *after* child class_init() handler is called. This is
> necessary to have parent class check children properly
> set some values or mandatory handlers.
> 
> Philippe Mathieu-Daudé (2):
>    qom: Declare class_base_init() before class_init()
>    qom: Introduce class_post_init() handler
> 
>   include/qom/object.h     | 17 ++++++++++-------
>   qom/object.c             | 14 ++++++++++++--
>   rust/qemu-api/src/qom.rs |  8 +++++++-
>   3 files changed, 29 insertions(+), 10 deletions(-)
> 

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Paolo Bonzini Jan. 27, 2025, 8:26 a.m. UTC | #2
On 1/25/25 17:58, Philippe Mathieu-Daudé wrote:
> Add a class_post_init() handler to be called by parents
> *after* child class_init() handler is called. This is
> necessary to have parent class check children properly
> set some values or mandatory handlers.
> 
> Philippe Mathieu-Daudé (2):
>    qom: Declare class_base_init() before class_init()
>    qom: Introduce class_post_init() handler
> 
>   include/qom/object.h     | 17 ++++++++++-------
>   qom/object.c             | 14 ++++++++++++--
>   rust/qemu-api/src/qom.rs |  8 +++++++-
>   3 files changed, 29 insertions(+), 10 deletions(-)

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo