qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] qom: Introduce object_realize_nofail()


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v2] qom: Introduce object_realize_nofail()
Date: Fri, 13 Apr 2012 00:31:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120312 Thunderbird/11.0

Am 12.04.2012 23:24, schrieb Anthony Liguori:
> I think you're trying to run before we walk.

The opposite is the case: I am trying to walk by improving code that was
not even qdev'ified before I touched it (see the sh4 commit in my
previous message). But now you are telling me I can't get a function for
that because Paolo and you want to run to a stage where realize doesn't
create new objects, which in reality today it does.

So what about applying a modified version of my patch that clearly marks
it as "obsolete"? Then we can at least move forward with sh4 (and prep
and ...). There's still quite some state around that just g_malloc()s
some struct and passes it around in opaques - that's also where I was
wishing for a QOM board object so that board state can be properly modelled.

I really don't see the point why I should uselessly make objects SysBus
without needing MemoryRegions or GPIO qemu_irqs and in the knowledge
that SysBus as an articial non-bus is supposed to die in QOM, just so
that I can use the existing qdev_init_nofail() for two-stage construction.

initfn is unable to handle errors btw, which is another reason to do
object creations in a second-stage constructor.

Maybe we need to decouple that from realize altogether and move to
three-stage constructors instead? With ObjectClass::realize() being for
new and reviewed code, like you just suggested, and simply moving
DeviceClass::init() to ObjectClass::init() in addition to .instance_init?

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]