]> git.proxmox.com Git - qemu.git/commit - include/qom/object.h
qom: Reimplement Interfaces
authorAnthony Liguori <aliguori@us.ibm.com>
Fri, 10 Aug 2012 03:16:10 +0000 (13:16 +1000)
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>
Mon, 13 Aug 2012 09:20:41 +0000 (11:20 +0200)
commit33e95c6328a3149a52615176617997c4f8f7088b
tree8b34f5d3e24cdee929827d67ec17b16ef486eafd
parent669b4983018cf13e2adafe1b1b4e1e4053eeb90b
qom: Reimplement Interfaces

The current implementation of Interfaces is poorly designed.  Each interface
that an object implements ends up being an object that's tracked by the
implementing object.  There's all sorts of gymnastics to deal with casting
between these objects.

But an interface shouldn't be associated with an Object.  Interfaces are global
to a class.  This patch moves all Interface knowledge to ObjectClass eliminating
the relationship between Object and Interfaces.

Interfaces are now abstract (as they should be) but this is okay.  Interfaces
essentially act as additional parents for the classes and are treated as such.

With this new implementation, we should fully support derived interfaces
including reimplementing an inherited interface.

PC: Rebased against qom-next merge Jun-2012.

PC: Removed replication of cast logic for interfaces, i.e. there is only
one cast function - object_dynamic_cast() (and object_dynamic_cast_assert())

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
include/qemu/object.h
qom/object.c