qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 17/23] qom: move properties from qdev to object


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 17/23] qom: move properties from qdev to object
Date: Wed, 01 Feb 2012 14:01:28 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15

On 01/31/2012 01:46 AM, Paolo Bonzini wrote:
On 01/30/2012 10:08 PM, Anthony Liguori wrote:
This is mostly code movement although not entirely. This makes properties part
of the Object base class which means that we can now start using Object in a
meaningful way outside of qdev.

Can we move them to an intermediate base class? I would like to use QOM
refcounting for other objects, such as SCSIRequest, so it is important to have
Object as a pretty light-weight class. Also (and perhaps more importantly),
interface implementations are Objects too and they do not need properties.

I cannot think of any better name than IntrospectableObject, which is quite a
mouthful. I suppose that we could have the base class but still pass the objects
to the function as Object * and use the OBJECT macro. Nothing of this is in a
hot path anyway.

I'm just not sure how I feel about this.

The overhead of properties are small in terms of object size. It's just sizeof(void *).

I think that read-only properties could be interesting for SCSIRequest. For instance, I can imagine having SCSIRequest is-a BlockRequest and having an error property associated with it. That would provide a nice way to have an info io operation that returned a list of failed I/O requests or something like that.

Regards,

Anthony Liguori


Paolo





reply via email to

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