qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 01/27] qom: add the base Object class


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 01/27] qom: add the base Object class
Date: Thu, 22 Dec 2011 21:25:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

On 12/22/2011 06:25 PM, Kevin O'Connor wrote:
Why not declare types with something like the following:

TypeInfo my_device_info = {
     .name = "my-device",
     .parentinfo =&device_info,
     .instance_size = sizeof(MyDevice),
};

That is, instead of looking up the TypeImpl via a string, lookup the
TypeImpl via the address of the TypeInfo.  (Or possibly store a
pointer to TypeImpl in TypeInfo during registration.)

This requires all modules to provide a header file just for the TypeInfo or TypeImpl. It doesn't let you use work purely through introspection.

Paolo



reply via email to

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