qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Akihiko Odaki" <odaki@rsg.ci.i.u-tokyo.ac.jp>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PULL 22/29] hw/core/register: Do not unparent in instance_finalize()
Date: Wed, 24 Sep 2025 11:28:42 +0200	[thread overview]
Message-ID: <20250924092850.42047-23-pbonzini@redhat.com> (raw)
In-Reply-To: <20250924092850.42047-1-pbonzini@redhat.com>

From: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>

Children are automatically unparented so manually unparenting is
unnecessary.

Worse, automatic unparenting happens before the instance_finalize()
callback of the parent gets called, so object_unparent() calls in
the callback will refer to objects that are already unparented, which
is semantically incorrect.

Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Link: https://lore.kernel.org/r/20250924-use-v4-3-07c6c598f53d@rsg.ci.i.u-tokyo.ac.jp
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/core/register.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/core/register.c b/hw/core/register.c
index 8f63d9f227c..3340df70b06 100644
--- a/hw/core/register.c
+++ b/hw/core/register.c
@@ -314,7 +314,6 @@ RegisterInfoArray *register_init_block64(DeviceState *owner,
 
 void register_finalize_block(RegisterInfoArray *r_array)
 {
-    object_unparent(OBJECT(&r_array->mem));
     g_free(r_array->r);
     g_free(r_array);
 }
-- 
2.51.0



  parent reply	other threads:[~2025-09-24  9:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24  9:28 [PULL 00/29] Rust, QOM, docs changes for 2025-09-24 Paolo Bonzini
2025-09-24  9:28 ` [PULL 01/29] docs: use the pyvenv version of Meson Paolo Bonzini
2025-09-24  9:28 ` [PULL 02/29] rust: build: add back common and util tests Paolo Bonzini
2025-09-24  9:28 ` [PULL 03/29] rust: vmstate: use "cast()" instead of "as" Paolo Bonzini
2025-09-24  9:28 ` [PULL 04/29] rust: build: remove "protocol: rust: from doctests Paolo Bonzini
2025-09-24  9:28 ` [PULL 05/29] subprojects: add attrs crate Paolo Bonzini
2025-09-24  9:28 ` [PULL 06/29] rust: qemu-macros: switch #[property] parsing to use combinators Paolo Bonzini
2025-09-24  9:28 ` [PULL 07/29] subprojects: Update .gitignore for proc-macro2 and syn Paolo Bonzini
2025-09-24  9:28 ` [PULL 08/29] subprojects: Ignore .wraplock file generated by meson v1.9.0 Paolo Bonzini
2025-09-24  9:28 ` [PULL 09/29] rust/qemu-macros: Fix Clippy's complaints about lambda parameter naming Paolo Bonzini
2025-09-24  9:28 ` [PULL 10/29] rust/common/uninit: Fix Clippy's complaints about lifetime Paolo Bonzini
2025-09-24  9:28 ` [PULL 11/29] rust/qdev: use addr_of! in QDevProp Paolo Bonzini
2025-09-24  9:28 ` [PULL 12/29] rust/qdev: Refine the documentation for QDevProp trait Paolo Bonzini
2025-09-24  9:28 ` [PULL 13/29] rust/qdev: Support property info for more common types Paolo Bonzini
2025-09-24  9:28 ` [PULL 14/29] rust/qdev: Support bit property in #property macro Paolo Bonzini
2025-09-24  9:28 ` [PULL 15/29] rust/qdev: Test bit property for #property Paolo Bonzini
2025-09-24  9:28 ` [PULL 16/29] rust/hpet: Clean up type mismatch for num_timers property Paolo Bonzini
2025-09-24  9:28 ` [PULL 17/29] rust/hpet: Convert qdev properties to #property macro Paolo Bonzini
2025-09-24  9:28 ` [PULL 18/29] rust/qdev: Drop declare_properties & define_property macros Paolo Bonzini
2025-09-24  9:28 ` [PULL 19/29] linux-user: avoid -Werror=int-in-bool-context Paolo Bonzini
2025-09-24  9:28 ` [PULL 20/29] docs/devel: Do not unparent in instance_finalize() Paolo Bonzini
2025-09-24  9:28 ` [PULL 21/29] vfio/pci: " Paolo Bonzini
2025-09-24  9:28 ` Paolo Bonzini [this message]
2025-09-24  9:28 ` [PULL 23/29] hv-balloon: hw/core/register: " Paolo Bonzini
2025-09-24  9:28 ` [PULL 24/29] hw/sd/sdhci: " Paolo Bonzini
2025-09-24  9:28 ` [PULL 25/29] vfio: " Paolo Bonzini
2025-09-24  9:28 ` [PULL 26/29] hw/xen: " Paolo Bonzini
2025-09-24  9:28 ` [PULL 27/29] docs/code-provenance: clarify scope very early Paolo Bonzini
2025-09-24  9:28 ` [PULL 28/29] docs/code-provenance: make the exception process more prominent Paolo Bonzini
2025-09-24  9:28 ` [PULL 29/29] docs/code-provenance: AI exceptions are in addition to DCO Paolo Bonzini
2025-09-24 21:16 ` [PULL 00/29] Rust, QOM, docs changes for 2025-09-24 Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250924092850.42047-23-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).