qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	qemu-devel <qemu-devel@nongnu.org>,
	Markus Armbruster <armbru@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: QOM address space handling
Date: Tue, 10 Nov 2020 12:40:18 +0100	[thread overview]
Message-ID: <4d4b1f60-98b6-6a41-42e7-685b2059da4c@redhat.com> (raw)
In-Reply-To: <0ad53d69-ce4a-c5ea-fba4-fa19daada11c@ilande.co.uk>

On 10/11/20 12:14, Mark Cave-Ayland wrote:
> There are 2 possible solutions here: 1) ensure QOM objects that add 
> address spaces during instance init have a corresponding instance 
> finalize function to remove them or 2) move the creation of address 
> spaces from instance init to realize.
> 
> Does anyone have any arguments for which solution is preferred?

I slightly prefer (1) because there could be cases where you also create 
subdevices using that address space, and in order to set properties of 
subdevices before realize, you would have to create the subdevices in 
instance_init as well.

Thanks,

Paolo

> As part of this work I hacked up an address_space_count() function in 
> memory.c that returns the size of the address_spaces QTAILQ and added a 
> printf() to display the value during instance init and finalize which 
> demonstrates the problem nicely. This means it should be possible to add 
> a similar to check to device-introspect-test in future to prevent 
> similar errors from happening again.



  reply	other threads:[~2020-11-10 11:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10 11:14 QOM address space handling Mark Cave-Ayland
2020-11-10 11:40 ` Paolo Bonzini [this message]
2020-12-18  7:49   ` Mark Cave-Ayland
2020-12-18 22:32     ` Eduardo Habkost
2020-12-20  9:25       ` Paolo Bonzini
2020-12-21 18:54         ` Eduardo Habkost
2020-12-21 19:16           ` Paolo Bonzini
2020-12-21 19:28             ` Eduardo Habkost
2020-11-10 15:03 ` Eduardo Habkost
2020-11-10 15:08   ` Paolo Bonzini
2020-11-10 17:46     ` Eduardo Habkost
2020-11-10 18:36       ` Eduardo Habkost

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=4d4b1f60-98b6-6a41-42e7-685b2059da4c@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --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).