aboutsummaryrefslogtreecommitdiff
path: root/qom
AgeCommit message (Collapse)AuthorFilesLines
2012-02-03container: make a decendent of ObjectAnthony Liguori3-6/+32
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1 -> v2 - Add license (Paolo)
2012-02-03object: sure up reference countingAnthony Liguori1-2/+14
Now we have the following behavior: 1) object_new() returns an object with ref = 1 2) object_initialize() does not increase the reference count (ref may be 0). 3) object_deref() will finalize the object when ref = 0. it does not free the memory associated with the object. 4) both link and child properties correctly set the reference count. The expected usage is the following: 1) child devices should generally be created via object_initialize() using memory from the parent device. Adding the object as a child property will take ownership of the object and tie the child's life cycle to the parent. 2) If a child device is created via qdev_create() or some other form of object_new(), there must be an object_delete() call in the parent device's finalize function. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-03qom: accept any compatible type when setting a link propertyAnthony Liguori1-4/+5
Links had limited utility before as they only allowed a concrete type to be specified. Now we can support abstract types and interfaces which means it's now possible to have a link<PCIDevice>. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-03qom: move properties from qdev to objectAnthony Liguori1-0/+468
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. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-03qom: allow object_class_foreach to take additional parameters to refine searchAnthony Liguori1-2/+16
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: change ambiguous qdev namesAnthony Liguori1-0/+5
Reported-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qom: add the base Object class (v2)Anthony Liguori2-0/+486
This class provides the main building block for QEMU Object Model and is extensively documented in the header file. It is largely inspired by GObject. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1 -> v2 - remove printf() in type registration - fix typo in comment (Paolo) - make Interface private - move object into a new directory and move header into include/qemu/ - don't make object.h depend on qemu-common.h - remove Type and replace it with TypeImpl * (Paolo) - use hash table to store types (Paolo) - aggressively cache parent type (Paolo) - make a type_register and use it with interfaces (Paolo) - fix interface cast comment (Paolo) - add a few more functions required in later series