Il 12/04/2012 16:47, Anthony Liguori ha scritto:
> 
>> Wrap setting of Object::realized property, error reporting and exit(1)
>> into a helper function. It is the equivalent of qdev_init_nofail().
> 
> I don't like this.
> 
> If for no reason other than, a much more specific justification is
> needed for this.  I absolutely don't want to repeat the error handling
> mistakes of qdev.  I would rather we refactor all of the users of
> qdev_init_nofail() to propagate errors.

I agree about this in general, but for a different reason.  There should be
only one call to object_realize_nofail, in vl.c, which might as well be
inlined---I'll include it in my series.  All calls to qdev_init_nofail
and qdev_init should disappear from boards that are properly converted
to QOM.  Next on my QOM list (for 1.2) is a scripted refactoring to

ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq);

to

ISADevice *rtc_new(ISABus *bus, int base_year, qemu_irq intercept_irq);

static ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
{
    ISADevice *dev = rtc_new(bus, base_year, intercept_irq);
    qdev_init_nofail(dev);
    return dev;
}

Paolo

Reply via email to