Il 27/11/2013 15:37, Igor Mammedov ha scritto:
> It looks like "realize" for -object / object-add implemented via
> an interface.

It does---but without unrealize and with the additional get_base_path.

> Maybe it should be renamed from QOMCommandLineIface to QOMRealizeIface
> and s/complete/realize/ so anyone who knows about Device.realize would
> get meaning without digging in complete() implementations.

There is an important difference; realize is an internal method in
Device, the external interface is the property.  So perhaps it's the
other way round; if Device implements QOMCommandLineIface you could
start creating devices with -object.

> Alternative would be to behave just like Rng/Tpm do, i.e. use -object
> to do late initialization in a backend user (DimmDevice.realize).
> Draw back of it would be user won't get error during the first command
> "object-add" and only will get error when creating DimmDevice calling
> "device_add".

That's also a possibility.  But again, maybe it's the other way round
and Rng/Tpm could enjoy better error handling if we add the interface.

Paolo

Reply via email to