qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC] QDev explicit constructors & destructors


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC] QDev explicit constructors & destructors
Date: Wed, 24 Jun 2015 10:51:12 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0


On 23/06/2015 22:10, Liviu Ionescu wrote:
> I suggest your review should start from use cases like this:
> 
>     DeviceState *dev = my_dev_alloc(NULL, TYPE_MYTYPE);
>     my_dev_prop_set_bool(dev, "param", true);
>     my_dev_construct(OBJECT(dev), NULL);
>     my_dev_prop_set_uint32(dev, "xyz", 123);
>     my_dev_realize(dev);
> 
> please ignore the fictional function names, and just assume that constructing 
> the object requires a parameter that is given on the command line, so it does 
> not exist statically at .instance_init time.
> 
> the point here is that "xyz" is an alias, created during construction time.

Can you explain this with real function names and parameters?

Paolo



reply via email to

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